Usercontrol - Problem in Designer

Discussion in 'ASP .Net Web Controls' started by Gellert, Nov 28, 2005.

  1. Gellert

    Gellert Guest

    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
     
    Gellert, Nov 28, 2005
    #1
    1. Advertising

  2. Gellert

    Pipo Guest

    Can you post the designer code?

    "Gellert" <> schreef in bericht
    news:...
    > 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
     
    Pipo, Nov 30, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. S Guiboud
    Replies:
    1
    Views:
    410
    Ross Dempster
    Jul 18, 2003
  2. Steve B.
    Replies:
    4
    Views:
    973
    Cheryl D Wise
    Jun 1, 2007
  3. Alexander Higgins
    Replies:
    3
    Views:
    1,084
    Teemu Keiski
    Jul 30, 2007
  4. Mark van Bree

    Postback problem with usercontrol in usercontrol

    Mark van Bree, May 30, 2006, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    165
  5. Alexander Higgins
    Replies:
    0
    Views:
    451
    Alexander Higgins
    Jul 21, 2007
Loading...

Share This Page