3 Replies - 872 Views - Last Post: 07 January 2013 - 02:30 AM Rate Topic: -----

#1 mil1234  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 109
  • Joined: 01-February 09

use or not use runat = "server"

Posted 05 January 2013 - 06:19 AM

Hi Guys,

i have a doubt were i am collecting info from a form with textboxes with run at server, but these textboxes values are being passed to a javascript function which in turn routes these values to a web method in ASP.net code behind so my business process can then execute. in this case do i have to use the run at server??

Thanks
Is This A Good Question/Topic? 0
  • +

Replies To: use or not use runat = "server"

#2 AndreasD  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 14
  • Joined: 04-January 13

Re: use or not use runat = "server"

Posted 05 January 2013 - 04:01 PM

I'm not sure, But mainly i always use the tag runat="server"

ASP.NET parser interpretes standard html elements w/ runat="server" tag as html server controls.

All HTML server controls must be within a <form> tag with the runat="server" attribute. The runat="server" attribute indicates that the form should be processed on the server. It also indicates that the enclosed controls can be accessed by server scripts.
Was This Post Helpful? 1
  • +
  • -

#3 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 441
  • View blog
  • Posts: 1,488
  • Joined: 28-April 09

Re: use or not use runat = "server"

Posted 05 January 2013 - 09:15 PM

if the textboxes are not being used in the code on the server side then there is not really a need for the runat=server, just use standard html textboxes.
Was This Post Helpful? 1
  • +
  • -

#4 raghav.naganathan  Icon User is offline

  • Perfectly Squared ;)
  • member icon

Reputation: 408
  • View blog
  • Posts: 1,440
  • Joined: 14-September 12

Re: use or not use runat = "server"

Posted 07 January 2013 - 02:30 AM

Well what the runat="server" does is tells the compiler that specific tag needs to run on the server server-side.

If that attribute wasn't present, then it assumes it is regular markup and passes it to the client.

Also, here is a very informative thread where your question is analyzed in several ways and has different viewpoints. Do take a look :)

regards,
Raghav
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1