Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 16th, 2006, 07:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default Is client-side validation in ASP.NET 2.0 possible?

Well, I have put a lot of effort into making client-side validation work for a ASP.NET project on my local machine, and I finally got it to work on my 1.1 enabled machine.

But when try running the system on a 2.0 machine, the validation doesn't work! I realize that the folder aspnet_client/system_web/2_0_50727/ is empty. Is this why? And can I just upload the old WebUIValidation.js to make the client-side validation work or do I have to do other stuff?

Unfortunately, I cannot just try it since I do not have write access to the folder, so before contacting the web server people I would like to find out more about this.

Thanks, Jacob.
__________________
Danish audio books for download at http://www.lytenbog.dk (Danske lydbøger til download).
 
Old February 17th, 2006, 03:00 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Jacob,

You don't need that folder anymore. These files are now retrieved from the ASP.NET assemblies at run-time.....

Just run a page with a validator on it and loo at the source; you'll see what I mean.

Client side validation now also works in other browsers, like FireFox...


Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old February 17th, 2006, 04:26 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That is nice, that is, to get rid of that pesky reference to a javascript file, and knowing that client-side validation is actully still available... but it still doesn't work.

I can see this piece of .NET generated code...
Code:
<script language="javascript" type="text/javascript">
<!--
var Page_ValidationActive = false;
if (typeof(clientInformation) != "undefined" && clientInformation.appName.indexOf("Explorer") != -1) {
    if ((typeof(Page_ValidationVer) != "undefined") && (Page_ValidationVer == "125"))
        ValidatorOnLoad();
}

function ValidatorOnSubmit() {
    if (Page_ValidationActive) {
        return ValidatorCommonOnSubmit();
    }
    return true;
}
// -->
</script>
So I am thinking... is there an option which I haven't set to true, or is it because the system is build using 1.1 but deployed on a 2.0 machine? I can see the validation spans in the generated HTML, but I doesn't see any javascript functions or references to such! Do I miss the point?

Thanks a lot, Jacob.
 
Old February 17th, 2006, 04:34 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I think this is due to your setup, although I am not sure.

How did you configure the app? Did you tell it to use the 1.1 Framework, or does it actually run in 2.0?

I haven't tried to run 1.1 in a 2,0 setup, so I don't know how the validators behave in such a scenario. I'd expect to see at least a reference to the JavaScript files; either the 1.1 style referencing the aspnet_client or the 2.0 style referencing the assemblies / special handlers.

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old February 17th, 2006, 05:58 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Exactly, that was what I though too, but I guess that the javascript variable Page_ValidationActive is probably set to false because of this, or because there is some option I have too enable in web.config or like. I tried this...

ValidateRequest="true"

... but no effect. VS .NET 2003 cannot run with 2.0, right?

Thanks, Jacob.
 
Old February 17th, 2006, 02:48 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

No, unfortunately, you can't. You can run 1.1 assemblies in the 2.0 run-time, but you can't maintain 1.x applications in VS 2005.

ValidateRequest="true" is related to whether ASP.NET allows pages that submit data that looks like HTML or JavaScript....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old April 10th, 2007, 05:07 AM
Authorized User
 
Join Date: Jan 2006
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,
 I have been in to this problem, when i run the application under 1.1, as the session of user expires, when I click the browser back button it takes me to login page.But the same piece of code when run in the 2.0 its taking me to the previously visted page though session was destroyed for that user.webuivalidation.js and smartnavigation are missing in the asp_net folder.can u tell me a work around for this In Asp.Net 2.0 and which assembly the UIValidation refers in asp.net 2.0

Thanks in Advance






Similar Threads
Thread Thread Starter Forum Replies Last Post
VBScript for Client-side controls in ASP.net cJeffreywang ASP.NET 1.0 and 1.1 Professional 1 March 22nd, 2007 08:02 PM
Client Side Validation anujrathi ASP.NET 1.0 and 1.1 Professional 1 June 17th, 2006 10:23 PM
Print file at client side in asp.net manish.sharma04 ASP.NET 2.0 Basics 0 April 4th, 2006 08:46 AM
CLIENT SIDE TIME CALCULATION IN ASP.NET gmk51080 Javascript How-To 1 December 1st, 2004 01:29 AM
client side time calculation in asp.net gmk51080 Javascript 0 November 30th, 2004 04:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.