468,249 Members | 1,488 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,249 developers. It's quick & easy.

Error when placing Validators on a DataList Control.

We are using .NET validators on most of our aspx pages.
When the validator is contained within a datalist (i.e.
the EditItemTemplate) the WebUIValidation.js file location
tag is not rendered on the page.

Missing Tag:
<script language="javascript"
src="/aspnet_client/system_web/1_0_3705_0/WebUIValidation.j
s"></script>

When we attempt to edit the item we receive the following
error message:

Error Message:
Unable to find script
library '/aspnet_client/system_web/1_0_3705_0/WebUIValidati
on.js'. Try placing the file manually.
If the validators are located directly on the page and not
in the datalist, the tag is rendered correctly.

1) We can hard code the path on each page but this creates
maintenance issues.

2) If we add a hidden field with a default value and a
required field validator on the page, the tag is
rendered. This is successful but not very clean.

I would like to do one of the following.

1) Trigger the rendering of this tag in code. I have been
unsuccessful in this regard.

2) Dynamically read the file location and render the tag.
I can read the cryptic path "/aspnet_client/{0}/{1}/"
from the machine.config file but I have been unsuccessful
translating it.

Dim configData As IDictionary = context.GetConfig
("system.web/webControls")
Response.Write(configData("clientScriptsLocation") )

We are currently running the .NET Framework 1.0 SP2. Any
thoughts would be greatly appreciated.

Thanks,
Art Kedroski


Nov 17 '05 #1
2 1470

"Art Kedroski" <ke******@eglin.af.mil> wrote in message
news:5f****************************@phx.gbl...
We are using .NET validators on most of our aspx pages.
When the validator is contained within a datalist (i.e.
the EditItemTemplate) the WebUIValidation.js file location
tag is not rendered on the page.

Missing Tag:
<script language="javascript"
src="/aspnet_client/system_web/1_0_3705_0/WebUIValidation.j
s"></script>

When we attempt to edit the item we receive the following
error message:

Error Message:
Unable to find script
library '/aspnet_client/system_web/1_0_3705_0/WebUIValidati
on.js'. Try placing the file manually.
If the validators are located directly on the page and not
in the datalist, the tag is rendered correctly.

1) We can hard code the path on each page but this creates
maintenance issues.

2) If we add a hidden field with a default value and a
required field validator on the page, the tag is
rendered. This is successful but not very clean.

I would like to do one of the following.

1) Trigger the rendering of this tag in code. I have been
unsuccessful in this regard.

2) Dynamically read the file location and render the tag.
I can read the cryptic path "/aspnet_client/{0}/{1}/"
from the machine.config file but I have been unsuccessful
translating it.

Dim configData As IDictionary = context.GetConfig
("system.web/webControls")
Response.Write(configData("clientScriptsLocation") )

We are currently running the .NET Framework 1.0 SP2. Any
thoughts would be greatly appreciated.

Thanks,
Art Kedroski


Do you have Smart Navigation turned on? When I used to on my pages I got
this error all the time. I turned it off and the errors went away :)
Nov 17 '05 #2
Thanks for the feedback. Unfortunately I still get the error popup.
Just to give you a little more history, the browser setting is essential
to recreating the popup error. However, the browser setting does not
affect the rendering of the tag into html. If the setting is changed,
the .js file is cached and the error does not occur. Under any of the
described scenarios, the tag does not get rendered.

Browser setting to recreate the issue: Tools / Internet Options /
Settings / Check for newer versions of stored pages Every visit to the
page.

Art Kedroski
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Ian Cox | last post: by
6 posts views Thread by Nathan Sokalski | last post: by
1 post views Thread by Nathan Sokalski | last post: by
2 posts views Thread by Lisa Calla | last post: by
2 posts views Thread by ntuyen01 | last post: by
6 posts views Thread by Don | last post: by
2 posts views Thread by Nathan Sokalski | last post: by
7 posts views Thread by Jim in Arizona | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.