I just migrated from 1.1 to 2.0. All of the javascript that is now supposed to be aquired from webreource.axd does not get loaded. RequiredFieldValidators don't work because I get javascript errors like "Object Required".
I uninstalled and reinstalled iis by using aspnet_regiiis but it still hasn;t fixed my errors.
If I create a brand new website and add a RequiredFieldValidator to it it works fine, but my converted site does not.
Scott, can you post the rendering (html markup) for your validators in both cases [for a working and a non-working site]. Also if you attach a debugger to IE and try debugging the script from VS - which line does the script fail on? Finally, did you make
any changes to the webuivalidation.js that ships with v1.1 - like adding any custom functions to the file?
I did not modify the 1.1 fuctions at all. I have done a little more investigation. In my converted project I created a simple login page just like the one I created for the new website I created for testing. Comparing the HTML output they were different.
So thinking maybe it was something in web.config I renamed my converted project web.config and added a new one. The HTML output now looks identical except that on the converted page I get a javascript error (Line 4 Char 1 Syntax Error) but on the totally
new site I don't get any errors. The validation does work on both sites but I use a ComponentOne menu control and it works fine on the new web but doesn't function on the converted page (I get a second script error Object Required).
If it will make it any easier I can send the files to you.
I dont know why but I started adding one page at a time (by adding an existing item and choosing the pages that were converted) I have been able to get past most of my issues (other that the depricated portions of the framework which I will have to work
through anyway).
Thanks for looking at this for me but I think I am just going to continue down this path for now.
s.wec
Member
20 Points
4 Posts
problems with webresource.axd
Dec 19, 2005 09:07 PM|LINK
I just migrated from 1.1 to 2.0. All of the javascript that is now supposed to be aquired from webreource.axd does not get loaded. RequiredFieldValidators don't work because I get javascript errors like "Object Required".
I uninstalled and reinstalled iis by using aspnet_regiiis but it still hasn;t fixed my errors.
If I create a brand new website and add a RequiredFieldValidator to it it works fine, but my converted site does not.
Scott
kashif
Contributor
2748 Points
547 Posts
Microsoft
Re: problems with webresource.axd
Dec 20, 2005 12:37 AM|LINK
Scott, can you post the rendering (html markup) for your validators in both cases [for a working and a non-working site]. Also if you attach a debugger to IE and try debugging the script from VS - which line does the script fail on? Finally, did you make any changes to the webuivalidation.js that ships with v1.1 - like adding any custom functions to the file?
Thanks, Kashif
s.wec
Member
20 Points
4 Posts
Re: problems with webresource.axd
Dec 20, 2005 12:49 PM|LINK
Kashif,
I did not modify the 1.1 fuctions at all. I have done a little more investigation. In my converted project I created a simple login page just like the one I created for the new website I created for testing. Comparing the HTML output they were different. So thinking maybe it was something in web.config I renamed my converted project web.config and added a new one. The HTML output now looks identical except that on the converted page I get a javascript error (Line 4 Char 1 Syntax Error) but on the totally new site I don't get any errors. The validation does work on both sites but I use a ComponentOne menu control and it works fine on the new web but doesn't function on the converted page (I get a second script error Object Required).
If it will make it any easier I can send the files to you.
Here is the converted web HTML output
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
Untitled Page
</title></head>
<body>
<form name="form1" method="post" action="login.aspx?ReturnUrl=%2fportal%2fdefault.aspx" language="javascript" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTM1NjU3NjQ2M2Rkj46G8aybwb09+kxc83UVwXAAkGU=" />
<script type="text/javascript">
<!--
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
// -->
</script>
<script src="/portal/WebResource.axd?d=Dou1CZYhcjAk7ls0iwAOzg2&t=632676658526522019" type="text/javascript"></script>
<script src="/portal/WebResource.axd?d=vG-aZA0ZE8T-ZNA8gIHKjw1fwafzRUim4HUz8o_GzZ81&t=632676658526522019" type="text/javascript"></script>
<script type="text/javascript">
<!--
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
// -->
</script>
<div>
<br />
<span id="Label1">Label</span>
<input name="TextBox1" type="text" id="TextBox1" />
<span controltovalidate="TextBox1" errormessage="RequiredFieldValidator" isvalid="False" id="RequiredFieldValidator1" evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue="" style="color:Red;">RequiredFieldValidator</span><br />
<span id="Label2">Label</span>
<input name="TextBox2" type="text" id="TextBox2" />
<span controltovalidate="TextBox2" errormessage="RequiredFieldValidator" isvalid="False" id="RequiredFieldValidator2" evaluationfunction="RequiredFieldValidatorEvaluateIsValid" initialvalue="" style="color:Red;">RequiredFieldValidator</span><br />
<br />
<br />
<input type="submit" name="Button1" value="Button" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Button1", "", true, "", "", false, false))" language="javascript" id="Button1" /><br />
<br />
</div>
<script type="text/javascript">
<!--
var Page_Validators = new Array(document.getElementById("RequiredFieldValidator1"), document.getElementById("RequiredFieldValidator2"));
// -->
</script>
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBAKiyeayDQLs0bLrBgLs0fbZDAKM54rGBlRBXGDyy1xyMGxqI4/s5KDV3lck" />
<script type="text/javascript">
<!--
var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function") {
ValidatorOnLoad();
}
function ValidatorOnSubmit() {
if (Page_ValidationActive) {
return ValidatorCommonOnSubmit();
}
else {
return true;
}
}
// -->
</script>
</form>
</body>
</html>
And here is the new web HTML output
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
Untitled Page
</title></head>
<body>
<form name="form1" method="post" action="Default.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTM1NjU3NjQ2M2RkhEH5ChaUpSaFDPyWM/W99FtE+NM=" />
</div>
<script type="text/javascript">
<!--
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
// -->
</script>
<script src="/test/WebResource.axd?d=C4cNBbJzfScC8kSF8rUyCw2&t=632676658526522019" type="text/javascript"></script>
<script src="/test/WebResource.axd?d=t-JhwEwDC5JKzrUmV4OdLtI_qzfnS2AoKlJRcCayRi81&t=632676658526522019" type="text/javascript"></script>
<script type="text/javascript">
<!--
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
// -->
</script>
<div>
<br />
<span id="Label1">Username</span>
<input name="TextBox1" type="text" id="TextBox1" />
<span id="RequiredFieldValidator1" style="color:Red;visibility:hidden;">RequiredFieldValidator</span><br />
<span id="Label2">Password</span>
<input name="TextBox2" type="text" id="TextBox2" />
<span id="RequiredFieldValidator2" style="color:Red;visibility:hidden;">RequiredFieldValidator</span>
<br />
<br />
<input type="submit" name="Button1" value="Button" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("Button1", "", true, "", "", false, false))" id="Button1" /></div>
<script type="text/javascript">
<!--
var Page_Validators = new Array(document.getElementById("RequiredFieldValidator1"), document.getElementById("RequiredFieldValidator2"));
// -->
</script>
<script type="text/javascript">
<!--
var RequiredFieldValidator1 = document.all ? document.all["RequiredFieldValidator1"] : document.getElementById("RequiredFieldValidator1");
RequiredFieldValidator1.controltovalidate = "TextBox1";
RequiredFieldValidator1.errormessage = "RequiredFieldValidator";
RequiredFieldValidator1.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
RequiredFieldValidator1.initialvalue = "";
var RequiredFieldValidator2 = document.all ? document.all["RequiredFieldValidator2"] : document.getElementById("RequiredFieldValidator2");
RequiredFieldValidator2.controltovalidate = "TextBox2";
RequiredFieldValidator2.errormessage = "RequiredFieldValidator";
RequiredFieldValidator2.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
RequiredFieldValidator2.initialvalue = "";
// -->
</script>
<div>
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBALWqei/AgLs0bLrBgLs0fbZDAKM54rGBiOYPftbiVww7Nl1DdV1HgIqSfUI" />
</div>
<script type="text/javascript">
<!--
var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function") {
ValidatorOnLoad();
}
function ValidatorOnSubmit() {
if (Page_ValidationActive) {
return ValidatorCommonOnSubmit();
}
else {
return true;
}
}
// -->
</script>
</form>
</body>
</html>
Thanks,
Scott
s.wec
Member
20 Points
4 Posts
Re: problems with webresource.axd
Dec 20, 2005 01:38 PM|LINK
I dont know why but I started adding one page at a time (by adding an existing item and choosing the pages that were converted) I have been able to get past most of my issues (other that the depricated portions of the framework which I will have to work through anyway).
Thanks for looking at this for me but I think I am just going to continue down this path for now.
Scott
NHuffman
Member
345 Points
67 Posts
Microsoft
Re: problems with webresource.axd
Dec 20, 2005 10:48 PM|LINK
There is a new version of the Web Project Conversion Wizard. Please give it a try and let me know if you are still running into the same issues.
http://www.microsoft.com/downloads/details.aspx?FamilyId=7CECD652-FC04-4EF8-A28A-25C5006677D8&displaylang=en
- Neil -
panania
Member
75 Points
16 Posts
Re: problems with webresource.axd
Oct 23, 2006 05:44 PM|LINK
It's the validation controls.
For some reason the validation controls (even after the app has been converted) still call the old post back JS.
Maybe Neil's new version of the web app will work, don't know.