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,
...
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...
How do I control one control from another control?
I have a page page1.aspx which is within a master page.
On page I have a table with two cells. Within each cell I have placed two controls (ascx) that I have developed.
Now I'd like to be able to get these two controls to interact. One needs to update the other. One has some search criteria that the other one needs to update its gridview. One needs to make the other visible/not visible at certain times. Out of the box neither control can see each other at all.
Is there a good article or someplace I can find some information on how to do this?
AllAboutFocus.com. Information Technolo...
Custom Control within a Custom Control
I have two individual custom controls say custom cc1 and cc2. cc1 is communicating to cc2 using event delegate mechanism.I have tested the behaviour by dropping cc1 and cc2 onto a Web Page and it works fine. I want to create a third custom control say cc3 which should contain both cc1 and cc2. So that if i drag and drop cc3 onto a Web Page i can acheive exactly what i am doing above.
The problem is that i am not sure how to call/register a custom control within a custom control ? Any clue ?
Thanks!!
Hi,
Do you mean adding custom control to custom control? I think you can use the same wa...
Add .Net Control to Web Custom Control
I want to add .NET Control (like: TextBox, Button...) to Web Custom Control.How i can do it? Alphavn
That's called a composite control -- "Mark As Answer" if my reply helped you --
Hello Guys
What gunteman said, that is one approach and in most cases the right one.But its also possible to add child controls to a Control thats inherit from WebControl itself.
Be sure to implement INamingContainer to that inherited Control too, thats the important point of that approach.--Microsoft MVP - Visual Developer ASP / ASP.NET- http://www.aspnetzone.de/blogs/peterbuch...
Architecture: .Net Controls vs. Custom Controls
I'm interested in managing users. i.e. Logins and profiles, etc.My question is, should I be using things like the Login control or should I program these from scratch? I dont like the fact that .NET creates so many things for me. This level of abstraction terrifies me and it feels like I have no control over the code .I've done a few huge sites in Classic ASP (million-hits-per-day type sites) and I'm not sure how robust certain controls are, or when to use them.Is, for example, the Login control aimed at newbies to .NET? Should it be used for the larger projects with thousands of...
DW control in VB. NET custom controlHi
Just attempting to investigate some DW.NET aspects. In regards to building a
ancestor object with VB.NET, why is when I create a datawindowcontrol custom
control that any reference to it is like (assuming that u_dw is the name of
the DW control):
custom_control.u_dw.DatawindowObject = "myDW"
instead of simply: u_dw.DatawindowObject = "myDW"
If I create a .NET custom control with a button on it, I can directly
reference the button's methods and properties without having to qualify it
with the custom control's name.
When I was developing with po...
ajax.net controls used in custom composite controls?
I am creating an events calendar that uses the accordion to display the events for the selected day. The problem I'm having is that the accordion is not responding to any client side events. I would really like to find a good "How to" article for building composite controls that incorporate an ajax.net control like the accordion....
Handling control events while in edit mode for a gridview control
I have a dropdownlist and checkbox in a single column of a gridview. While the row is in edit mode, I want to set the visibility of the checkbox based on the value selected in the dropdown list. I can do this easily enough when the row is first put into edit mode, but how do I access the dropdown list's change event when the row is already sitting there in edit mode? Thanks for any help you can provide.
Penny
Penny,
Just create a SelectedIndexChanged event like below. Create a row object for the currently edited row, find the checkbox you want to control, then set the Visib...
user control or custom control ?
i have datagrid which shows monthyear user control for each row. The month year user control has two drop down list. one is for year and other one is for month. So for each row in particular column i'll have that user control loaded. it works fine but ut takes lot of time in rendering when there are 200 rows. what would be the solution. will custom control help?
Hi,Lax4u:
Some tips i am not quite sure.
First, you can disable the viewstate of the userControl to make it not load so many information in each postback and store the necessary in the global range.
Second, Caching porting of th...
Custom controls called from inside other custom controls???
I'm fairly new to writing controls in ASP.NET so, forgive the
I am trying to create a base page class which will call 3 custom controls. This base page class will span across multiple projects hence the reason I am not creating user controls.
These 3 custom controls are:
1. TopNav-uses render method to display an HTML table with graphics for top navigation.
2. ImagePairs-uses prerender method to add javascript code to manage what graphic is
displayed in TopNav onMouseOver and onMouseOut
3. MgrHeader-uses render method to display an HTML table with s...
Custom controls having Ajax Controls
I have a custom control called ModalUpdateProgress. I don't want to narrow down the topic to why do I have to build it or something else. The point of control is to lock a sceen while postback happens so it is a conjunction of Update Progress and Modal Popup Extender. I had no problem to build a control similar to Update Progress. Then I add Modal Popup Extender:
if(typeof(undefined) != typeof(AjaxControlToolkit))
if(typeof(undefined) != typeof(AjaxControlToolkit.ModalPopupBehavior)) {
this._modalPopupBehavior = $create(AjaxControlToolkit.ModalPopup...
Access controls in custom controls
I have loaded user control into placeholder, but how to access controls inside it? Aka controls inside controls?
Hi,the PlaceHolder is the container of your controls. To reference a control inside a container, you can use the FindControl() method of the container, passing the ID of your control as an argument.For example:// Create an instance of the user control.MyUserControl uc = new MyUserControl();// Give an ID to the user control instance.uc.ID = "userControl1"; // Add the user control to the PlaceHolder.myPlaceHolder.Controls.Add(uc); &nb...
Creating Custom Controls With Custom Controls Inside Of Them
Hello, I am trying to create a custom control for creating tabs. The idea is that our designer can just use the control tags to generate the tabs. The problem that I am running into is that I want to be able to have a custom control that allows any number of child custom controls. So there would be a TabContainer Control, and within that there would be any number of tabs. The idea is similar to how an asp:DropDown list can have any number of ListItems within them. Here is my code, any help is appreciated. 1 <!-- TAB CONTAINER -->2 <%@ Control Language=&...
Custom Controls or User Controls
Hi,
I have to create a menu control and I am unable to decide between a custom control or user control. Apart from the fact that a custom control can be inserted into the toolbox what are the other advantages and disadvantages of each like performance, and so on. Plus how do I decide between the two.
Thanks
Arjuna.
Hello
Please refer to the KB article Overview of user controls vs. custom controls
Hope it helps,
JessicaJessica CaoSincerely,Microsoft Online Community Support“Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer...