I have a Default.aspx that redirects to a Page1.aspx. My ddl is loaded and ordered from a database. How do I make the ddl selection show up on the page load depending on what the user selects on the Default page?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
You will need to pass some kind of data from Default.aspx to Page1.aspx. I would suggest using a query string. So for example on Default.aspx you would redirect to:
Response.Redirect('~/Page1.aspx?selectValue=5');And then on Page1.aspx in Page_Load you would do something like
myDropDownList.SelectedValue = Request.QueryString('selectValue');Obviously you’ll need to do some more checking on Page1.aspx to make sure Request.QueryString(‘selectValue’) exists, etc. but you get the idea.
edit-this is C#, so added the semicolon 😉