Error not being displayed with updatepanel - c#

It appears like something is stopping my errors from displaying normally an in ASP.NET site.
Scenario 1 - I have an admin screen that has most of its content inside an updatepanel. When the user's session times out. You click a button and nothing happens. It doesn't redirect you to the home page and it doesn't give you an error message.
Scenario 2 - I have some sort of data issue throwing an error - its happening on the staging environment otherwise I'd just debug the code normally. But instead of showing me the error you get the javascript type exclamation mark down the bottom and you need to quickly click on it to bring up a pop up dialog. In IE this happens. In FF there is no error message at all being shown.
My error in this instance is Sys.WebForms.PageRequestManagerServerErrorException: Sequence contains no elements. It then refers to a ScriptResource.axd... so based on this error message I'm having trouble working out what the problem is as I can't reproduce this on my dev environment. I believe its usually related to a linq statement referencing something with no elements but am not sure where the error is occurring or why. But am also wondering why this error appears to be being caught and not displayed look good old fashioned exceptions :)
So not sure if its an updatepanel issue or a scriptmanager related quirk. I imagine I'm using the wrong keywords to google as I can't find anyone else really complaining about the same thing :(
Thanks for any help!

For your first scenario, it seems as though you may need to check via a javascript ajax call whether the user's session is still active, and if not then redirect to the login page.
For the second scenario, I would suggest logging all exceptions on the server using a tool like ELMAH, which will give you a simple UI to view exception details.

Related

fast report causing access denied error in mvc .net

I created a web application that includes fast report for creating report.
If I run application on my device, everything is alright. But if I upload my project to the host and a user clicks on the Generate report button for the first time, the following error is shown:
However, if the user refreshes the page or presses the Back button and then clicks the Generate report button again, everything is alright. So this error only appears for the first time the page loaded. I didn't use the path from above in my code at all.
Can anyone help me to solve this error? I have no Idea where this error come from
I found the solution by myself. If anyone also has this problem let me know.

The web page could not be accessed Coded UI Error

I am running a Coded UI test that clicks a hyperlink, for example, "Home" then goes off and does a few different things on the web page, then tries to click the exact same "Home" link and an error is thrown saying
The web page could not be accessed. If the page is refreshing, please
wait until the page refreshes and then perform actions on it.
Now I get this when I am stepping through the test, so I know at the point this link is trying to be clicked the page is not refreshing. Digging through the UITest error logs I see this line every time before the browser refresh error is thrown:
E, 6468, 13, 2013/10/18, 15:08:47.406, 271797587803, QTAgent32_40.exe,
IEDOM : EnsureValid failed for html node: A, 52
I have compared the uitest mappings for this link and the properties are all identical, also the page html is identical.
I am running in IE10, KB2879017. VS2012 4 RC.
Any idea's what's causing this to happen?
NOTE: WaitForControlReady() does nothing to stop this from happening. Also a hard coded Playback.Wait() doesn't help here either.
Failing line of code, this works the first time, but not the second time it is executed in a test.
this.UIWindow.UIDocument.UIHomeHyperlink.WaitForControlReady();
Mouse.Click(this.UIWindow.UIDocument.UIHomeHyperlink);
Remember that the search properties being used for the UIHomeHyperlink mapped control are the exact same the second time these lines are executed. Mouse.Click() execution is when the "Web page not available" error is thrown in VS2012.
After some brainstorming and trial and error testing, came to the conclusion that mapped controls are holding onto properties after being found on a page. For some reason those properties weren't matching up exactly with the page properties on the second time around.
So a "solution" to this problem was to force a new up of the entire mapped UI___Window each time we enter the page. Coded UI prevents this in the designer file by checking if the control is null every time, if it is then the control is new'ed up. If not, then Coded UI uses the same control and it's properties from when it was first defined/discovered. Hope this helps anyone else that was having problems with this error.
There also seems to be a bug in CodedUI when calling .GetParent() twice on the same object tree, which causes this exception to be thrown. We worked around it by determining the parent in another way.
On another workstation (W7) another exception was thrown when calling .GetParent() twice, something about that the IE version should be more than IE10 on 64bit versions of Windows, which was clearly nonsense, since the computer had IE11 installed.

ASP.NET Sys.WebForms.PageRequestManagerParseErrorException

I'm working on a project left by a programmer in our company
i'd like to know what could be the reasons im getting this error
this is always firing during the execution of this line
Response.Redirect("ViewPositions.aspx?empid=1");
but the thing is, the ViewPositions.aspx is working ok when i navigate it from the addressbar
and not coming from the Response.Redirect
on the other hand the form where in the Response.Redirect was called, have a complicated layout.
its a registration wizard for an account. And it has RadPageView, RadMultiPage, RadAjaxPanel,RadAjaxLoadingPanel,RadAsyncUpload, some DropDownBoxes, some TextBoxes and GridView.
everything is working and updating the database but when it comes to the redirection... its giving the error i've posted.
Note: there are no Response.Write calls in both pages
The question is.
I would like to know what are the possible causes of this error. Because its hard to debug.
I've googled this problem and tried the solutions but no luck.
Just point me please to the right direction.
Thank you.
Update: Ive confirmed that everything works fine.. just the Response.Redirect is triggering this problem.. please let me know if i need to post anything more.
Update: I tried changing the redirect to... Response.Redirect("http://www.google.com");
and it throws a different error
which means it is certain that the page calling the redirect is causing the error..
my confusion is.. the page is working fine when its not calling any redirect... please help =(
If you are using telerik/rad controls, it has httpModules especialy for UpdatePanel
Tell me if it solves your problem
Could it be that further page processing is happening after your Response.Redirect? Have you tried:
Response.Redirect("ViewPositions.aspx?empid=1", true)
to end the execution of the current page?

Random iexplore crashes when debugging (ASP.NET)

I have a web application I am developing that seems to crash completely at random when clicking links on any page. When this happens, I'm told 'An unhandled win32 exception occured in iexplore.exe'. When I try to debug, it says one is already attached.
What could this be relating to? I know without code it will be hard, but this seems like a very strange error to occur at random.
I have had this happen to me before and the problem usually had to do with styling on html elements that IE just couldn't handle. A good test would be to run the app in Mozilla and Chrome to see if they crash. For me, 4/5 times it had to do with the overflow attribute on a div. For some reason, ie is quirky when it comes to scrolling. To find it, after you have tested in the other browsers, start taking blocks out one piece at a time and see if you get the error. If you don't get the error, then the problem is in that block, otherwise put it back in and take the next block out. Keep going until you find it.

window.navigate and document.location issue

I am working on a system that after completing a record edit and returning control to the calling AJAX script, I refresh the calling page by calling a custom server extension. The odd behavior I am experiencing is after control is returned to the calling script, when the code hits window.navigate or document.location, it attempts to navigate to the url in a new window (which is not the desired behavior). Additionally, the custom server extension is never called - the url appears in the address bar, but then does nothing.
Does anyone have any idea what might be going on? I am running IIS 5.1 on XP sp3 and have tried to get it to work in IE 8 and IE 7, to no avail. Any help would be greatly appreciated.
Okay, my tech lead is apparently a much better Googler than I am.
http://www.faqts.com/knowledge_base/view.phtml/aid/13307/fid/53
Long story short: the page I am calling from is modal and only has an HTML rendering dll loaded. So we changed the return value of the modal page we called from a scalar value to an object with data and now I get to go repopulate the fields manually in the modal calling page.

Categories

Resources