Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have an ASP.NET page with a drop down list, a text box and yes/no dropdown list with a save button. When each item in this dropdown list is selected the user should be able to enter data into text box, select yes/ no option from second dropdown and save this. Later, the page should get refreshed and the user should be able to enter data for the second selection of the dropdown list ( I mean the user should be able to enter yes/no dd and text box and save). Later when the user clicks on save the page has to navigate to next page.

Currently, I have the ddlists and textbox. But, for each selection of Ddlist I have the same page selected with data in it. but, I want the page to be refreshed for each selection.

I have an option to use Ajax asp.net. However, please suggest a different way to do this.

Thanks,
Dimpy
Posted

1 solution

I would suggest you to have more controls on the page for the second selection. That means the same sort of controls again copied below the first set of controls.

Either you can show all the 6 controls at a time or have one button showing "Add another selection", on click of which you will show another set of controls.

Otherwise, if you want to refresh, then you need to set AutoPostback property of the second DropDownList. Inside its SelectedIndexChanged Event, you need to save the current selection in Session and reset the controls for another selection.
 
Share this answer
 
Comments
Member 10558417 5-Jul-15 15:02pm    
Tadit,

I will try this and let you know.
thanks
Member 10558417 5-Jul-15 15:06pm    
Also, I cannot add additional controls, it has to be the same page with different options for the user to select and save to the database. The first dropdown has 10 items, so having additional items for each selection might be a repetition of the same controls. Can you please suggest accordingly.
So, then refresh page on last dropdown selection as I said. Inside that event, reset all values and store previous values in session for later use.
Member 10558417 6-Jul-15 9:49am    
I can't seem to think about that. Can you please send me a code snippet.
Member 10558417 8-Jul-15 6:31am    
Can you please respond to my question. I have never implemented such a functionality before. Can you please explain with code snippets. Thanks
I appreciate your help in advance.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900