Retaining the values of web form controls when back button is clicked
I have several radio button list on my page and inside each list, I have several list items. I need to retrieve the radio button values when the back button is clicked. One way, I can do this store the values in session variables, but I was wondering if there is any easier way to store the values and then retrieve them when back button is clicked. All these radio button list are inside the Update panel and Content template.
<asp:UpdatePanel ID="updatePanel1" runat="server"> <ContentTemplate> <asp:RadioButtonList CssClass="radioBL" ID="rdbRiver" runat="server" OnSelectedIndexChanged="rdbRiverside_indexchanged" AutoPostBack="true" > <asp:ListItem Value="Yes">Yes</asp:ListItem> <asp:ListItem Value="No">No</asp:ListItem> </asp:RadioButtonList> <ContentTemplate> </updatePanel> any help will be greatly appreciated
Hum, I can only suggest that you provide the button to go back, or some button like done, or maybe submit. That way, you can pick up the values. But passing back to the previous page? Well, you need to use session() anyway, or add parameters to the URL when you navigate (and again, that means your button to navigate, and not the build in one.
Hi @Anjali Agarwal ,
What's your purpose to store the radio button list? If you want to save it and search something based on the item value on the other page,you must to use session. It's more easier. However, if you only need to get and save the item value on the self page,you could save it in the hidden field.
Sign in to comment