save drop down values on selected index changed

Hi all,

I have a form with drop down controls and single line of text controls.The drop downs are populated one by one on the selection.If i select second dropdown the third dropdown is populated and after i selected all fields i uploaded a document using form and clicks on submit button the data is saved in library.Again i wanted to upload new document i wanted to change only two dropdowns in same form when changing the second dropdown  the third drop down value is refreshed,Is there any way to handle with out refreshing these drop downs values i have to upload new document.Please help.

Regards,

Praveen

July 22nd, 2015 2:00am

Hi Praveen,

If you want to without refresh the dropdowns value, we can use DropDownList and set AutoPostBack=true, then use the following code in code-behind.

private static int index = 0;
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        DropDownList1.SelectedIndex = index;
    }
}

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
    index = DropDownList1.SelectedIndex;
}

Or we can store the values in Session or Cookie, then get the values when page load.

Best Regards

Free Windows Admin Tool Kit Click here and download it now
July 23rd, 2015 2:55am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics