473,806 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ITemplate and designer code generation

3 New Member
Hi, i've made my own Custom Server Control, wich inherits from WebControl class.

Inside of my control I've create three ITemplate properties wich should be used as containers for Head, Content and Footer.

Here is example of my Content property

Expand|Select|Wrap|Line Numbers
  1. 1        <Browsable(False), Description("The template property"), PersistenceMode(PersistenceMode.InnerProperty), TemplateContainer(GetType(ContentPanel))> _
  2. 2        Public Property Content() As ITemplate
  3. 3            Get
  4. 4                Return _content
  5. 5            End Get
  6. 6            Set(ByVal value As ITemplate)
  7. 7                _content = value
  8. 8            End Set
  9. 9        End Property
  10.  

ContentPanel is another control wich inherits from Panel control.

Now I've got fallowing asp.net code:



Expand|Select|Wrap|Line Numbers
  1. 1    <controls:MyControl id="MyControl1" runat="server">
  2. 2                <Content>
  3. 3                    <asp:Label ID="someLabel" runat="server" Text="dupa" />
  4. 4                </Content>
  5. 5    </controls:LayoutFrameControl>
The problem is, that someLabel is not added to .design.vb file after it's generated, why? Is there any solution? any attribute or sth? Please help me, because i've lost many hours to find the solution..
Dec 28 '08 #1
1 1511
Frinavale
9,735 Recognized Expert Moderator Expert
Are you adding the controls while debugging the application?

In this case, the control will be added to the page but since it's in debugging mode the designer.vb file cannot be updated.

-Frinny
Jan 13 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
12506
by: Martin Schulze | last post by:
Hello, i tried to compose myself a custom usercontrol which is derieved from System.Windows.Forms.UserControl. It contains 2 comboboxes and one textbox (which are also custom controls, but directly derived from the .net classes ComboBox and TextBox) I did the custom control in the visual studio .net designer in which i
0
270
by: Steve Richter | last post by:
trying to understand how to support templates in server controls ... a few quick questions on the following snippet of code pulled from a server control class: ITemplate _headingStyle; public ITemplate HeadingStyle {
0
1717
by: vicgroups | last post by:
Hello, I am adding columns to the datagrid programmatically. And I have created a countries drop down list in an ascx file. I have added the countries drop down list to the datagrid column as follows, TemplateColumn tc = new TemplateColumn(); ITemplate iTemplate = LoadTemplate("DropDownList_Countries.ascx"); tc.EditItemTemplate = iTemplate; DataGrid1.Columns.Add(tc);
7
1347
by: Dino Buljubasic | last post by:
I am having a problem when trying to view a form in desing view. If a form has any error or warning, the design view will not open the form. Anybody knows how to fix this error? Thank you _dino_
5
6616
by: Ben Schumacher | last post by:
Ok smart guys and gals ... I have a GridView control with a dynamically created checkbox column. The checkbox is created using ITemplate interface. In my class that implements the ITemplate interface I set the AutoPostBack property of the checkbox to True. When the checkbox is clicked, I want to handle the CheckChanged event of the checkbox on the webform (.aspx) that contains the GridView control. I can easily use the addhandler...
0
1299
by: imranabdulaziz | last post by:
Hi all, I am using asp.net2.0 and C# VS2005. I am creating asp.net web server control templates Dynamically . My requirement is such that sp return very no of field( 4 or 5 or 6 …). Now I am assigning it to datalist by creating web server control template dynamilly. My problem is as no of field return very .how can I change databinding(which is method of itemplate) method so that I can bind data as per field. That is how can I change...
2
4921
by: DC | last post by:
Hi, I am trying to implement a simple template control (to be used as TemplateItem etc. in GridView). Does someone see why my code fails? I give up for now and try a different approach (http:// www.developerfusion.co.uk/show/4721). TIA for any ideas. Regards DC
0
1667
by: Andy B | last post by:
I added a LINQ classes (dbml) file to my web application project and drug a sql server database table from the server explorer onto the o/r designer. I saved and closed the designer after that. I then opened default.aspx, added a gridview to the designer and then went into the smart tag for it. I went to the configure data source link in the smart tag window, chose new datasource and clicked LINQ as the source type. I left the name as...
6
3346
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
Yesterday Visual Studio gave me a strange error both at compiletime and at designtime that had no obvious connection to anything I had changed recently. After some effort tracking down the problem I discovered first a workaround, then the real cause of the problem. I would like to understand why what I am doing is frowned upon by Visual Studio and how to do this properly. My application is in one solution; supporting libraries including...
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9597
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10620
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10369
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.