Values retaining in registration page

Posted by Shalini4duck under ASP.NET on 9/8/2009 | Views : 1199 | Status : [Member] | Replies : 2
hi frnds

i have a 'registration page' and 'preview page' after entering registration details preview page wil display... i have two buttons in preview page one button for 'save' and second for 'edit' which redirects again to registration page for editing previous details....

but i click edit it redirtects to registration page but all the values previous entered are erasing...

so please tell me how to handle state managamant for my problem...

how to use query string while redirecting ...

what is the logic here?

please send me in C# codeing

thanx in advance


Posted by: Lakhangarg on: 9/8/2009 [Member] [Moderator] Silver

Hi Shalini-

Pass the userID to the Page.. most probably you have that in the Session Variable.

Now check if the Request.UrlRefrrer is of Perview page then get all the values for given userID from database and fill the values in respective controls at Page_Load Event.

Thanks & Regards
Lakhan Pal Garg

Shalini4duck, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rtpharry on: 9/8/2009 [Member] [MVP] Bronze

Hey, you could use :


although you are not guaranteed to have all ServerVariables on all servers.

If you dont have to guess then you will need to build it yourself by using string.format:

String name = HttpUtility.UrlEncode(Request.QueryString["name"]);

String email = HttpUtility.UrlEncode(Request.QueryString["email"]);
Response.Redirect(String.Format("~/Page.aspx?Name={0}&Email={1}", name, email));

extend the example out to include as many parameters as you need.

Shalini4duck, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response