Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8455125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:12:16+00:00 2026-06-10T12:12:16+00:00

I am using ASP.NET membership and on registration page trying to login without a

  • 0

I am using ASP.NET membership and on registration page trying to login without a login control.

When user clicks on the register button, the control goes to redirect.aspx page.
But in that page, while I am trying to redirect to the members homepage its throwing the following error.

ERROR –

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

Web.config –

<authentication mode="Forms">
    <forms name=".SSOAuth" loginUrl="login.aspx" defaultUrl="Redirect.aspx"
           protection="Validation" timeout="30000"/>
</authentication>

RegistrationPage code –

protected void btnRegister_Click(object sender, EventArgs e)
{
    MembershipUser userMemb = Membership.CreateUser(
                           txtemail.Text.Replace("'", "''").ToString(),
                           txtPassword.Text.Replace("'", "''").ToString(),
                           txtemail.Text.ToString());

    Roles.AddUserToRole(txtemail.Text.ToString(), "Member");
    FormsAuthentication.RedirectFromLoginPage(txtemail.Text.Trim(), false);
}

Redirect.aspx.cs code –

try
{
    if (User.IsInRole("Member"))
    {
        string UserName = User.Identity.Name;                        
        Response.Redirect("~/Member/MembeHome.aspx");
    }
}
catch(Exception ex) {}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:12:18+00:00Added an answer on June 10, 2026 at 12:12 pm

    Read this document (issue and solution) ThreadAbortException Occurs If You Use Response.End, Response.Redirect, or Server.Transfer

    Use Response.Redirect(url,false)

    Response.Redirect("~/Member/MembeHome.aspx",false);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are creating a new site using ASP.NET membership provider for user registration and
I am using the built-in asp.net membership framework. I created a registration page and
I'm using the ASP.Net Login control to login a web application. When the user
For a typical user registration and membership system i follow in ASP.NET website i
Using ASP.NET membership, if I want to get information for the current user, I
We are using ASP.Net Membership provider for user management module in our WPF based
I basically need to login into another domain that is using asp.net membership. If
I'm trying to deploy a website using ASP.NET membership and the hosting company is
I am using asp.net 2.0. I have been using asp.net membership provider for user
I am using Asp.Net Membership and when user enters correct username and password I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.