3

In my form I need to insert different inputs of type "hidden". The inputs must be html controls with "name" and "id's". Because I send this form to a external url.

For the validation I do runat=server in a hidden input and then I can use requiredfieldvalidator.

But the problem is when I look in the source after visiting the page the name is changed. for example

<input type="hidden" name="hotelIdform" value="" runat="server" id="hotelIdform">

changed to

 <input name="ctl00$ctl00$Master_Body$child_center_content$hotelIdform" type="hidden" id="hotelIdform" value="b4ba78fc-0b62-4809-9dca-000972573139" />

and i used ClientIDMode="Static" , just ID is okay

please help me

amirlol
  • 87
  • 8

1 Answers1

1

It seems you are using Master pages and not using static client ID. Thus, ASP.NET is changing the ID while it compiling the page.

You need to set ClientIDMode to Static.

Please refer this SO post

Community
  • 1
  • 1
Anuj Yadav
  • 980
  • 11
  • 20