|
|
 |
| 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.
|
 |

February 16th, 2006, 07:15 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

February 17th, 2006, 03:00 AM
|
 |
Wrox Author
Points: 33,563, Level: 80 |
|
|
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,231
Thanks: 7
Thanked 203 Times in 201 Posts
|
|
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.
|

February 17th, 2006, 04:26 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

February 17th, 2006, 04:34 AM
|
 |
Wrox Author
Points: 33,563, Level: 80 |
|
|
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,231
Thanks: 7
Thanked 203 Times in 201 Posts
|
|
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.
|

February 17th, 2006, 05:58 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

February 17th, 2006, 02:48 PM
|
 |
Wrox Author
Points: 33,563, Level: 80 |
|
|
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,231
Thanks: 7
Thanked 203 Times in 201 Posts
|
|
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.
|

April 10th, 2007, 06:07 AM
|
|
Authorized User
|
|
Join Date: Jan 2006
Location: PASADENA, CALIFORNIA, USA.
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |