|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Reach UserControl from ASPX codebehind?Hi,
I created a usercontrol and dropped it onto my aspx... But from CodeBehind of that aspx I can't reach to that UserControl...I just want to reach to it just like when I dropped for instance a textbox onto that form so I can play with it's properties and subscribe to it's events? Anybody can help? I'm using Framework 1.1 Regards, Özden Irmak If the user control has a codebehind, than that's the class you can declare
and use from your ASPX's codebehind. If the ASCX doesn't, then the only place you'll be able to make early bound function calls on it is from any inline code in your ASPX. -Brock DevelopMentor http://staff.develop.com/ballen Show quoteHide quote > Hi, > > I created a usercontrol and dropped it onto my aspx... > > But from CodeBehind of that aspx I can't reach to that UserControl...I > just want to reach to it just like when I dropped for instance a > textbox onto that form so I can play with it's properties and > subscribe to it's events? > > Anybody can help? > > I'm using Framework 1.1 > > Regards, > > Özden Irmak > Thanks for the reply, and I found my solution...
JCThumbView JCThumbView1 = (JCThumbView)Page.FindControl("JCThumbView1"); this works... Show quoteHide quote "Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message news:913866632545163371154960@msnews.microsoft.com... > If the user control has a codebehind, than that's the class you can > declare and use from your ASPX's codebehind. If the ASCX doesn't, then the > only place you'll be able to make early bound function calls on it is from > any inline code in your ASPX. > -Brock > DevelopMentor > http://staff.develop.com/ballen > > > >> Hi, >> >> I created a usercontrol and dropped it onto my aspx... >> >> But from CodeBehind of that aspx I can't reach to that UserControl...I >> just want to reach to it just like when I dropped for instance a >> textbox onto that form so I can play with it's properties and >> subscribe to it's events? >> >> Anybody can help? >> >> I'm using Framework 1.1 >> >> Regards, >> >> Özden Irmak >> > > > If you declare your user control manually in the same fashion that the
webform generated code does for the aspx controls, then you will be able to access your controls anywhere on the page. You can even capture events raised by your control the same way you would an aspx control. -- Show quoteHide quoteStaff Consultant II - Enterprise Web Services - Cardinal Solutions Group Future Business Model - National City Mortgage "Özden Irmak" wrote: > Thanks for the reply, and I found my solution... > > JCThumbView JCThumbView1 = (JCThumbView)Page.FindControl("JCThumbView1"); > > this works... > > "Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message > news:913866632545163371154960@msnews.microsoft.com... > > If the user control has a codebehind, than that's the class you can > > declare and use from your ASPX's codebehind. If the ASCX doesn't, then the > > only place you'll be able to make early bound function calls on it is from > > any inline code in your ASPX. > > -Brock > > DevelopMentor > > http://staff.develop.com/ballen > > > > > > > >> Hi, > >> > >> I created a usercontrol and dropped it onto my aspx... > >> > >> But from CodeBehind of that aspx I can't reach to that UserControl...I > >> just want to reach to it just like when I dropped for instance a > >> textbox onto that form so I can play with it's properties and > >> subscribe to it's events? > >> > >> Anybody can help? > >> > >> I'm using Framework 1.1 > >> > >> Regards, > >> > >> Özden Irmak > >> > > > > > > > > >
Webform Navigation
Can't set button to Visible? Is someone willing to help me with a simple VB example? Need reviews and advice on web and data control tools and vendors Skin and custom controls (ASP 2.0) Web Custom Control using a property displaying current form text boxes Dynamically populating and expanding TreeView from button click... Datagrid - How to format EditCommandColumn? Composite Web Control Open Source or Free PDF Control |
|||||||||||||||||||||||