Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 19th, 2005, 06:11 AM
Authorized User
 
Join Date: Mar 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mistry_bhavin
Default Web User Control

I have created one web user control (named webusercontrol1). Now whenever i place that on any web form it works fine. But I want to display a web user control dynamically.
so I write
DIM A AS NEW WEBUSERCONTROL1
ME.CONTROLS.ADD(A)
A.VISIBLE=TRUE.

But I do not get any control on page.
Can U plz help me with this?

 
Old August 19th, 2005, 02:27 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

You have to use the LoadControl method of the page:

        Dim myControl As WebUserControl1 = CType(Page.LoadControl("webusercontrol1.ascx"), WebUserControl1)
        Me.FindControl("Form1").Controls.Add(myControl)






Similar Threads
Thread Thread Starter Forum Replies Last Post
Add Windows User control in Web User Control agarwalvidhu C# 0 March 30th, 2006 01:17 AM
Web User Control Problem jbenson001 ASP.NET 1.x and 2.0 Application Design 12 January 18th, 2005 03:56 PM
Web user control EvilGuyWhoEatsBrains General .NET 1 December 14th, 2004 01:21 PM
Web User Control Best Practices flyin General .NET 4 May 24th, 2004 07:57 AM
Web User Control Problem shmacgregor VS.NET 2002/2003 18 February 22nd, 2004 06:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.