T
Thom Little
I want to manually reset the DropDownList when using AutoPostBack to its
default value that has entry 0 as the default.
The following puts the select name and value in two labels and resets the
dropdown to the default.
private void ddlA_SelectedIndexChanged(object sender, System.EventArgs e )
{
string strValue = ddlA.SelectedItem.Value ;
lblA.Text = ddlA.SelectedItem.Text;
lblB.Text = strValue ;
ddlA.SelectedIndex = 0 ;
Response.Write( "" );
}
The following does not put the selected name and value in the two labels and
does not reset the dropdown to the default but it does transfer to the URL
in the selected value.
private void ddlA_SelectedIndexChanged(object sender, System.EventArgs e )
{
string strValue = ddlA.SelectedItem.Value ;
lblA.Text = ddlA.SelectedItem.Text;
lblB.Text = strValue ;
ddlA.SelectedIndex = 0 ;
Response.Write( "" );
Response.Redirect( "http://" + strValue );
}
How can I reset the index and also do the redirect?
I can not disable the Cache because I want this code to work in browsers
other than Internet Explorer.
default value that has entry 0 as the default.
The following puts the select name and value in two labels and resets the
dropdown to the default.
private void ddlA_SelectedIndexChanged(object sender, System.EventArgs e )
{
string strValue = ddlA.SelectedItem.Value ;
lblA.Text = ddlA.SelectedItem.Text;
lblB.Text = strValue ;
ddlA.SelectedIndex = 0 ;
Response.Write( "" );
}
The following does not put the selected name and value in the two labels and
does not reset the dropdown to the default but it does transfer to the URL
in the selected value.
private void ddlA_SelectedIndexChanged(object sender, System.EventArgs e )
{
string strValue = ddlA.SelectedItem.Value ;
lblA.Text = ddlA.SelectedItem.Text;
lblB.Text = strValue ;
ddlA.SelectedIndex = 0 ;
Response.Write( "" );
Response.Redirect( "http://" + strValue );
}
How can I reset the index and also do the redirect?
I can not disable the Cache because I want this code to work in browsers
other than Internet Explorer.