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 7885857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:10:38+00:00 2026-06-03T05:10:38+00:00

I want to create a common header user control for various master pages in

  • 0

I want to create a common header user control for various master pages in a web application. The header is shared by masters and has common items such as the logo, navigation, and dynamic account buttons such as My Account and Sign Out.

I am adding dynamic link buttons to the form just fine, but I then want to move them to the Placeholder position.

The problem is that the user control gets the error, “‘LinkButton’ must be placed inside a form tag with runat=server” when I add it to a placeholder.

uc_header.ascx.cs

LinkButton signout = new LinkButton();
signout.Text = "Sign-Out";
signout.ID = "SignOutLink";
signout.Click += new EventHandler(SignOutLink_Click);
//adding it to the form works but positions it at the bottom
this.Page.Form.Controls.Add(signout);
//I get an error when I try to add it to the placeholder 
SignOutHolder.Controls.Add(signout);

uc_header.ascx (simplified for example)

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="uc_header.ascx.cs" 
Inherits="Site.Masters.uc_header" %>

<asp:PlaceHolder ID="SignOutHolder" runat="server"></asp:PlaceHolder>

How can I add or position the Sign-Out button to the placeholder using .Net?

My goal is to create a way to log out on all the pages and manage only one common header file.

  • 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-03T05:10:39+00:00Added an answer on June 3, 2026 at 5:10 am

    It sounds like the user control is placed outside of the form. As the error message indicated, check the master page and make sure that the user control is inside the form.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a fairly large-scale Flex web application that has a similar
I want to create a page which has footer and some common parts. On
I want to create gallery application which would get thumbnails and metadata from web
I want to create a search form where a user queues up items, and
I want to create a frame and fill it with a segmented control. How
I want to create a set of classes that share a lot of common
I want to create datasource bean programmatically depending on args passed from user then
Currently, for things like a header, footer or common sidebar object, I create a
I have created a website and I want to create a control panel for
I have win32 API application in visual c++. I want to create a directory

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.