Showing posts with label including. Show all posts
Showing posts with label including. Show all posts

Saturday, March 24, 2012

PageRequestManagerServerErrorException: 401

I wrote some server code that work fine in VWD 2008 Express Edition. When I uploaded the page to my site (including the dll that my code uses), I get the following error:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occured while processing the request on the server. The status code returned by the server was: 401. How can I find out where the problem is comming from?

Thanks,
Yoni

Server Error 401 is an "Unauthorized" error.


And how can I find out which peace of code is giving me this error?

Thanks,
Yoni


It's probably going to be something where it is trying to access a page, database, etc. that it doesn't have permissions to. I would set breakpoints and just see how far the code is getting.


Thats a problem. As I said, the page and code work fine on my computer - only when I move it to my site I get an error. How do I insert breakpoints? Do you mean I should use "return" statements in diff places until I find where the error originates?

Thanks,
Yoni


On the server you couldn't use breakpoints. I personally am a fan of just putting an extra blank <asp:Label> on the page and writing things to it to see values and my progress. Place occasional "I got to ____ function" statements in the label's text.


I wouldlove to do that: I have tried it, but it doesn't work. My server code takes about 10 seconds - 5 minutes to run and during that time I can't post nothing to the page... I asked how to do this in another forum, but I was given extremely complicated ways of doing this, that I could not do. Do you know how I can change a label while my server code is running?


Hi,

Thank you for your post!

Check out the following link:

http://blogs.msdn.com/david.wang/archive/2005/07/14/HOWTO_Diagnose_IIS_401_Access_Denied.aspx, David Wang said in this article:

One of the most common questions asked about IIS on the newsgroups as well as Microsoft Product Support is "why am I getting 401 Access Denied"?

There are many, many possible causes and variations, but from the IIS perspective, the top-level, logical categories are fixed. This information can help dramatically narrow down the scope of any investigation, but unfortunately, few people know to take advantage of this information. This is what I am going to address with this entry - how to use and diagnose the 401.x error codes on IIS.

Step 1: Determine the SubStatus Code

Step 2: Determine Course of Action

401.1 Denied by Invalid User Credentials

401.2 Denied by Server Configuration

401.3 Denied by Resource ACL

401.4 Denied by Custom ISAPI Filter

401.5 Denied by Custom ISAPI/CGI Web Application

Conclusion

401.1 through 401.3 errors are associated with IIS request processing and allow the logical interpretations and assumptions that I listed above.

Meanwhile, the 401.4 and 401.5 errors are the most arbitrary to diagnose since custom ISAPI DLLs and CGI EXE can cause IIS to behave in non-obvious manners. Thus, much of the logical assumptions about 401.x do not apply.

I hope that this information has been useful in deciphering theh 401.x errors from IIS. If you have additional questions, feel free to post a comment or post a private question via the "contact" link.

Recently, we have also released a tool,AuthDiag, to help troubleshoot IIS access denied issues. You can download it fromthis location. In particular, it has a feature to hook in to various failure points in IIS and directly troubleshoot what is failing on a given request - you need to see and try it out!

If you have further questions, let me know.

Best Regards,

Wednesday, March 21, 2012

partial page rendering with master page... and a broken link in the tutorial

I can't for the life of me figure out how to enable partial page rendering with the newest AJAX release (including the nov. CTP)...

the tutorial speaks to it "If you are working with master pages, you might need to use aScriptManagerProxy control in place of aScriptManager control. For more information, seeHow to: Use Partial-Page Updates in Master Pages.", but you'll notice the link leads to a 404 error.

anyone know the answer to this? I've tried replacing my script manager with a script manager proxy, but the page complains that it needs a script manager first... I'm lost.

Cheers

place the scriptmanager on the masterpage.

place the scriptmanagerproxy on each content page.


you wouldn't happen to have a code example of how to use the proxy manager, would you?

In the Master page, it would be like

<form runat="server">
<asp:ScriptManager id="sm1" runat="server" /
... rest of masterpage markup

</form>

In the content page

<asp:ScriptManagerProxy ID="smp1" runat="server">
<Services>
<asp:ServiceReference Path="~/common/services/ReportData.asmx" />
</Services>
</asp:ScriptManagerProxy>


yeah, that's kinda what I thought... unfortunately (for me!), it's still refreshing the whole page...

hmm... maybe a little more explanation of the page...

I have the script manager in the master page, the proxy manager is in the content page. Also in the content page, I have a GridView in an UpdatePanel. The update panel has an AsyncPostBackTrigger setup on a timer tick, so, I obviously also have a timer on the page (not IN the update panel, it's actually just above it). This used to work perfectly, the grid view would update without refreshing the whole page, users were happy (a near impossibility!), everything was hunky-dory... then I decided to upgrade <grin>.

Any help would be awesome.

Cheers


i dont know why you just don't put the Timer inside the UpdatePanel's Content template, but i'd suggest trying that...

Also this post:
http://forums.asp.net/thread/1452109.aspx

Solved a timer issue i had


wonderbar... works perfectly now.

thanks!


I tried this. It still complains about unknown element 'ScriptMangerProxy'. Any idea why is that? But strange thing is: it compiled.

mbanavige:

place the scriptmanager on the masterpage.

place the scriptmanagerproxy on each content page.