Home All Groups Group Topic Archive Search About

Usercontrol - Problem in Designer

Author
28 Nov 2005 2:07 PM
Gellert
Hello,

I made an UserControl, when I drag and drop it into my webform i see the
following:
[MatrixQuestion "MatrixQuestion"] on my designer.

If I switch to the HTML Source I see this:
<cc1:MatrixQuestion ID="MatrixQuestion1" runat="server">
    </cc1:MatrixQuestion>

so... when I change an attribute of my control then the designer shows
me the Control like I see it on my webpage. So I do not see
[MatrixQuestion "MatrixQuestion"] but I see the Control well designed.

The problem is, when I switch to the source again there are a lot of
entries between my control entry:
------
<cc1:MatrixQuestion ID="MatrixQuestion1" runat="server"
NumberOfRadio="5">
        <asp:Label runat="server" Width="200px">Frage?</asp:Label>
        &nbsp &nbsp &nbsp<asp:Label runat="server">leicht</asp:Label>
        &nbsp &nbsp &nbsp<asp:RadioButton ID="1" runat="server"
AutoPostBack="True" GroupName="mygroup" />
        <asp:RadioButton ID="2" runat="server" AutoPostBack="True"
GroupName="mygroup" />
        <asp:RadioButton ID="3" runat="server" AutoPostBack="True"
GroupName="mygroup" />
        <asp:RadioButton ID="4" runat="server" AutoPostBack="True"
GroupName="mygroup" />
        &nbsp &nbsp &nbsp<asp:Label runat="server">schwer</asp:Label>
    </cc1:MatrixQuestion>
------------


Why is that? Why does my Designer create the code again? I see my User
Control twice on my page now.
Or better asked: How can I avoid that my Designer creates the whole
HTML-tags for my control.


Thanks.
Gellert






--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Author
30 Nov 2005 7:44 PM
Pipo
Can you post the designer code?

Show quoteHide quote
"Gellert" <radi***@gmx.at> schreef in bericht
news:eGbUEUC9FHA.1140@tk2msftngp13.phx.gbl...
> Hello,
>
> I made an UserControl, when I drag and drop it into my webform i see the
> following:
> [MatrixQuestion "MatrixQuestion"] on my designer.
>
> If I switch to the HTML Source I see this:
> <cc1:MatrixQuestion ID="MatrixQuestion1" runat="server">
>    </cc1:MatrixQuestion>
>
> so... when I change an attribute of my control then the designer shows
> me the Control like I see it on my webpage. So I do not see
> [MatrixQuestion "MatrixQuestion"] but I see the Control well designed.
>
> The problem is, when I switch to the source again there are a lot of
> entries between my control entry:
> ------
> <cc1:MatrixQuestion ID="MatrixQuestion1" runat="server"
> NumberOfRadio="5">
>        <asp:Label runat="server" Width="200px">Frage?</asp:Label>
>        &nbsp &nbsp &nbsp<asp:Label runat="server">leicht</asp:Label>
>        &nbsp &nbsp &nbsp<asp:RadioButton ID="1" runat="server"
> AutoPostBack="True" GroupName="mygroup" />
>        <asp:RadioButton ID="2" runat="server" AutoPostBack="True"
> GroupName="mygroup" />
>        <asp:RadioButton ID="3" runat="server" AutoPostBack="True"
> GroupName="mygroup" />
>        <asp:RadioButton ID="4" runat="server" AutoPostBack="True"
> GroupName="mygroup" />
>        &nbsp &nbsp &nbsp<asp:Label runat="server">schwer</asp:Label>
>    </cc1:MatrixQuestion>
> ------------
>
>
> Why is that? Why does my Designer create the code again? I see my User
> Control twice on my page now.
> Or better asked: How can I avoid that my Designer creates the whole
> HTML-tags for my control.
>
>
> Thanks.
> Gellert
>
>
>
>
>
>
> --
> Sent via .NET Newsgroups
> http://www.dotnetnewsgroups.com