A
Art Kedroski
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
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