Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 18th, 2006, 02:20 PM
Registered User
 
Join Date: Jan 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Redirect inside a Server Control Button

I am trying to do a response.redirect from inside a Web Server Control Button but I get an exception about "Unable to evaluate expression because the code is optimized or a native frame is on top of the Call Stack."

Guts of page is below.

public partial class Logon : System.Web.UI.Page
{
  protected void Page_Load(object sender, System.EventArgs e)
  {
  }
  protected void btn_Login_Click(object sender, EventArgs e)
  {
     //do something
     Response.Redirect("newpage.aspx");
  }
}


Can someone tell me what I am doing wrong. Thanks.


 
Old April 19th, 2006, 01:43 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Are you sure the error is caused by this code??

I see nothing wrong with it....

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
While typing this post, I was listening to: LAX by Xzibit (Track 2 from the album: Weapons Of Mass Destruction) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
DetailsView Cancel button to redirect firblazer ASP.NET 3.5 Basics 4 June 23rd, 2008 01:23 AM
Finding an un-named button inside a webpage gillevk C# 1 July 23rd, 2007 11:29 AM
click the button above and redirect another page crmpicco Perl 2 November 16th, 2006 08:46 AM
Server Button Control event execute twice bluebeta ASP.NET 2.0 Basics 2 May 19th, 2006 03:25 PM
Adding code to a button inside a custom Control. Roinka ASP.NET 2.0 Basics 5 April 23rd, 2006 01:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.