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

  • Home
  • SEARCH
  • 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 9115085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:20:49+00:00 2026-06-17T04:20:49+00:00

ASP.NET restricts using more than 1 runat=server form. I have a Master Page ,

  • 0

ASP.NET restricts using more than 1 runat="server" form.

I have a Master Page, currently with no form.

I have many other pages, some with a form (Register.aspx – Login.aspx), some without a form.

I would like to add a Logout button in the master (After a user has logged in).

This is kind of normal, the Logout button should always be there.

But to use this ASP Button Controller I need to use a form in the Master Page.

Means, I will not be able to access other pages that has forms because I will receive an error.

I already have other ideas to bypass this.

1- Using JQuery to Load a Handler using Ajax, clear the Session.

2- Make the Logout a link which looks like a button, click on it to load another .aspx page, in the Page Load method, clear the Session, then redirect, sounds like the first one…

3- Make it a link which takes me to the same page (Default.aspx?logout=1) <- and check this parameter inside the Page Load method, if it’s there, clear the Session.

Are these good approaches? is there any better?

  • 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-17T04:20:50+00:00Added an answer on June 17, 2026 at 4:20 am

    You don’t need to bypass it, just wrap the entire asp:ContentPlaceHolder inside the form runat="server" so you’ll have the form on every page already.

    In the master page

    <form runat="server">
        <asp:ContentPlaceHolder id="MainBodyContent"></asp:ContentPlaceHolder>
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a checkedlistbox in asp.net web form page as : <asp:CheckBoxList ID=TagListCheckBox runat=server
I have an ASP.NET 3.5 application using Windows Authentication and implementing our own RoleProvider.
I have a webpage I am working on using asp.net mvc3. I am deploying
I just configured my web application to use IIS rather than ASP.NET dev server
I have looked through examples on using JQuery in asp.net user controls and when
Many thanks in advance. When running the ASP.NET Development Server, everything is working fine.
I am using Asp.Net/C# to build an application.I am using Forms Authentication .I have
I have an ASP.NET page running in SSL and the checking happens in the
Is it possible to allow or restrict items using c# asp.net?
ASP.NET MVC can generate HTML elements using HTML Helpers, for example @Html.ActionLink() , @Html.BeginForm()

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.