p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 16th, 2006, 07:15 PM
Friend of Wrox
Points: 1,631, Level: 16
Points: 1,631, Level: 16 Points: 1,631, Level: 16 Points: 1,631, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
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).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old February 17th, 2006, 03:00 AM
Imar's Avatar
Wrox Author
Points: 33,563, Level: 80
Points: 33,563, Level: 80 Points: 33,563, Level: 80 Points: 33,563, Level: 80
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,231
Thanks: 7
Thanked 203 Times in 201 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old February 17th, 2006, 04:26 AM
Friend of Wrox
Points: 1,631, Level: 16
Points: 1,631, Level: 16 Points: 1,631, Level: 16 Points: 1,631, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old February 17th, 2006, 04:34 AM
Imar's Avatar
Wrox Author
Points: 33,563, Level: 80
Points: 33,563, Level: 80 Points: 33,563, Level: 80 Points: 33,563, Level: 80
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,231
Thanks: 7
Thanked 203 Times in 201 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old February 17th, 2006, 05:58 AM
Friend of Wrox
Points: 1,631, Level: 16
Points: 1,631, Level: 16 Points: 1,631, Level: 16 Points: 1,631, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #6 (permalink)  
Old February 17th, 2006, 02:48 PM
Imar's Avatar
Wrox Author
Points: 33,563, Level: 80
Points: 33,563, Level: 80 Points: 33,563, Level: 80 Points: 33,563, Level: 80
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,231
Thanks: 7
Thanked 203 Times in 201 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #7 (permalink)  
Old April 10th, 2007, 06:07 AM
Authorized User
Points: 247, Level: 4
Points: 247, Level: 4 Points: 247, Level: 4 Points: 247, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: PASADENA, CALIFORNIA, USA.
Posts: 52
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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

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 09:02 PM
Client Side Validation anujrathi ASP.NET 1.0 and 1.1 Professional 1 June 17th, 2006 11:23 PM
Print file at client side in asp.net manish.sharma04 ASP.NET 2.0 Basics 0 April 4th, 2006 09: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



All times are GMT -4. The time now is 07:27 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc