0

I have a bunch of HTML controls created in a design. Now I want to convert them to ASP server controls. Can someone suggest me how to do this? Is it just enough to add runat attribute?

Akansha
  • 199
  • 2
  • 11

1 Answers1

1

You just have to add runat="server" and an id to access it id="whatever"

Example:

<input type="text" value="find" />

<input type="text" runat ="server" id="textId" value="find" />

You can use the id to access it in the codeBehind.

Alternatively, I think you can right click a control in the designer and select run as server control

cfly24
  • 1,882
  • 3
  • 22
  • 56
  • Upon adding the runat attribute and then when we try to inspect the element, will the runat attribute show up there? – Akansha Nov 05 '15 at 19:27