Server Controls

Results 1 to 2 of 2

Thread: Server Controls

  1. #1
    Join Date
    Dec 1969

    Default Server Controls

    Hi,<BR><BR>I&#039;m new to ASP.NET and reading some articles about server controls. What I understood is with ASP.NET we can associate controls (like textbox, buttons) with server. In the server-side code we can get the property values just like VB. This is good. But can we really replace HTML controls with server controls in all occasions ? With regular ASP page ( with JavaScript for client-side) we validate the controls without reloading the page. If I&#039;m correct with server controls we have to reload the page to validate any user entered information. Is this a good practice ?<BR><BR>THANKS

  2. #2
    Join Date
    Dec 1969

    Default RE: Server Controls

    1) Yes you are right. You associate them with the server side. I have not seen any controls you cannot replace, just remember to embed the runat="server" attribute. Some names have changed, and some not. Like if you want to have an upload field, it is more or less the same as normal HTML:<BR><BR>&#060;input type="file" id="upload" Runat="server" /&#062;<BR><BR>A difference here is that you NEED to have runat server. The server maintains a table so it is easy for you to access the different controls on your page. To access this one, you simply type:<BR><BR>upload.MethodName()<BR><BR>2) It is not all true, what you write about the validation on server side. MS have given us some controls called validation controls. From these you are able to validate information, on server AS WELL AS ON CLIENT. This is very important. You are here able to write code once, and the app will test it on both on the server and on the client - of cause with the choice of disabling one or both of them. If you really want, you can write your own client validation, but this in visual basic. Hope this was enough information.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts