RequiredfieldValidator
-
hi i want to validate a Textbox which is in a webpartZone, i am able to do that when my aspx page is not inheriting from master page, but when I am using a aspx page with master page and my Textbox in side a webpartZone I am not able to valdate the text box .it through an error Unable to find control id 'TextBox1' referenced by the 'ControlToValidate' property of 'RequiredFieldValidator1' please give some . Regards Smruti Smruti
-
hi i want to validate a Textbox which is in a webpartZone, i am able to do that when my aspx page is not inheriting from master page, but when I am using a aspx page with master page and my Textbox in side a webpartZone I am not able to valdate the text box .it through an error Unable to find control id 'TextBox1' referenced by the 'ControlToValidate' property of 'RequiredFieldValidator1' please give some . Regards Smruti Smruti
Hello. Do you have another "TextBox1" somewhere on your page? Perhaps in the Master page itself? If so - ASP.NET renames the controls in order to get a unique ID. It should automatically rename your RequiredFieldValidator1 reference to the control as well. But perhaps this does not happen as expected. Anyway you should go check it out. I've found the best way to debug this, is to try and rename your control to something logic eg. "txtName" - that way you ensure, that you decide the names, and not Visual Studio, because, well, it's best the other way around. ;-) Best Regards Soeren