Forum Moderators: open

Message Too Old, No Replies

ASP.NET server controls not validating

correct syntax for inserting user controls into my html

         

adventurewagen

7:17 pm on Aug 18, 2005 (gmt 0)

10+ Year Member



I know this is probably a simple stupid question, I've searched and found similar questions but no answers that seem to help.

I want my pages to validate xhtml 1 Transitional, and they do until I add in my user login identification control:

<uc1:identification id="id1" runat="server" />

MS says to include <form runat="server"></form> around asp controls, but w3c validation gives me more errors and my page breaks altogether. I have also included in an SSI file earlier in the page the line:

<%@ Register TagPrefix="uc1" TagName="identification" Src="/usercontrols/identification.ascx" %>

Any ideas?

adventurewagen

6:28 pm on Aug 22, 2005 (gmt 0)

10+ Year Member



C'mon guys,

Is there a way to put a server control in my page and still have it validate?

mrMister

6:53 pm on Aug 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You nedd to post the actual code (identification.ascx)

Just posting the code that you use to reference it is no good!

You should be using the lowest version of HTML that supports the fucntionality you require. For most people, this is HTML 4.01, very rarely is XHTML1.1 Transitional the right choice. It's not a case of XHTML is "the latest and greatest vesrion". By using it, you will be alienating a lot of web browsers and search engines.

What features of XHTML do you need to use?

adventurewagen

7:55 pm on Aug 24, 2005 (gmt 0)

10+ Year Member



So I need to replace the user control reference with the code? I just figured it should recognize the link as being just a usercontrol to some code and validate whether the link itself was marked up correctly.

Do most people just remove their links and validate their pages without them? Then validate the code seperately?

As for writing it in xhtml compliant markup vs. html4 I just see it as being a logical step in creating a forward compatible site. I think my site actually validates in both html4 and as xhtml.

TheNige

8:19 pm on Aug 24, 2005 (gmt 0)

10+ Year Member



Are you validating the source files? Or are you validating after actually running the page and the server renders it?

If you try to validate the source page with even rendering it, it would never validate against anything.

User controls aren't "links" they render as the HTML that is included in them.

adventurewagen

7:12 pm on Aug 25, 2005 (gmt 0)

10+ Year Member



Gotcha, that would make sense. I was using the cut/paste part of the page which is definately not rendering the controls.

Thanks.