load user control from server custom control

hi all,

i have a 3rd party menu control that consists of a bunch of HyperLinks and a PlaceHolder control (C# v1.1.4) . links to .ascx files are retrieved from a data source, and when the page containing the control is loaded or a link clicked, the control uses this.Page.LoadControl(strLink) to add the .ascx to the PlaceHolder. fine and dandy, probably wouldnt have done it that way myself, but i'm stuck with it :)

the problem is events: i can't raise 'em :( if i have for example a Button control on one of the .ascx pages, the Button.Click will go by unnoticed on the post-back. strange thing is, i have another custom server control that i've added to an .ascx page, and i can raise events on that no problem. i think this may be because the custom controls' event and delegate have a protection level set to public?

 

i'd really appreciate any thoughts on this!

 

many thanks, dave

 

0
dscanlon
9/12/2006 2:44:39 PM
asp.net.custom-server-controls 3498 articles. 0 followers. Follow

0 Replies
718 Views

Similar Articles

[PageSpeed] 33

Reply:

Similar Artilces:

Usercontrol vs Custom Server Controls, Any need for Custom Server Controls
Hello I'm new to ASP.Net so this is probably a stupid question but, is there any need to create customer server controls now that you can pre-compile usercontrols into a dll and thus easily share between applications? This blog post from David Ebb describes how to do it and the restrictions he note don't seem that bad (other than being able to embed resources such as images in the dll). http://blogs.msdn.com/davidebb/archive/2005/10/30/487160.aspx His article desribes the techniques for ASP.Net 2.0 and he suggests that there will be further improvements in .Net 3.5 in this ar...

Custom Server Control Vs Web Parts, Any need for Custom Server Control
Hello I've just posted a similar question on why you need server controls when you can pre-compile usercontrols and redistribute them. http://forums.asp.net/p/1397433/3010100.aspx#3010100 I've seen lots of (usercontrol vs web part) but not much on web part vs custom server control. According to the MSDN site you can put web parts onto a normal asp.net page outside of a web part zone and they behave just like custom server controls. So, if you are creating a bunch of controls for redistribution to customer asp.net sites and/or SharePoint sites why don't you just create Web Par...

problems listenening to events on a custom server control from another custom server control
 Hi all,I am having problems listening to events on one of custom server controls(AddBookmark) from another custom server control(BookmarkList). The listener or the BookmarkList control has a property that can be set to the AddBookmark control (string at design but the reference is obtained at run-time). I am able to get a reference to the AddBookmark control and add a listener to it on the BookmarkList control on the OnPrender of BookmarkList. But the problem is that when the events on AddBookmark gets fired, the listener added from the BookmarkList is no longer present and the listene...

Custom Server Control Made of Custom Controls?
I'm giving myself a crash course in custom server controls, and I have a quick general question. Can I have a custom server control that is composed of other server controls I created. I'm pretty sure the answer is yes, but I want to be positive. Yes http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcondevelopingcompositecontrols.asp Shows how to combine existing controls into a new control using class composition. -ron Thanks! ASP.NET so rocks! Making page components extensible objects is such a great idea! I love it....

Dynamically Loaded User Control inside Custom Server Control Weirdness
Hello, I have a wizard controller server control that walks the steps of a wizard and dynamically loads the user control to display for the wizard page using Page.LoadControl. Everything is working great! Until this showed up. One of the controls on the user control is another custom server control. This server control on the dynamically loaded user control makes use of RegisterClientScriptBlock. For some reason, the client side code for RegisterClientScriptBlock never gets rendered! I stepped through the code to ensure that RegisterClientScriptBlock gets called, it does. If I ...

how to have both server controls and html controls rendered in a custom control?
I have a custom control in which there is an html text box.when you click on it , a div containing a table is appeared and according to what you select in that table a text is set to the text box. It works fine but the problem is: as the text box is an html element it doesn't have viewstate and when a post back occures in the page its value disappeares.I tried a hidden field to keep its value.again there is another problem : I put this custom control in a usercontrol and put the usercontrol in a multiview and by clicking on a button this view is selected and by clicking another bu...

Using a user control in a custom server control.
I've created a custom server control and am trying to add a user control to the rendering of the server control.  Is this possible?  If so, hints as to how this is done would be GREATLY appreciated!  Thanks in advance for considering an answer to this question. Wendi Use the LoadControl method. For example:   Controls.Add(LoadControl("~/controls/login.ascx"))Steven BeyRecursion: see Recursion My server control renders a table with x number of rows.  I want to add a user control to each row of the table, last column.  I do not know how ...

Help! Custom Server Control using User Control
I've been bashing my head for a few days on this problem. My Custom Server Control loads the User Control and renders it properly.  But, when I run the web application the controls (ex: buttons) from the User Control is not firing the event (ex: a button click to change the label's text)?Here is a snippet of part of my code:    Protected Overrides Sub CreateChildControls()        plhPanel = New System.Web.UI.WebControls.PlaceHolder        ContentFileLoaded = New System.Web.UI.U...

Server Web User Control or Web Custom Control
Ok, I made a DataGrid I like, stuck it in a Web Control Lib, and then to my toolbar. Now I want to take my nice little control and add it to a greater control, maybe place some buttons around it etc. I could always inherit from it in a new custom control and dynamically add the buttons, but I thought about using a Web User Control. I thought I could easily create a Web User Control, drop on my grid and the buttons on a form, and expose some properties and events, but once I got into it, I got a feeling that this isn't what a Web User Control is for. When designing a control li...

Custom Server Control with Child Controls
I have a custom server control <xx.Parent... /> which parses custom child controls <xx.Child... />. In Visual Studio 2008, IntelliSense shows me both when I start typing my control namespace. How can I prevent the child control from showing up in IntelliSense  unless I'm adding it within the parent tags?Thanks. --Rudy...

Custom Server Control With Child Control
All, I am currently putting together a very simple control. The new control outputs a table with two rows. The top row contains a heading and the bottom row will contain any other content. The control as it stands works perfectly well and I can place text into the content row no problem. Now, to the problem. Once I'd completed the control I figured it would be neat to enable the developer to add controls directly into the bottom row (content row) of the outputted table. As you probably know the WebControl class has a Controls collection which the developer can use to add any other...

Custom Control within a Control Control
I am developing a custom controls that will render headers for different web sites. Within these controls, I want to place another custom control that will change the language. I created the language control and had it implement IPostBackDataHandler. This control works fine if I drag it on a new web form, but if I tell a header custom control to render it problems occur. The Language Selector custom control does not have a Page member anymore and the event handlers do not work. Does anyone have any experience with doing something similiar? Anyone have any suggestions? Thanks, ...

Custom User Controls v. Custom Web Controls
Hi! Is it better for me to begin coding my controls instead of just designing them? What would the benefits be? I meen, i seem to be able to get all i need from just putting stuff together on an ASCX file but i'm obviously missing a huge concept here... please explain! Hi, creating user controls is indeed easier than creating custom server controls because you can simply drag & drop other controls on the form, easily add events to it, ... Custom controls however are better when you want to reuse them in several other projects. I like to create custom controls for small, reusable com...

Custom Control or dynamic loading user controls?
Hi, I need to show different information depending on Request.QueryString params. Firstly I decided to choose in Page_Load method which user control I should load (different user controls are responsible for displaying different information). Everything works but the output is flushed after </html> tag (I load control and add it to the Page.Controls). What can I do with it? How to flush the output between <body> and </body> tags? Now I think about another conception. Maybe I should write a custom control that will do everything I wrote above? But idea with dynamic...

Web resources about - load user control from server custom control - asp.net.custom-server-controls

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

The US needs gun control to protect children like my grandson, killed at Sandy Hook
Motives do not matter to the dead. They don't matter much to survivors, either.

Microsoft Band updated to include music controls and inactivity alerts
... Microsoft Band came out, the company is adding functionality with a small software update. The two biggest features of this update—music controls ...

"... Trump owns and controls the media... they can't not cover him... his audience is bigger than theirs ...
... their army (i.e., the media) can't take out their enemy. They don't have the slightest idea what to do.... The media, in their own minds, controls ...

Sandy Hook parents assess victories, defeats in gun control mission
CBS News Sandy Hook parents assess victories, defeats in gun control mission CBS News NEWTOWN, Conn. Three years ago on Monday, a gunman opened ...

How to use iOS or Apple Watch as remote controls with Apple TV
... new feature for Apple TV owners using Apple Watch, iPad or iPhones last week – the capacity to use your iOS device as a remote control for your ...

Hilarious: ‘Burglars For Gun Control’ Sums Up The Left’s Entire Argument
'As long as law abiding citizens have guns, it's that much harder for burglars like me to do my job.'

Bart & Fleming: Don’t Come To Year-End Movies To Get Laid; Time For Movies About Gun Control Debate?
Peter Bart and Mike Fleming Jr. worked together for two decades at Daily Variety . In this weekly Sunday column, two old friends get together ...

Republique finally gets analog controls on PS4
... transitions (like Resident Evil ) which is mildly disorienting at first but could actually be easier to wrap your head around with a controllable ...

Microsoft Band 2 gets new music controls and activity reminders
... has revealed a few fresh features for the device, designed to make it smarter and more functional. For starters, there are new music controls, ...

Resources last updated: 12/15/2015 1:44:12 AM