By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,686 Members | 1,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,686 IT Pros & Developers. It's quick & easy.

how to open same form in two different ways

P: 3
Hi

I am working on asp.net2.0. I have two pages : Default1.aspx and Default2.aspx.This Default2.aspx is basically an application form which allows the user to enter his details.I have also written code for retreiving data from the backend so that the form is filled with the details for editting purpose.Now in my Default1.aspx page i have two buttons:first button will take me to the default2.aspx page which will allow me to fill up details and the second button should take me to the same default2.aspx page but this one has the form filled up for editting.how do i do this?I dont want to have two different default pages for doing this because that will make me have a lot of pages for my web application.instead is there a way for me to do this?Please help me out!!!
Thanking in advance.
Aug 16 '07 #1
Share this Question
Share on Google+
1 Reply


prabunewindia
100+
P: 199
hi rekha,
u can pass his user id (primary key field in database) thru querystring.
and get the query string value in the next page and if it is null then just
leave it for blank and if it have any value, then fill it ya.

Response.Redirect("default2.aspx?userID=5");

get it by:
if(Convert.ToInt32(Context.QueryString.Get("userID ")!=0)
{
int userID=(Convert.ToInt32(Context.QueryString.Get("u serID");
//fill fields by getting data from database
}
else
{
//just leave it as blank
}

Prabu

Hi

I am working on asp.net2.0. I have two pages : Default1.aspx and Default2.aspx.This Default2.aspx is basically an application form which allows the user to enter his details.I have also written code for retreiving data from the backend so that the form is filled with the details for editting purpose.Now in my Default1.aspx page i have two buttons:first button will take me to the default2.aspx page which will allow me to fill up details and the second button should take me to the same default2.aspx page but this one has the form filled up for editting.how do i do this?I dont want to have two different default pages for doing this because that will make me have a lot of pages for my web application.instead is there a way for me to do this?Please help me out!!!
Thanking in advance.
Aug 16 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.