Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 250591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:31:26+00:00 2026-05-11T21:31:26+00:00

I’m trying to do an invitation system, and if my solution is looking weird

  • 0

I’m trying to do an invitation system, and if my solution is looking weird even to myself
something gotta be wrong.

A user call an URL for an invitation

site.com/Account/Invitation/invitationGUID

public ActionResult Invitation(Guid invitationGUID)
{
    //Check for the existence of the invitation id
    if(true)
        return RedirectToAction("Account","Register")
    return View("InvalidInvite");
}

I need to pass the invitationGUID to the Register action

public ActionResult Register()
{
    //this is the registration form
    return View();
}

And I still need the invitationGUID at the post, to save this information

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Register(string email, string password, string confirmPassword,
                                 string firstName, string lastName, string cep)
{
    //register user
    return View();
}

What should I be doing to pass this information along?
I tried passing the data from Invitation -> Register

return RedirectToAction("Account","Register",invitationGUID)

Calling the Register view with the invitationGUID

return View("Register",invitationGUID);

And Using a hidden input at the Register View to get it back to Register with POST

<%= Html.Hidden("invitationGUID",(Guid)Model %>

It looks too interweaving to my taste, and I’m probably breaking a lot of good practices regarding view/controller isolation.
Should I just be replicating the Register code at Invitation?
I’m tending to just replicating the Register POST action at an Invitation POST right now.
Any idea what I should be doing differently?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:31:26+00:00Added an answer on May 11, 2026 at 9:31 pm

    I don’t think your breaking any best practices. Step back and think of what you want to do. You want a user with an open invitation to be able to register.

    The user posting a registration must supply their inviteID. So, the Register action must be passed an inviteID. You have this.

    If your expecting your users to use a browser as their client to register – they’ll need to be given a form allowing them to register. You probably don’t want them typing in their inviteIDs – so this should be filled out for them. Thus, your register view needs to be given an inviteID to property render the form. You have this.

    The only thing I might suggest is skipping the whole Invitation action. Its not really needed. Instead just do the error checking in the Register action.

    Its fine to pass required route data around when you’re redirecting. If you can’t resolve a route with out some data then how else would you do it? In this case, the route is dependent on the inviteId (since its needed to render the form). Pass it and be happy 🙂

    So, in summary. What you’re doing isn’t that convoluted. Think of each step as if you knew nothing about the others. Also, I’d recommend having the users HTTP GET a route that looks like this:

    site.com/Account/Register/invitationGUID
    

    or

    site.com/Account/Register?invite=invitationGUID
    

    The choice between above is dependent on whether you want to explicitly have the invite id in the action’s signature (and require it for the route to be resolved) or if you want to look at the QueryString from within the action. I might lean toward query string on this one since the invite is not the entity being altered here – its the gateway allowing a user entity to be created. Users with no inviteID should probably end up at this action as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 122k
  • Answers 122k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try doing as little as possible in your main form's… May 12, 2026 at 12:37 am
  • Editorial Team
    Editorial Team added an answer Actually I was a bit misguided by user's feedback: after… May 12, 2026 at 12:37 am
  • Editorial Team
    Editorial Team added an answer When transferring numeric values across the internet, you have 2… May 12, 2026 at 12:37 am

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.