G
Guest
Hello,
I want to be able to reload a DropDownList when a TextBox changes its value.
So I set the AutopostBack property of the TextBox to true and in the code
behind I do something like:
if(IsPostBack)
{
if( ((TextBox)sender).ID == "myTextBox" )
myDropDownList.DataBind();
}
I receive an error "Specified cast is not valid" in the if(
((TextBox)sender).ID == "myTextBox" ) line.
What am I doing wrong?
Thank you,
I want to be able to reload a DropDownList when a TextBox changes its value.
So I set the AutopostBack property of the TextBox to true and in the code
behind I do something like:
if(IsPostBack)
{
if( ((TextBox)sender).ID == "myTextBox" )
myDropDownList.DataBind();
}
I receive an error "Specified cast is not valid" in the if(
((TextBox)sender).ID == "myTextBox" ) line.
What am I doing wrong?
Thank you,