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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:13:42+00:00 2026-05-29T11:13:42+00:00

Hello how i can load web forms inside one web forms div/ SO i

  • 0

Hello how i can load web forms inside one web forms div/

SO i have web form ‘account’ which opening inside master page.

on my account web form i have menu i want when user clicks it to load another web form inside account page.

I am using ASP.NET C#.

Sorry For My Bad English.

Thanks

  • 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-29T11:13:43+00:00Added an answer on May 29, 2026 at 11:13 am

    If you want to do this server-side this can be accomplished by loading an instance of a usercontrol into your form vs. the actual page. Click here to see an MSDN example and be sure to use update panels to manage the post backs.

    If you want to do this client side you can do so via ajax and calling an ashx (handler file)
    To manage this client side:

    within your aspx file add the following:

    within the header

        <script type="text/javascript">
            $(function () {
                $("#panel").hide();
            });
            $(document).ready(function () {
                $(".slide").click(function () {
                    $("#panel").show("slow", false);
    
                    jQuery.ajax({
                        type: "POST",
                        url: "controlloader.ashx",
                        dataType: "html",
                        success: function (response) {
                            jQuery('#loadcontrol1').append(response);
                        },
                        error: function () {
                            jQuery('#loadcontrol1').append('error');
                        }
                    });
    
                });
    
            });
    </script>
    

    And then within the body

    <body>
        <form id="form1" runat="server" >
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div>
            <div id="panel" >
            <p>stuff here</p>
            </div>
            <p><%= DateTime.Now %></p>
            <div id="div1" class="slide">
                <p class="btn-slide">Expand Panel</p>
            </div>
            <br />
            <asp:Button Text="Click me" ID="clickButton" runat="server" />
    
            <div id="loadcontrol1" />
    
        </div>
        </form>
    </body>
    

    Then within your ashx file

    public class controlloader : IHttpHandler
        {
            //If annonymous id is turned on IRequireSessionState Interface may be needed to write session variabled such as user auth.
            // Generic handlers by default implementIReadOnlySessionState
            public void ProcessRequest (HttpContext context)
            {
                context.Response.ContentType = "text/plain";
                context.Response.Write(RenderPartialToString("~/Control1.ascx")); ;
            }
    
            private string RenderPartialToString(string controlname)
            {
                Page page = new Page();
                Control control = page.LoadControl(controlname);
                page.Controls.Add(control);
    
                StringWriter writer = new StringWriter();
                HttpContext.Current.Server.Execute(page, writer, false);
    
                return writer.ToString();
            }
    
            public bool IsReusable
            {
                get
                {
                    return false;
                }
            }
        }
    

    You will also need to create the user control file but I’ll leave that code to you.
    There are a few things happening in this example. The button is used to proveout post-backs to ensure the control is not reloaded. I also added an animation which you don’t need but this was an old proof-of-concept piece I had from a while back so you can ignore that chuck of code.

    I know you mentioned the user of master pages so you will more than likely want to factor out the javascript into a js file and then be sure to load it using script manager as:

    <asp:ScriptManager ID="ScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Path="~/js/jquery-1.7.js" />
                <asp:ScriptReference Path="~/js/yourcontrolloader.cs" />
    </scripts>
    </asp:ScriptManager>
    

    This is required when using master pages otherwise due to the server side rendering your references will be lost and the scripts never called. You could also use a partial reference in the actual page vs the masterpage but this is up to you.

    Best of luck

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

Sidebar

Related Questions

I have a web page that displays comments, and users can click a 'Flag'
Hello I need to have multiple language support of my django admin application.I can
Can any one explain why the output of this code is only 'hello' and
I'm currently measuring the time spent to load a web page from a C#
I Have this code : MainPage.cs public class MainPage : System.Web.UI.Page { public string
I have a master page with a content control. I want it to do
I'd like to load/insert an external html page into my web page. Example :
Hello can anyone help? I am using this full page slider.. http://www.musca.se/full-window-width-jquery-tools-content-slider-demo/ However i
Hello can anybody solve this please I'm creating the object in the action class
hello how can i call in the current view, a method implemented 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.