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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:28:16+00:00 2026-06-01T14:28:16+00:00

My .ascx is into folder /cms/context/ , and it is called Test.ascx (on .NET

  • 0

My .ascx is into folder /cms/context/ , and it is called Test.ascx (on .NET 4.0, WebForms).

When I try to add :

<%@ Register TagPrefix="iz" Namespace="IZ.WebFileManager" Assembly="IZ.WebFileManager" %>

<div>
    <iz:FileManager ID="FileManager1" runat="server" Height="400" Width="600">
        <RootDirectories>
            <iz:RootDirectory DirectoryPath="~/images/" Text="My Documents" />
        </RootDirectories>
    </iz:FileManager>    
</div>

I get :

System.NullReferenceException. An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Why? And how can I fix it? Thanks

P.S. if I put the same code on Master Page it works as well…

Stack Trace :

[NullReferenceException: Object reference not set to an instance of an object.]
IZ.WebFileManager.FileView.OnPreRender(EventArgs e) +167
System.Web.UI.Control.PreRenderRecursiveInternal() +112
System.Web.UI.Control.PreRenderRecursiveInternal() +221
System.Web.UI.Control.PreRenderRecursiveInternal() +221
System.Web.UI.Control.PreRenderRecursiveInternal() +221
System.Web.UI.Control.PreRenderRecursiveInternal() +221
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4200

Here is the link where you can get that plugins. I just put the DLL into Bin folder and write that code into my Web User Control. Always used on Master Page, but in a WUC I have that trouble…

  • 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-01T14:28:17+00:00Added an answer on June 1, 2026 at 2:28 pm

    If you only specify namespace and assembly you will only get the ascx.cs part of the control and not the code-front file (.ascx)
    Since your code-behind file (.ascx.cs) is dependent on your code-front file (.ascx) to actually instantiate all the stuff you have declared, you need to include the Src in the register directive

    <%@ Register Src="~/cms/context/Test.ascx" TagPrefix="iz" TagName="Test" %>
    

    If you create your controls without a code-front file (what used to be called a “custom control”) you can get by with only specifying namespace and assembly, but if you want to have the convenience of a code-front file (“user control”) you need to specify the source.

    All the built-in controls within the asp.net framework are created as Custom Controls which means that it was harder for Microsoft to write them (they couldn’t use ascx files) but it’s easier for us to consume them (single register line in web.config enables for all pages)

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

Sidebar

Related Questions

I have two .ascx files in the same folder in an ASP.NET MVC project.
I've a ASP.Net page (Default.aspx) which will load UserControl (ucontrol.ascx) dynamically into an UpdatePanel.
I'm trying to build some .ascx controls into a class library for plugins for
Is it possible to embed an ASPX page into an ASCX control?
I have to integrate a Java applet into a simple asp.net 2.0 control. This
I've began working with asp.net mvc very recently and I've ran into a problem.
I am copy pasting from an MS word document into an ASCX file. When
I have a UserControl which rather than putting tags into its ascx markup file,
I am fairly new to the .NET scene and have run into a small
I want to fill a dropdownlist into an ASCX. To do that, in the

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.