I'm using an ASP.NET drop-down box and have hooked up a javascript function to "OnChange" event.
The function actually redirects the control back to the page load function in server, and refreshes the page. I'm not supposed to set the auto-post back property to true.
I'd like to make sure that the drop-down holds the selected value after the page has been refreshed.
Should I use any hidden variables or is there a property in asp.net that can help me achieve this ?
Any help would be much appreciated. Thanks
My code would look something like this..
<asp:DropDownList ID="CountriesDropDown" Width="100" runat="server" OnChange = "Send(this);"/>
function Send(dropdown)
{
//Should I write any code here ?
refreshpage(); //separately implemented to redirect the url back to server
}
In server side
PageLoad()
{
CountriesDropDown.DataSource = CountriesList;
ContriesDropDown.DataBind();
//are there any properties that I could use so that the drop-down retains the selected value ?
}