|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
I really need to get this working......I create a very simple custom control: public class cLabel : System.Web.UI.WebControls.Label { } I place the cLabel in a user control. When I place the user control on a page I get this exception: Error Rendering Control - cLabel An unhandled exception has occurred. Unknown server tag 'cc1:cLabel'. So I tried to make a custom control which inherits from webcontrol: I create a very simple custom control: Designer(typeof(ControlDesigners)) public class cELabel : WebControl { } And make a very simple designer for it. public class ControlDesigners : System.Web.UI.Design.ControlDesigner { public override string GetDesignTimeHtml() { StringWriter sw = new StringWriter(); HtmlTextWriter tw = new HtmlTextWriter(sw); cLabel lbl = new cLabel(); lbl.Text = "cLabel"; lbl.RenderControl(sw); return sw.ToString(); } } Now everything works fine within the user control. But when I place the cELabel into a panel in the user control I get the same damn error. I really need to get this working! Anyone know the 'bug'? Is there a solution? I am working with VS2005 (beta), can someone confirm this works in the final release? Tia! How is the control being registered?
I'm able to successfully register controls using both global registration (new in 2.0, via web.config) and the 1.1 approach using @% Register Karl Show quoteHide quote "Pipo" <P***@home.com> wrote in message news:%23$SPwuUEGHA.1120@TK2MSFTNGP11.phx.gbl... > The problem: > > I create a very simple custom control: > > public class cLabel : System.Web.UI.WebControls.Label { } > > I place the cLabel in a user control. > > When I place the user control on a page I get this exception: > > > > Error Rendering Control - cLabel > > An unhandled exception has occurred. > > Unknown server tag 'cc1:cLabel'. > > > > So I tried to make a custom control which inherits from webcontrol: > > I create a very simple custom control: > > Designer(typeof(ControlDesigners)) > > public class cELabel : WebControl { } > > And make a very simple designer for it. > > public class ControlDesigners : System.Web.UI.Design.ControlDesigner > > { > > public override string GetDesignTimeHtml() > > { StringWriter sw = new StringWriter(); > > HtmlTextWriter tw = new HtmlTextWriter(sw); > > cLabel lbl = new cLabel(); > > lbl.Text = "cLabel"; > > lbl.RenderControl(sw); > > return sw.ToString(); > > } > > } > > > > Now everything works fine within the user control. > > But when I place the cELabel into a panel in the user control I get the > same damn error. > > > > I really need to get this working! > > > > Anyone know the 'bug'? > > Is there a solution? > > I am working with VS2005 (beta), can someone confirm this works in the > final release? > > > > Tia! > > It is not a registration problem.
Did you test this behaviour and did it work? Do you use VS2005 final release and can you conform this is working ?? again, it is not the registration, I can register it also on both ways. If registration fails you'll get an different exception. Please look again and see if you'll get the same problem. Which version of VS do you use?? thnx Show quoteHide quote "Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> schreef in bericht news:uyHVrzUEGHA.2320@TK2MSFTNGP11.phx.gbl... > How is the control being registered? > > I'm able to successfully register controls using both global registration > (new in 2.0, via web.config) and the 1.1 approach using @% Register > > Karl > > -- > MY ASP.Net tutorials > http://www.openmymind.net/ > > > "Pipo" <P***@home.com> wrote in message > news:%23$SPwuUEGHA.1120@TK2MSFTNGP11.phx.gbl... >> The problem: >> >> I create a very simple custom control: >> >> public class cLabel : System.Web.UI.WebControls.Label { } >> >> I place the cLabel in a user control. >> >> When I place the user control on a page I get this exception: >> >> >> >> Error Rendering Control - cLabel >> >> An unhandled exception has occurred. >> >> Unknown server tag 'cc1:cLabel'. >> >> >> >> So I tried to make a custom control which inherits from webcontrol: >> >> I create a very simple custom control: >> >> Designer(typeof(ControlDesigners)) >> >> public class cELabel : WebControl { } >> >> And make a very simple designer for it. >> >> public class ControlDesigners : >> System.Web.UI.Design.ControlDesigner >> >> { >> >> public override string GetDesignTimeHtml() >> >> { StringWriter sw = new StringWriter(); >> >> HtmlTextWriter tw = new HtmlTextWriter(sw); >> >> cLabel lbl = new cLabel(); >> >> lbl.Text = "cLabel"; >> >> lbl.RenderControl(sw); >> >> return sw.ToString(); >> >> } >> >> } >> >> >> >> Now everything works fine within the user control. >> >> But when I place the cELabel into a panel in the user control I get the >> same damn error. >> >> >> >> I really need to get this working! >> >> >> >> Anyone know the 'bug'? >> >> Is there a solution? >> >> I am working with VS2005 (beta), can someone confirm this works in the >> final release? >> >> >> >> Tia! >> >> > > I didn't try your designer example, I stuck with the basic Label example.
At home I have VS.NET Pro (rtm). At work I just tried on Visual Web Developer (rtm) and everything works. Here's what I have: cLabel.cs placed in App_Code namespace Test { public class cLabel : Label { } } ascx: <%@ Register TagPrefix="Test" Namespace="Test" %> <Test:cLabel ID="x" runat="Server">test</Test:cLabel> aspx: <%@ Register Src="WebUserControl.ascx" TagName="WebUserControl" TagPrefix="uc1" %> <uc1:WebUserControl ID="WebUserControl1" runat="server" /> Everything works fine at design time and runs perfect on the browser. Karl Show quoteHide quote "Pipo" <P***@home.com> wrote in message news:%23$SPwuUEGHA.1120@TK2MSFTNGP11.phx.gbl... > The problem: > > I create a very simple custom control: > > public class cLabel : System.Web.UI.WebControls.Label { } > > I place the cLabel in a user control. > > When I place the user control on a page I get this exception: > > > > Error Rendering Control - cLabel > > An unhandled exception has occurred. > > Unknown server tag 'cc1:cLabel'. > > > > So I tried to make a custom control which inherits from webcontrol: > > I create a very simple custom control: > > Designer(typeof(ControlDesigners)) > > public class cELabel : WebControl { } > > And make a very simple designer for it. > > public class ControlDesigners : System.Web.UI.Design.ControlDesigner > > { > > public override string GetDesignTimeHtml() > > { StringWriter sw = new StringWriter(); > > HtmlTextWriter tw = new HtmlTextWriter(sw); > > cLabel lbl = new cLabel(); > > lbl.Text = "cLabel"; > > lbl.RenderControl(sw); > > return sw.ToString(); > > } > > } > > > > Now everything works fine within the user control. > > But when I place the cELabel into a panel in the user control I get the > same damn error. > > > > I really need to get this working! > > > > Anyone know the 'bug'? > > Is there a solution? > > I am working with VS2005 (beta), can someone confirm this works in the > final release? > > > > Tia! > > thnx, Karl.
I think that it is a VS2005 beta bug, then. tommorow I'll install the final!!! thnx again for your patience and your time. Greets, Show quoteHide quote "Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> schreef in bericht news:%23zRx3MWEGHA.208@tk2msftngp13.phx.gbl... >I didn't try your designer example, I stuck with the basic Label example. >At home I have VS.NET Pro (rtm). At work I just tried on Visual Web >Developer (rtm) and everything works. > > Here's what I have: > > cLabel.cs placed in App_Code > namespace Test > { > public class cLabel : Label > { > } > } > > > ascx: > <%@ Register TagPrefix="Test" Namespace="Test" %> > <Test:cLabel ID="x" runat="Server">test</Test:cLabel> > > aspx: > <%@ Register Src="WebUserControl.ascx" TagName="WebUserControl" > TagPrefix="uc1" %> > <uc1:WebUserControl ID="WebUserControl1" runat="server" /> > > > Everything works fine at design time and runs perfect on the browser. > > Karl > -- > MY ASP.Net tutorials > http://www.openmymind.net/ > > > "Pipo" <P***@home.com> wrote in message > news:%23$SPwuUEGHA.1120@TK2MSFTNGP11.phx.gbl... >> The problem: >> >> I create a very simple custom control: >> >> public class cLabel : System.Web.UI.WebControls.Label { } >> >> I place the cLabel in a user control. >> >> When I place the user control on a page I get this exception: >> >> >> >> Error Rendering Control - cLabel >> >> An unhandled exception has occurred. >> >> Unknown server tag 'cc1:cLabel'. >> >> >> >> So I tried to make a custom control which inherits from webcontrol: >> >> I create a very simple custom control: >> >> Designer(typeof(ControlDesigners)) >> >> public class cELabel : WebControl { } >> >> And make a very simple designer for it. >> >> public class ControlDesigners : >> System.Web.UI.Design.ControlDesigner >> >> { >> >> public override string GetDesignTimeHtml() >> >> { StringWriter sw = new StringWriter(); >> >> HtmlTextWriter tw = new HtmlTextWriter(sw); >> >> cLabel lbl = new cLabel(); >> >> lbl.Text = "cLabel"; >> >> lbl.RenderControl(sw); >> >> return sw.ToString(); >> >> } >> >> } >> >> >> >> Now everything works fine within the user control. >> >> But when I place the cELabel into a panel in the user control I get the >> same damn error. >> >> >> >> I really need to get this working! >> >> >> >> Anyone know the 'bug'? >> >> Is there a solution? >> >> I am working with VS2005 (beta), can someone confirm this works in the >> final release? >> >> >> >> Tia! >> >> > >
Any hints on how to do frames in ASP.Net 2.0?
How to deselect item on single select listbox? Where in the viewstate is a GridView's rows? Remove Dynamic User Controls from a collection link on an entire row in a datagrid control exposing collection. DropDownList VS TextBox Gridview - Accessing a field value in current row Customizing a TreeNode's viewstate HTML editor for Safari browser |
|||||||||||||||||||||||