Solved

Problem with Response.Redirect in .Net 4.0

Posted on 2010-08-16
3
836 Views
Last Modified: 2013-11-27
I am using VS 2010 and .Net 4.0 and when I use the Response.Redirect in code it throws an exception and craps out.  Here is the text of the exception:

Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

I've seen a few others complaining about Response.Redirect not working in 2010 either but no solutions.

I'm simply trying to navigate to my main page after confirming the users login/password credentials.  Thank you for any and all help.
0
Comment
Question by:drunk_irishman
  • 2
3 Comments
 
LVL 51

Accepted Solution

by:
HainKurt earned 500 total points
ID: 33447581
use server.transfer("newpage.aspx", true"

instead of redirect...
0
 
LVL 51

Expert Comment

by:HainKurt
ID: 33447593
dont use redirect if you are trying user to go to another page which is on the same server with page 1

server.transfer("newpage.aspx", true)
0
 
LVL 1

Author Closing Comment

by:drunk_irishman
ID: 33447750
Thanks, very simple.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Diagnostics with Net and Net.Sockets 2 28
HttpPostedFile 1 26
What Does This C# Code Block Do? 5 30
C# LINQ ForEach() question 6 28
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question