DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: QUERY: JavaScript vs. ASP.NET Web/Server Controls

  1. #1
    Join Date
    Mar 2006
    Posts
    24

    QUERY: JavaScript vs. ASP.NET Web/Server Controls

    Is it possible for JavaScript to access the DOM of ASP.NET Web/Server
    Controls?

    For example, I have a legacy HTML forms, controls, etc. If I convert all
    my HTML into Web Controls (by adding runat="server & id="") then will
    this affect my JavaScript code that accesses/modifies the DOM of the page
    (DOM tables, childs, elements, traversing, etc.) If so, what is the best
    way to make them compatible again?

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    ASP.NET server controls render standard HTML. You can use client-side JavaScript with them just as you would with standard HTML controls. The only difference is that ASP.NET generates unique names for the HTML controls, so you may have to change your JavaScript to look for the new control names.

    It's actually best to convert standard HTML controls to ASP.NET server controls only if you need to access them from code-behind. Your existing <table> elements, etc. will continue to work with ASP.NET; you only need to add runat="server" if you need to manipulate them from server-side ASP.NET code.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Replies: 1
    Last Post: 01-16-2006, 11:54 AM
  2. javascript and asp.net
    By cengo in forum ASP.NET
    Replies: 14
    Last Post: 09-15-2005, 02:53 PM
  3. Help: Javascript Access Database Query
    By panuvin in forum Database
    Replies: 0
    Last Post: 09-07-2005, 05:04 PM
  4. Replies: 2
    Last Post: 08-01-2005, 03:12 PM
  5. Free ASP.NET Web Matrix Design/Editor Tool Released
    By ASPSmith Training in forum dotnet.announcements
    Replies: 0
    Last Post: 06-18-2002, 03:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center