pratikshahse
asked on
change the textbox name
I have a function which will delete the text in a textbox. I have attached the code in the code window. "row" is a string value which I want to attach to the textbox name so I can get actual textbox name. the syntax that I have is not right. what do i need to do in order to attach a stringvalue to the textboxname to get the correct name
protected void DeleteRow( string row)
{
textbox + row .Text = "";
// row = 2
// so what i want to do is
//textbox2.Text = "";
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi pratikshahse,
U cannot assign the Text as u have done... The thing is it takes that (textbox + row) as a string and will not consider as a id of the Text Box.. u Should go with the approach suggested by Shaun_Kline...
U cannot assign the Text as u have done... The thing is it takes that (textbox + row) as a string and will not consider as a id of the Text Box.. u Should go with the approach suggested by Shaun_Kline...
The example assumes the textbox is just on a page and not embedded in placeholders, data controls like gridviews or panels.
If in a panel it would just be
Dim tmp as textbox = Ctype(pnPanelName.findcont
tmp.text = ""
Open in new window