Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > using a usercontrol from code behind

Reply
Thread Tools

using a usercontrol from code behind

 
 
John Koswalski
Guest
Posts: n/a
 
      12-04-2003
I have a test usercontrol,

It works fine from the HTML page of the webform. If i want to manipulate
the control (properties, methods) I can get that to work if add in
dynamically at run time. Adding it to the webform at design time (drag and
drop) doesn't allow me access to the properties and methods from the code
behind. I added the declaration to the control without the new keyword and
I even tried to direct cast the control using the FindControl function to
the variable but it doesn't work ... any ideas .....

Thx


 
Reply With Quote
 
 
 
 
William
Guest
Posts: n/a
 
      12-04-2003
"John Koswalski" <(E-Mail Removed)> wrote in message news:<#(E-Mail Removed)>...
> I have a test usercontrol,
>
> It works fine from the HTML page of the webform. If i want to manipulate
> the control (properties, methods) I can get that to work if add in
> dynamically at run time. Adding it to the webform at design time (drag and
> drop) doesn't allow me access to the properties and methods from the code
> behind. I added the declaration to the control without the new keyword and
> I even tried to direct cast the control using the FindControl function to
> the variable but it doesn't work ... any ideas .....
>
> Thx



When you declare the control in your codebehind page it has to have
the same name as the ID of the user control in the aspx page.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Non-code behind to code behind John ASP .Net 2 02-19-2007 07:08 PM
TabStrip/Multipage using UserControl (.ascx) contained within a UserControl(.ascx) shaileenpatel@yahoo.com ASP .Net Web Controls 2 05-03-2005 05:01 PM
Usercontrol derived from Usercontrol without double Html Code Reik ASP .Net Web Controls 1 04-12-2005 04:34 PM
Can you share a code behind file with a page and usercontrol? Michael Evanchik ASP .Net 1 07-30-2003 04:38 AM
Re: Code Behind vs. no code behind: error Ben Miller [msft] ASP .Net 1 06-28-2003 01:46 AM



Advertisments