Groups | Blog | Home
all groups > asp.net webcontrols > november 2004 >

asp.net webcontrols : Asp.Net C# Whidbey WebUserControl



Johnny E Jensen
11/26/2004 9:29:16 PM
Hello

I'm trying to implement a WebUserControl ( MyCtrl.ascx ) to a WebForm (
MyWebForm.aspx )
The MyCtrl.ascx has some properties ( Public String FormTitle ) - and some
others.

In VS.2003 I load the WebUserControl like this:

MyCtrl _Ctrl = (MyCtrl)Page.LoadControl("MyCtrl.ascx");
.... ControlContainer.Controls.Add( _Ctrl );
_Ctrl.FormTitle = "Test";

This way to implements the WebUserControl don't work in Whidbey(VS2005) -
Why?
I'm able to load the WebUserControl to the page with:
Control _ctrl = Page.LoadControl("MyCtrl.ascx");
.... ControlContainer.Controls.Add( _ctrl );
But are not able to access the property FormTitle like _ctrl.FormTitle?

Solutions - any one?

Kind regards
Johnny E Jensen

John Saunders
11/27/2004 8:31:43 PM
[quoted text, click to view]

I don't know, you tell me!

What do you mean, "don't work"? Please be less vague.

[quoted text, click to view]

That would be because _ctrl is of type Control, which does not have a
FormTitle property.


John Saunders

AddThis Social Bookmark Button