Hello
I have a product page that is created from a product template. The template has a number of text boxes on it. I know what the InputFieldIds associated with those text boxes are. Is the a way to find the control.ID of a text box when all I have is a InputFieldId?
For example I know the InputFieldId for one of the text boxes is 30. When I look at the control.ID I get something like ctl00_wpm_ShowProduct_ctl06_InputField_30. Does anybody know how this long ID gets generated? Is there something I can use where I can specify the InputFieldId and get back this ID?
Thanks!
textbox control ID
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 21
- Joined: Tue Mar 03, 2009 10:49 am
Re: textbox control ID
When these textboxes are going to be added to page you can get this id through ClientId property. For example
When you need to find the control you need to use above id for example
Code: Select all
if(o is TextBox)
{
string controlId = o.ClientId;
.....
.....
}
Code: Select all
Control control = PageHelper.RecursiveFindControl(this,clientId);