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
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
And then within the body
Then within your ashx file
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:
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