|
|||||||
| .NET Discussion and technical support for, building, using and deploying .NET sites. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello Webdevelopers !
I just registered to this forum and i have one big question: Has anybody ever looked at the HTML rendered by ASP.NET? Has anybody tried to validate your website programmed in ASP.NET? Now most of it goes well, but i got a problem with asp:RequiredFieldvalidator, because it generates some javascript onclick-code for the submit button. I even set EnableClientScript to false because i don't want client-side form-validation. it also puts language="javascript" into the input type="submit"-tag and this is taht does not validate in W3C-validator? Anybody knows how to make ASP.NET not to put this javascript onclick-code in the input submit-tag ??? |
|
#2
|
|||
|
|||
|
If you want W3C validation, it's up to you to hack things to whatever level of validation you want.
Personally, what I do is to write all dynamic content using div tags, turn off viewstate, and avoid using any controls that force viewstate. |
|
#3
|
||||
|
||||
|
You can also just use html forms and then call an asp.net script. That way you are in complete control. Basically I do not use the built in validaotrs. The best thing would be to write some java script by hand to catch the users with java script enabled before they post to the server, then run a server side script to make sure the form values are correct for those who do not have java script enabled. You may not be able to get rid of the view state tag completely. But when you do a form, make sure you put in your own name and id etc. If you do not the server will put in stuff like __ and that will kill your validation. I do not like having invalid code so I would do my forms client side. Plus I know there are lots of clients who will not settle for invalid code either. Some clients like a little thing that says the page was made correctly... so they know they are getting their moneys worth.
The whole advantage of using the built in validators is because they use the java script and you do not have to do it by hand. If you want to ditch the js, just on the page under the sub/function that is called when the button is clicked use an if statement (or a case statement). Code:
if txtbox1.text = ""and txtbox2.text = "" then lblblank.visible = true lblblank2.visible = true else if txtbox1.text = "" then lblblank.visisible = true else if txtbox2.text = "" then lblblank2.visible = true else fire the code end if
__________________
WAR EAGLE! 4 guys rolla (some good asp.net articles)|A browser hack chart, very handy Last edited by PeOfEo; 07-29-2004 at 12:42 AM. |
|
#4
|
|||
|
|||
|
thank you very much.
indeed, the built-in form-validation are quite handy. but when it comes down to W3C-valid HTML, it's just a pain in the a**. as a matter of fact, M$ doesn't care a lot about W3C-standards, Internet Explorer is just the best example. as a PHP, ASP web-developer i was used to do all the form validation by a server-side script once the form was sent, so i was really amazed by the ASP.NET form-validators. but i DO care about W3C-compliant code, so i won't use them but do the validation the same old way :-( i.e is the field filled, is it numeric, is it > 0 etc ;-) |
|
#5
|
||||
|
||||
|
Quote:
__________________
WAR EAGLE! 4 guys rolla (some good asp.net articles)|A browser hack chart, very handy |
|
#6
|
|||
|
|||
|
Microsoft has made the beta of Visual Studio 2005 available for download. There will be an Express version for hobbyist programmers (who outnumber professional programmers 2 to 1) that will cost less than $50 per language. I downloaded it and so far as I can tell the feature set is pretty complete.
Microsoft claims, and you can verify it yourself by downloading the beta and trying it, that VS 2005 will produce valid XHTML 1.0 code, with the exception of a few controls, which they document in detail. The current version of VS doesn't know about XHTML.
__________________
Ken |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|