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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:26:40+00:00 2026-05-27T05:26:40+00:00

I have a base usercontrol in my ASP.Net app, There are HTML markup within

  • 0

I have a base usercontrol in my ASP.Net app, There are HTML markup within this usercontrol that are set to runat=”server” and id’s. The problem I am having is when the usercontrol is loaded, the HTML markup is being returned as null

ASP.Net C# code:

public partial class webonlinecustombase : System.Web.UI.UserControl
{
    public Event Event { get; set; }
    public OnlineSystemPageCustom custompage { get; set; }
    public OnlineSystemPageCustom.OnlineSystemPageHdr.OnlineSystemPageModule custommodule { get; set; }

    public void Page_Load(object sender, EventArgs e)
    {
        string typeName = custommodule.ModuleInternetFile;
        inpagelink.HRef = "#" + custommodule.ModuleName.Replace(" ", "").Replace("/", "");
        modtitle.InnerText = custommodule.ModuleName;
        Type child = Type.GetType(typeName);
        UserControl ctl = Activator.CreateInstance(child) as UserControl;
        if (ctl != null)
        {
            this.modsection.Controls.Add(ctl);
        }
    }
}

Here is the HTML Markup:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="webonlinecustombase.ascx.cs" Inherits="IPAMIntranet.IPAM_Controls.webtemplatecontrols.webonlinecustombase" %>
<a id="inpagelink" runat="server"></a>
<span id="modtitle" runat="server" style="width:100%;text-align:left">Scientific Overview</span>
<div id="modsection" runat="server" style="width:100%;">
</div>
<p><a href="#top" class="bodylink">Back to Top</a></p>

Why is the inpagelink and modtitle being returned as null?

  • 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-05-27T05:26:40+00:00Added an answer on May 27, 2026 at 5:26 am

    I have seen this happen in web applications (not web sites) when changes are made to the source (especially setting runat=server on items that were not previously runat=server), but you don’t switch to the designer view.

    The way that I resolve this issue is to switch to design view and dirty a property in one of the fields. This usually causes VS to update the designer code-behind file.

    You can double-check this file to ensure the controls have been added. If you check it prior to doing this, you should see that they are missing.

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

Sidebar

Related Questions

I have an ASP.NET web form that has a container usercontrol that hosts several
I have a UserControl that is a base class for other user controls, that
I have an abstract UserControl that I want to show a ToolTip on. This
I have a .NET UserControl (FFX 3.5). This control contains several child Controls -
I'm working on an ASP.NET page, using VB.NET and I have this hierarchy: Page
My asp.net application has a custom base user control that is inherited from other
I have a base UserControl (BaseControl.cs) which has an OK and Cancel buttons on
I have a custom base user control in silverlight. <UserControl x:Class=Problemo.MyBaseControl xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:d=http://schemas.microsoft.com/expression/blend/2008
In the project I'm working on now, we have base Entity class that looks
I have a base URL : http://my.server.com/folder/directory/sample And a relative one : ../../other/path How

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.