I have a bunch of textboxes on my asp.net page, and on TextChanged event, I want to run a stored proc to return a Name, based on user input. If I have a block of code like:
TextBox t = (TextBox)sender;
string objTextBox = t.ID;
how can I get the .Text
value of objTextBox?
Did you try using t.Text
?
if(sender is TextBox) {
var text = (sender as TextBox).Text;
}
Source: Stackoverflow.com