G
Gabriel Enea
Hello,
I'm trying to develop my TabStrip web control but seems there is some
troubles in the desing mode.
Initially, I have defined a collection of TabButton in the TabStrip web
control. The TabButton inherits the functionality of the
System.Web.UI.WebControls.Button. In the Render method, for each tab I've
added the click javascript event as follows:
protected override void Render(HtmlTextWriter output)
{
....
but.Attributes.Add("onclick", "javascript: " +
Page.GetPostBackEventReference(this, "but" + i.ToString()));
....
But, after that I've a problem in the design mode when I try to add more
items (TabButton instance in the Items (TabButtonCollection) collection
because the VS adds automatically the 'click' attribute in the design mode:
<cc1:TabStrip id="TabStrip3" style="Z-INDEX: 103; LEFT: 152px; POSITION:
absolute; TOP: 352px" runat="server">
<cc1:TabButton Text="tabButton1" onclick="javascript:
__doPostBack('TabStrip3','but0')"></cc1:TabButton>
<cc1:TabButton Text="tabButton2" onclick="javascript:
__doPostBack('TabStrip3','but1')"></cc1:TabButton>
<cc1:TabButton Text="tabButton3" onclick="javascript:
__doPostBack('TabStrip3','but2')"></cc1:TabButton>
</cc1:TabStrip>
which should like:
<cc1:TabStrip id="TabStrip3" style="Z-INDEX: 103; LEFT: 152px; POSITION:
absolute; TOP: 352px" runat="server">
<cc1:TabButton Text="tabButton1"></cc1:TabButton>
<cc1:TabButton Text="tabButton2"></cc1:TabButton>
<cc1:TabButton Text="tabButton3"></cc1:TabButton>
</cc1:TabStrip>
Please, tell me if there is a way to know in the control if I am in the
design mode or at runtime. Note that the control renders correctly at the
runtime.
Best regards,
Gabriel.
I'm trying to develop my TabStrip web control but seems there is some
troubles in the desing mode.
Initially, I have defined a collection of TabButton in the TabStrip web
control. The TabButton inherits the functionality of the
System.Web.UI.WebControls.Button. In the Render method, for each tab I've
added the click javascript event as follows:
protected override void Render(HtmlTextWriter output)
{
....
but.Attributes.Add("onclick", "javascript: " +
Page.GetPostBackEventReference(this, "but" + i.ToString()));
....
But, after that I've a problem in the design mode when I try to add more
items (TabButton instance in the Items (TabButtonCollection) collection
because the VS adds automatically the 'click' attribute in the design mode:
<cc1:TabStrip id="TabStrip3" style="Z-INDEX: 103; LEFT: 152px; POSITION:
absolute; TOP: 352px" runat="server">
<cc1:TabButton Text="tabButton1" onclick="javascript:
__doPostBack('TabStrip3','but0')"></cc1:TabButton>
<cc1:TabButton Text="tabButton2" onclick="javascript:
__doPostBack('TabStrip3','but1')"></cc1:TabButton>
<cc1:TabButton Text="tabButton3" onclick="javascript:
__doPostBack('TabStrip3','but2')"></cc1:TabButton>
</cc1:TabStrip>
which should like:
<cc1:TabStrip id="TabStrip3" style="Z-INDEX: 103; LEFT: 152px; POSITION:
absolute; TOP: 352px" runat="server">
<cc1:TabButton Text="tabButton1"></cc1:TabButton>
<cc1:TabButton Text="tabButton2"></cc1:TabButton>
<cc1:TabButton Text="tabButton3"></cc1:TabButton>
</cc1:TabStrip>
Please, tell me if there is a way to know in the control if I am in the
design mode or at runtime. Note that the control renders correctly at the
runtime.
Best regards,
Gabriel.