Ask a Question related to ASP.NET Building Controls, Design and Development.
-
davidr@sharpesoft.com #1
Can't View Item Template in Designer Viewer
Hi,
I creted a usercontrol which has an ITemplate in it named ItemTemplate.
I am using ASP 2.0.
When I drag the user control on to my .aspx page everything looks fine.
Once I add the
<ItemTemplate></ItemTemplate> tags the control no longer displays
inside the design viewer. I can add any asp, html or other controls in
between the <ItemTemplate></ItemTemplate> and they appear when I run
the webpage. Why do these not appear in my designer view? Also, is
there a way so I can make the <ItemTemplate> editable in the designer
view like you can with the asp:gridview. In the asp:gridview you are
able to click Edit Templates, select one and put whatever HTML you want
right there in the designer view. Then click End Editing and it goes
back to the normal control view. I am doing this with a User Control
because it saves a lot of time of trying to create my own web user
control. I know when you create a web control you have to set up the
GetDesignerHTML() in order to see it in design view, but I didn't read
about anything like that for user controls. All the Item template is a
place holder for the HTML that will be defined in the .aspx page
between <ItemTemplate></ItemTemplate>.
Also, Yes I did instantiate the ItemTemplate as shown below.
private ITemplate _itemTemplate;
[PersistenceMode(PersistenceMode.InnerProperty),
TemplateContainer(typeof(TemplateControl))]
public ITemplate ItemTemplate
{
get { return _itemTemplate; }
set { _itemTemplate = value; }
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
if (_itemTemplate != null)
{
_itemTemplate.InstantiateIn(this.AspPlaceHolder);
}
}
Thank you,
David
davidr@sharpesoft.com Guest
-
Web derived controls in VS2005 designer view
Hi I'm more or less desperate here, I've posted this in a few forums now over the months and got absolutely no response. It would be very much... -
Rendering a derived drop down list in VS2005 designer view
Hi I have a control derived from a drop down list written in VB.NET (ASP.NET 2.0) that dynamically displays listitems retrieved from an SQL... -
How do I add an item to a controls popup menu in the designer?
I've created a custom control but i would like to have a customized property sheet that I can access by the right-click pop-up menu. This would be... -
Displaying template content in vs.net designer
hi, I'm trying to display the content within my "templated databound custom controls" templates at design time, in the vs.net designer. I'm able to... -
Viewer Programs to View Freehand Files
Are there any viewer programs to view Freehand Files? I am looking for a windows version of a viewer program so that we can open Freehand Files. ...



Reply With Quote

