SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Newcastle, England
    Posts
    268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ASP.NET and XHTML ???

    Hi,

    I'm writing my first ASP.NET site and attempting to meet the XHTML Transitional 1.0 standards. All is fine, until I use Validator controls on a page. These controls insert a script into the page using <script language="javascript"> - unfortunately, the XHTML validator at validator.w3.org complains that it isn't valid XHTML (it needs a "type" attribute).

    In addition, I have a dropdownlist control with an onChange event handler. ASP.NET inserts a "__doPostBack" as expected, but it also inserts the 'language="javascript"' attribute too - again this is invalid (giving the error "there is no attribute "language" for this element").

    Is there any way at all of changing this - obviously I can't just edit it directly as these elements are generated by the server, but I didn't know if there might be a configuration setting which overrides this? Or are ASP.NET pages (at least, Beta 2 ASP.NET pages) destined to fail to meet the XHTML 1.0 standard?

    Thanks in advance for any help/advice you can offer.
    Nick Wilson [ - email - ]

  2. #2
    Back in Action Winged Spider's Avatar
    Join Date
    Jun 2001
    Location
    outside my mind
    Posts
    900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try adding

    type="text"


  3. #3
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Newcastle, England
    Posts
    268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    obviously I can't just edit it directly as these elements are generated by the server
    The script elements are added when the ASP.NET page is compiled, so I can't just edit them - that's the problem. I add my validator control to the page, something like

    <asp:ValidatorRequiredField Id="blah" ... />

    and it adds all the script elements etc. itself.
    Nick Wilson [ - email - ]

  4. #4
    SitePoint Enthusiast pedershk's Avatar
    Join Date
    Mar 2001
    Location
    Oslo, Norway
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    CrazyCrane is right. The server controls are compiled into javascript on runtime (technically when the MSIL is interpreted by the Just-In-Time compiler).

    This is an issue for Microsoft Support. I wouldn't think that this is intentional, and is probably a bug that needs to be sorted out.

    Go to beta.visualstudio.net and submit it there.
    **Henning K. Pedersen**
    Forbrukerkraft Norway A/S

  5. #5
    SitePoint Evangelist Umair.ms's Avatar
    Join Date
    Sep 2000
    Location
    Lahore, Pakistan
    Posts
    567
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow! we got a contributor for .NET. CrazyCrane - can I have you autograph please?
    TinyPlanet.org
    Discuss and Debate World Events, Politics and Religion.
    Interact and Share your Views with People around the Globe.

  6. #6
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Newcastle, England
    Posts
    268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LOL

    Sure you can, but I'm afraid all I'll be contributing for quite some time will be a load of questions as I struggle through it all . It's a great learning experience so far though...
    Nick Wilson [ - email - ]

  7. #7
    Back in Action Winged Spider's Avatar
    Join Date
    Jun 2001
    Location
    outside my mind
    Posts
    900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just bought a .NET book yesterday. The main reason being this thread. I got interested about .NET and decided to check it out.

    CrazyCrane, do you mind if I add you to my sitepoint buddies list? Us .NET-ers have to stick together.

    We could probably help each other a lot as we both learn this language.


  8. #8
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Newcastle, England
    Posts
    268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope, I don't mind at all - I don't know how much help I'll be able to be, but .NET is going to be a steep learning curve for everyone so the more chances we have to discuss it and work it out, the better .
    Nick Wilson [ - email - ]


Bookmarks

Posting Permissions

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