Page 1 of 1

ASP.net Functionality

Posted: Wed Apr 08, 2009 1:12 am
by GµårÐïåñ
I wanted to pose a question with a possible functionality bug using NS when accessing some ASP.net pages using the JavaScript post back method.
Some information:

1. This does NOT happen on all ASP.net pages (aspx) files but only the ones that use JavaScript post back function, popular with some CMS templates like DotNetNuke and VisualStudio2008 created pages.

2. The function is restored when NS is disabled BUT allowing the site does not fix the problem and allowing globally without disabling NS doesn't fix it either.

3. I am using the latest dev build and this is happening on a site written using .NET Framework 3.x and an example of the link syntax is

Code: Select all

javascript:__doPostBack('ctl00$Account_ContentPlaceHolder$Account_Contacts1$Contacts_GridView$ctl03$Edit','')
I "believe" it's this that is causing it but I am not sure:

Code: Select all

<script src="/ScriptResource.axd?d=[**hash removed**]&t=5fbd1202" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.');
//]]>
</script>
Is this a bug or something else, like maybe we are blocking some content that is necessary? Any help would be appreciated.
I forgot to include the error console items that are generated when you click on the links:
Image

Re: ASP.net Functionality

Posted: Fri Apr 10, 2009 11:12 am
by Giorgio Maone
where's the __doPostBack() function defined? I suppose it's from some external .js file provided by the ASP.NET framework. You should find out which the file is and check if and why it's blocked.

Re: ASP.net Functionality

Posted: Fri Apr 10, 2009 5:15 pm
by GµårÐïåñ
It is defined like this in the header:

Code: Select all

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['aspnetForm'];
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>
and as you can see in my original post, it claims its not defined but its included in each file's header, so its there but not allowed for some reason even though the page itself is whitelisted.

Re: ASP.net Functionality

Posted: Fri Apr 10, 2009 5:29 pm
by Giorgio Maone
Can I see the page?

Re: ASP.net Functionality

Posted: Fri Apr 10, 2009 6:02 pm
by GµårÐïåñ
Certainly you can, but keep in mind that the post backs are predominantly in the GUI that comes AFTER you log in. Click on the My Account link on the top right which is the first instance of it.

To save you the trouble, I contacted the lead developer on the site and went over the code with him and I am trying to work with her to try and figure out what might be causing this. With your help and input, I might be able to narrow this down.

Re: ASP.net Functionality

Posted: Sat Jun 13, 2009 10:02 pm
by Joe Audette
In ASP.NET everything does work with script disabled except for LinkButton. LinkButton is the only ASP.NET control that can't work if javascript is disabled.
The problem is DotNetNuke uses LinkButtons everywhere so it does not work with script disabled.
You can avoid this problem completely if you never use any LinkButtons. Its also possible to style a normal <asp:Button so it looks like a link and it will work even with javascript disabled. I learned this several years ago and this is what I do in mojoPortal CMS so it does work even with script disabled.

Hope it helps,

Joe