ASP.NET Sys.WebForms.PageRequestManagerParseErrorException - c#

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?

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.

Mimicking AJAX file uploads in webbrowser control is failing

I am having a problem but I am not sure where.
I have created a website which uses Angular, this might not be pertinent but then again it might be. Of the many features of this site one of them is the ability to upload a file and then get back a response. The response is a simple amount of JSON. The only browser I have to get this working with at this point in time in IE8. avoiding incoming thrown objects - I have tried everything to change this fact, but it is what it is.
I have gotten the site to mimic AJAX uploads by submitting a form and having the response redirected to an iframe. In fact I am using a module that does most of this for me.
So far all this works better than you would believe in IE8. I know right? Unbelievable!
But… there’s always a but…
I need to get this page working when running in a Webbrowser control in a winforms project. I get as far as uploading the file which happens successfully. My REST service gets it, saves it, and returns the correct response. When debugging I can even see that the response is available. But for some reason the load method for the iframe is never called. The iframe which I have made visible on the page is never populated with the JSON.
Again this works when running in IE but not when in the webbrowser control. I get no errors and have breakpoints and debugger statements everywhere. It’s like the response falls in a crack and is ignored.
Would anyone have any suggestions as to why this is happening? crossing fingers
Sorry for the delay I have been ..., well there is no adjective for how busy I have been.
The answer lied in the module that was chosen to help upload files. It worked for IE 8 straight up, but not when running in the web browser control. The module was dynamically binding an onload event to an iFrame which was also being dynamically create to handle the post back. Anyone that has worked with IE and needed to upload files might know of this method. This worked in IE8 but not in the web browser control. We modified it to add the onload event when the iFrame is created and that fixed the issue.

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.

Behind code for button being not updated with new code in Facebook app

I have what appears to me to be a really bizarre issue. I'm experimenting with the asp.net webforms project( from the C# Facebook SDK) and everything works fine. That is until I try and change the behind code; for example in the 'Post To Wall' button. No matter what I change the code to inside the button click event, it never runs when I upload it to the server, it always appears to run the old code (which isn't even there any more in the file!) - is there some kind of caching going on with Facebook? There is no problem with adding new buttons but the behind code for them cant be changed either when run once. It basically means I cant work with it as any new behind code I add isn't picked up when I run the app inside Facebook. Even more bizarrely I can change the name of the button and that is displayed fine, but any new behind code is ignored. Am I missing something simple here..............
Cheers,
Derek
Are you seeing the code behind in the servered HTML? Are you sure you compiled the application before you uploaded it? Maybe a dll in the bin file is not being correctly updated.
Yeah, the aspx stuff will simply refresh with a save, but the compiled Server code will need a refresh if you haven't done so already.
You can restart your web server (if IIS restart the App pool), that'll start using your new application dll.
If that doesn't work, try using fiddler if there's an http call going out Facebook to see if the call is correct.

Error not being displayed with updatepanel

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.

Categories

Resources