Design Time Rendering User Control?

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default Design Time Rendering User Control?

    I've created a user control (not a custom control) consisting of a table
    with a single row containing three cells, each cell containing a button.
    Following is the code for this user control.

    <%@ Control Language="C#" AutoEventWireup="true"
    CodeFile="NewEditDeleteButtons.ascx.cs"
    Inherits="UserControls_NewEditDeleteButtons" %>
    <%@ Register TagPrefix="ctrl" Namespace="IDWeb.Web.Control"
    Assembly="IDWeb.Web" %>
    <asp:Table ID="AEDBTable" runat="server">
    <asp:TableRow runat="server">
    <asp:TableCell ID="TableCell26" runat="server" CssClass="data">
    <ctrl:Button ID="btnNew" runat="server" Text="+"
    OnClick="btnNew_Click"/>
    </asp:TableCell>
    <asp:TableCell ID="TableCell1" runat="server" CssClass="data">
    <ctrl:Button ID="btnEdit" runat="server" Text="e"
    OnClick="btnEdit_Click"/>
    </asp:TableCell>
    <asp:TableCell ID="TableCell27" runat="server" CssClass="data">
    <ctrl:Button ID="btnDelete" runat="server" Text="X"
    OnClick="btnDelete_Click"/>
    </asp:TableCell>
    </asp:TableRow>
    </asp:Table>

    This user control works fine at runtime and renders as expected. In design
    view however the page containing the NewEditDeleteButtons tag doesn't show
    anything for this control. Is there a way I can get it to render in the
    designer?

    TIA,
    Bill Cohagan


    Bill Cohagan Guest

  2. Similar Questions and Discussions

    1. Rendering Custom Control during design time
      Hi, I have been creating simple custom controls that is able to be added to the Visual Studio toolbox and drag & drop to my aspx pages. The main...
    2. Rendering DataGrid in a custom control at design time
      I have built custom controls that inherit from the HtmlTable control so that they will render properly at design time. I am using a designer, since...
    3. Design Time Rendering Within Tables
      Hello, I'm attempting to build a composite control which for purposes of layout renders its content as an HTML table row (<tr>). At runtime, it...
    4. Design-time rendering of User Control
      Like many others, I would like to replace the default "grey button" display of my user control with something that more closely (better yet exactly)...
    5. User Control and VS design time issues
      I have a User Control with a Code behind class. If the Code behind class inherits from UserControl class there are no problems within VS 2003, I...
  3. #2

    Default Re: Design Time Rendering User Control?

    Bill Cohagan wrote:
    > I've created a user control (not a custom control) consisting of a
    > table with a single row containing three cells, each cell containing
    > a button. Following is the code for this user control.
    >
    > <%@ Control Language="C#" AutoEventWireup="true"
    > CodeFile="NewEditDeleteButtons.ascx.cs"
    > Inherits="UserControls_NewEditDeleteButtons" %>
    > <%@ Register TagPrefix="ctrl" Namespace="IDWeb.Web.Control"
    > Assembly="IDWeb.Web" %>
    > <asp:Table ID="AEDBTable" runat="server">
    > <asp:TableRow runat="server">
    > <asp:TableCell ID="TableCell26" runat="server" CssClass="data">
    > <ctrl:Button ID="btnNew" runat="server" Text="+"
    > OnClick="btnNew_Click"/>
    > </asp:TableCell>
    > <asp:TableCell ID="TableCell1" runat="server" CssClass="data">
    > <ctrl:Button ID="btnEdit" runat="server" Text="e"
    > OnClick="btnEdit_Click"/>
    > </asp:TableCell>
    > <asp:TableCell ID="TableCell27" runat="server" CssClass="data">
    > <ctrl:Button ID="btnDelete" runat="server" Text="X"
    > OnClick="btnDelete_Click"/>
    > </asp:TableCell>
    > </asp:TableRow>
    > </asp:Table>
    >
    > This user control works fine at runtime and renders as expected. In
    > design view however the page containing the NewEditDeleteButtons tag
    > doesn't show anything for this control. Is there a way I can get it
    > to render in the designer?
    >
    > TIA,
    > Bill Cohagan
    I'm suspecting the custom button controls that you're using.

    Try replacing the custom buttons with standard buttons, and see if that
    helps.

    --

    Riki


    Riki Guest

  4. #3

    Default Re: Design Time Rendering User Control?

    Riki
    Thank, but I already tried that. Should have mentioned that in my
    posting. FWIW, the custom button (at this point) is trivial anyway:

    namespace IDWeb.Web.Control
    {
    public class Button : System.Web.UI.WebControls.Button
    {
    public Button()
    {
    }
    }
    }

    "Riki" <riki@dontnagme.com> wrote in message
    news:%23byJC1XrGHA.4236@TK2MSFTNGP04.phx.gbl...
    > Bill Cohagan wrote:
    >> I've created a user control (not a custom control) consisting of a
    >> table with a single row containing three cells, each cell containing
    >> a button. Following is the code for this user control.
    >>
    >> <%@ Control Language="C#" AutoEventWireup="true"
    >> CodeFile="NewEditDeleteButtons.ascx.cs"
    >> Inherits="UserControls_NewEditDeleteButtons" %>
    >> <%@ Register TagPrefix="ctrl" Namespace="IDWeb.Web.Control"
    >> Assembly="IDWeb.Web" %>
    >> <asp:Table ID="AEDBTable" runat="server">
    >> <asp:TableRow runat="server">
    >> <asp:TableCell ID="TableCell26" runat="server" CssClass="data">
    >> <ctrl:Button ID="btnNew" runat="server" Text="+"
    >> OnClick="btnNew_Click"/>
    >> </asp:TableCell>
    >> <asp:TableCell ID="TableCell1" runat="server" CssClass="data">
    >> <ctrl:Button ID="btnEdit" runat="server" Text="e"
    >> OnClick="btnEdit_Click"/>
    >> </asp:TableCell>
    >> <asp:TableCell ID="TableCell27" runat="server" CssClass="data">
    >> <ctrl:Button ID="btnDelete" runat="server" Text="X"
    >> OnClick="btnDelete_Click"/>
    >> </asp:TableCell>
    >> </asp:TableRow>
    >> </asp:Table>
    >>
    >> This user control works fine at runtime and renders as expected. In
    >> design view however the page containing the NewEditDeleteButtons tag
    >> doesn't show anything for this control. Is there a way I can get it
    >> to render in the designer?
    >>
    >> TIA,
    >> Bill Cohagan
    >
    > I'm suspecting the custom button controls that you're using.
    >
    > Try replacing the custom buttons with standard buttons, and see if that
    > helps.
    >
    > --
    >
    > Riki
    >

    Bill Cohagan Guest

  5. #4

    Default Re: Design Time Rendering User Control?

    Hi Bill,

    Thank you for your post.

    Depending on which ASP.NET version you are using, the answer to your
    question varies:

    1) If you are using ASP.NET 1.1, the UserControl's design-time rendering is
    very limited and the behavior you're experiencing is expected.

    2) If you are using ASP.NET 2.0, the UserControl's design-time rendering
    should reflect the controls it's using. However, if the custom control
    (IDWeb.Web.Control.Button) is placed under the website's App_Code folder,
    due to ASP.NET 2.0 compilation model, it will show the custom control on
    UserControl successfully, but will not show correctly if the UserControl is
    used in WebForm or another UserControl again. You need to place the custom
    control in a separate Class Library to get correct design-time rendering.

    Hope this helps. Please feel free to post here if anything is unclear.

    Regards,
    Walter Wang (wawang@online.microsoft.com, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Walter Wang [MSFT] Guest

  6. #5

    Default Re: Design Time Rendering User Control?

    Walter
    Thanks for the suggestions; however the button custom control is already
    in a dll. I'm using ASP.Net 2.0. Following is the code for the user control
    as well:

    <%@ Control Language="C#" AutoEventWireup="true"
    CodeFile="NewEditDeleteButtons.ascx.cs"
    Inherits="UserControls_NewEditDeleteButtons" %>
    <%@ Register TagPrefix="ctrl" Namespace="IDWeb.Web.Control"
    Assembly="IDWeb.Web" %>
    <asp:Table ID="AEDBTable" runat="server">
    <asp:TableRow runat="server">
    <asp:TableCell ID="TableCell26" runat="server" CssClass="data">
    <ctrl:Button ID="btnNew" runat="server" Text="+"
    OnClick="btnNew_Click"/>
    </asp:TableCell>
    <asp:TableCell ID="TableCell1" runat="server" CssClass="data">
    <ctrl:Button ID="btnEdit" runat="server" Text="e"
    OnClick="btnEdit_Click"/>
    </asp:TableCell>
    <asp:TableCell ID="TableCell27" runat="server" CssClass="data">
    <ctrl:Button ID="btnDelete" runat="server" Text="X"
    OnClick="btnDelete_Click"/>
    </asp:TableCell>
    </asp:TableRow>
    </asp:Table>

    Note the Register element referencing the IDWeb.Web assembly. If I
    understand your response correctly, you're saying this should work as-is,
    right?

    Regards,
    Bill

    "Walter Wang [MSFT]" <wawang@online.microsoft.com> wrote in message
    news:YUrmdNxrGHA.2028@TK2MSFTNGXA01.phx.gbl...
    > Hi Bill,
    >
    > Thank you for your post.
    >
    > Depending on which ASP.NET version you are using, the answer to your
    > question varies:
    >
    > 1) If you are using ASP.NET 1.1, the UserControl's design-time rendering
    > is
    > very limited and the behavior you're experiencing is expected.
    >
    > 2) If you are using ASP.NET 2.0, the UserControl's design-time rendering
    > should reflect the controls it's using. However, if the custom control
    > (IDWeb.Web.Control.Button) is placed under the website's App_Code folder,
    > due to ASP.NET 2.0 compilation model, it will show the custom control on
    > UserControl successfully, but will not show correctly if the UserControl
    > is
    > used in WebForm or another UserControl again. You need to place the custom
    > control in a separate Class Library to get correct design-time rendering.
    >
    > Hope this helps. Please feel free to post here if anything is unclear.
    >
    > Regards,
    > Walter Wang (wawang@online.microsoft.com, remove 'online.')
    > Microsoft Online Community Support
    >
    > ==================================================
    > When responding to posts, please "Reply to Group" via your newsreader so
    > that others may learn and benefit from your issue.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >

    Bill Cohagan Guest

  7. #6

    Default Re: Design Time Rendering User Control?

    Sorry for the typo in previous reply, should be "inherits from WebControl".

    Regards,
    Walter Wang (wawang@online.microsoft.com, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Walter Wang [MSFT] Guest

  8. #7

    Default Re: Design Time Rendering User Control?

    Walter
    Thanks for the suggestions; however your solution suggests that I should
    *not* be having this problem since my custom controls are *not* placed in
    App_Code. In any case, for test purposes, I changes my code to use
    asp:Button rather than the custom control ctrl:Button and the problem is
    still there; i.e., the web control does NOT render at all in designer.

    Any other ideas?

    Thanks again,
    Bill

    "Walter Wang [MSFT]" <wawang@online.microsoft.com> wrote in message
    news:1uBBLBGsGHA.2004@TK2MSFTNGXA01.phx.gbl...
    > Hi Bill,
    >
    > Thank you for your update.
    >
    > A custom control needs a designer to render design-time html, here's a
    > very
    > simple designer for a control directly inherits from WebConfig:
    >
    > public class Class2Designer : ControlDesigner
    > {
    > public override string GetDesignTimeHtml()
    > {
    > return "<input type='button' value='[property]' />";
    > }
    > }
    >
    > I've done some more test, only Custom Controls that inherits from existing
    > control and placed in App_Code will not render correctly when first used
    > in
    > UserControl then the UserControl isused in WebForm.
    >
    > I'll attach the solution with two projects here. If you having problem
    > downloading it, please send mail to me.
    >
    > Hope this helps. Please feel free to post here if anything is unclear.
    >
    >
    > Regards,
    > Walter Wang (wawang@online.microsoft.com, remove 'online.')
    > Microsoft Online Community Support
    >
    > ==================================================
    > When responding to posts, please "Reply to Group" via your newsreader so
    > that others may learn and benefit from your issue.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.

    Bill Cohagan Guest

  9. #8

    Default Re: Design Time Rendering User Control?

    Hi Bill,

    Thank you for your update.

    Have you tried my sample project in my second post in this thread? You may
    have to use Outlook Express to download the attachment. If you have
    difficulty to download the attachment, email me and I will send the project
    to you.

    We're actually handling two questions here:
    1) Design-time rendering of custom control

    You can find more information here:

    #Adding Design-Time Support to ASP.NET Controls
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html[/url]
    /ASPNet-AddDesignTimeSupport.asp

    Normally, when you inherit from a control that is already associated with a
    control designer, you don't have to create a designer.

    If you're building a control from scratch or building a composite control,
    you may have to create a control designer and associate it with the control.

    2) Design-time rendering of user control

    Before Visual Studio 2005, the design-time rendering of user control is
    very limited. However, in Visual Studio 2005, it should render correctly.
    Please test the sample project and tell me the result, thanks!

    Or you can send me your project which can reproduce the issue so that we
    can check whether or not this is environment specific.

    Regards,
    Walter Wang (wawang@online.microsoft.com, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Walter Wang [MSFT] Guest

  10. #9

    Default Re: Design Time Rendering User Control?

    Walter
    I will try your sample project and report back.

    Thanks,
    Bill

    "Walter Wang [MSFT]" <wawang@online.microsoft.com> wrote in message
    news:$njhCGfsGHA.2504@TK2MSFTNGXA01.phx.gbl...
    > Hi Bill,
    >
    > Thank you for your update.
    >
    > Have you tried my sample project in my second post in this thread? You may
    > have to use Outlook Express to download the attachment. If you have
    > difficulty to download the attachment, email me and I will send the
    > project
    > to you.
    >
    > We're actually handling two questions here:
    > 1) Design-time rendering of custom control
    >
    > You can find more information here:
    >
    > #Adding Design-Time Support to ASP.NET Controls
    > [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html[/url]
    > /ASPNet-AddDesignTimeSupport.asp
    >
    > Normally, when you inherit from a control that is already associated with
    > a
    > control designer, you don't have to create a designer.
    >
    > If you're building a control from scratch or building a composite control,
    > you may have to create a control designer and associate it with the
    > control.
    >
    > 2) Design-time rendering of user control
    >
    > Before Visual Studio 2005, the design-time rendering of user control is
    > very limited. However, in Visual Studio 2005, it should render correctly.
    > Please test the sample project and tell me the result, thanks!
    >
    > Or you can send me your project which can reproduce the issue so that we
    > can check whether or not this is environment specific.
    >
    > Regards,
    > Walter Wang (wawang@online.microsoft.com, remove 'online.')
    > Microsoft Online Community Support
    >
    > ==================================================
    > When responding to posts, please "Reply to Group" via your newsreader so
    > that others may learn and benefit from your issue.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >

    Bill Cohagan Guest

  11. #10

    Default Re: Design Time Rendering User Control?

    Walter
    Please examine my code again. Your screenshot shows that the control does
    NOT render when it is inside a table cell. See the small empty box below
    the row containing the 3 buttons? The instance that DOES render is the one
    before the one in the table cell.

    Regards,
    Bill

    "Walter Wang [MSFT]" <wawang@online.microsoft.com> wrote in message
    news:dcb6j$gtGHA.2500@TK2MSFTNGXA01.phx.gbl...
    > Hi Bill,
    >
    > I downloaded the modified project and extracted it locally. Then I rebuild
    > the solution, and open the Default.aspx, and it still shows correctly (the
    > control located in App_Code still doesn't render correctly). Please see
    > the
    > attached screenshot.
    >
    > You may try to do a full rebuilding of the solution or try to refresh the
    > WebForm.
    >
    > Regards,
    > Walter Wang (wawang@online.microsoft.com, remove 'online.')
    > Microsoft Online Community Support
    >
    > ==================================================
    > When responding to posts, please "Reply to Group" via your newsreader so
    > that others may learn and benefit from your issue.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.

    Bill Cohagan Guest

  12. #11

    Default Re: Design Time Rendering User Control?

    Hi Bill,

    Thanks. I overlooked that table cell.

    I'm now able to reproduce the issue you described. Creating a very simple
    UserControl with an <asp:Button> and use this UserControl inside
    <asp:Table><asp:TableRow><asp:TableCell> will not render the UserControl
    correctly.

    I'm currently searching in internal database and will consult with product
    team on this. In the meanwhile, you can submit your feedback here:

    [url]http://connect.microsoft.com/site/sitehome.aspx?SiteID=210[/url]

    Thanks for your help!

    Regards,
    Walter Wang (wawang@online.microsoft.com, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Walter Wang [MSFT] Guest

  13. #12

    Default Re: Design Time Rendering User Control?

    Walter
    Thanks. Please let me know what you find out. I'd appreciate it if you
    would email me directly (using the email provided with my alias
    registration). I have submitted feedback as you suggested, referencing this
    newsgroup thread for details.

    Bill

    "Walter Wang [MSFT]" <wawang@online.microsoft.com> wrote in message
    news:4hP5fustGHA.760@TK2MSFTNGXA01.phx.gbl...
    > Hi Bill,
    >
    > Thanks. I overlooked that table cell.
    >
    > I'm now able to reproduce the issue you described. Creating a very simple
    > UserControl with an <asp:Button> and use this UserControl inside
    > <asp:Table><asp:TableRow><asp:TableCell> will not render the UserControl
    > correctly.
    >
    > I'm currently searching in internal database and will consult with product
    > team on this. In the meanwhile, you can submit your feedback here:
    >
    > [url]http://connect.microsoft.com/site/sitehome.aspx?SiteID=210[/url]
    >
    > Thanks for your help!
    >
    > Regards,
    > Walter Wang (wawang@online.microsoft.com, remove 'online.')
    > Microsoft Online Community Support
    >
    > ==================================================
    > When responding to posts, please "Reply to Group" via your newsreader so
    > that others may learn and benefit from your issue.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >

    Bill Cohagan Guest

  14. #13

    Default Re: Design Time Rendering User Control?

    Hi Bill,

    I've consulted our product team on this issue.

    The cause of this issue is that child controls use their runtime rendering
    in the designer since they don't even have designers created. Only
    top-level controls have designers and thus have specialized design-time
    rendering.

    For now, do you think following workaround will work for you?

    <table runat="server" id="test2">
    <tr runat="server" id="row2">
    <td id="cell2" runat="server">
    <uc:NewEditDeleteButtons ID="NewEditDeleteButtons2"
    runat="server" />
    </td>
    </tr>
    </table>

    Use this notation, you can still have access to the table/row/cell in
    server-side code.

    Thank you for your feedback, it will certainly help us to make our products
    better!


    Regards,
    Walter Wang (wawang@online.microsoft.com, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Walter Wang [MSFT] Guest

  15. #14

    Default Re: Design Time Rendering User Control?

    Walter
    Thanks for looking into this. I'm afraid however that I don't understand
    the explanation provided. It seems from what you say that the child controls
    (buttons in my case) should use their runtime rendering in the designer.
    Obviously that's not happening. As for the "workaround", I believe that's
    exactly the code I'm already using and server side access to the control
    hasn't been a problem. The problem is that it is difficult to layout a web
    form using many of these user controls when they don't appear in the
    designer.

    Does the product team consider this a defect; i.e., something that will be
    fixed in the future? Your response doesn't seem to address this at all. In
    any case, thanks again for following up.

    Regards,
    Bill

    "Walter Wang [MSFT]" <wawang@online.microsoft.com> wrote in message
    news:xg5ugl4tGHA.760@TK2MSFTNGXA01.phx.gbl...
    > Hi Bill,
    >
    > I've consulted our product team on this issue.
    >
    > The cause of this issue is that child controls use their runtime rendering
    > in the designer since they don't even have designers created. Only
    > top-level controls have designers and thus have specialized design-time
    > rendering.
    >
    > For now, do you think following workaround will work for you?
    >
    > <table runat="server" id="test2">
    > <tr runat="server" id="row2">
    > <td id="cell2" runat="server">
    > <uc:NewEditDeleteButtons ID="NewEditDeleteButtons2"
    > runat="server" />
    > </td>
    > </tr>
    > </table>
    >
    > Use this notation, you can still have access to the table/row/cell in
    > server-side code.
    >
    > Thank you for your feedback, it will certainly help us to make our
    > products
    > better!
    >
    >
    > Regards,
    > Walter Wang (wawang@online.microsoft.com, remove 'online.')
    > Microsoft Online Community Support
    >
    > ==================================================
    > When responding to posts, please "Reply to Group" via your newsreader so
    > that others may learn and benefit from your issue.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >

    Bill Cohagan Guest

  16. #15

    Default Re: Design Time Rendering User Control?

    Hi Bill,

    Thank you for your quick reply.

    I'll do further researching on this issue and will get back to you as soon
    as possible. Thank you for for patience and understanding.

    In my test, the workaround using <table>, <td> rather than <asp:table>,
    <asp:TableCell> correctly renders the UserControl at design-time. Do you
    mean that this workaround didn't render the UserControl either?



    Regards,
    Walter Wang (wawang@online.microsoft.com, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Walter Wang [MSFT] Guest

  17. #16

    Default Re: Design Time Rendering User Control?

    Walter
    Sorry, I misunderstood your workaround, not noticing the change from
    asp:table to table. I'll give that a try and let you know.

    Bill
    "Walter Wang [MSFT]" <wawang@online.microsoft.com> wrote in message
    news:Zd$l35cuGHA.760@TK2MSFTNGXA01.phx.gbl...
    > Hi Bill,
    >
    > Thank you for your quick reply.
    >
    > I'll do further researching on this issue and will get back to you as soon
    > as possible. Thank you for for patience and understanding.
    >
    > In my test, the workaround using <table>, <td> rather than <asp:table>,
    > <asp:TableCell> correctly renders the UserControl at design-time. Do you
    > mean that this workaround didn't render the UserControl either?
    >
    >
    >
    > Regards,
    > Walter Wang (wawang@online.microsoft.com, remove 'online.')
    > Microsoft Online Community Support
    >
    > ==================================================
    > When responding to posts, please "Reply to Group" via your newsreader so
    > that others may learn and benefit from your issue.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >

    Bill Cohagan Guest

  18. #17

    Default Re: Design Time Rendering User Control?

    Walter
    I've now tried the workaround. Unfortunately it doesn't work for me
    because the use control itself is being placed within an asp:Tablecell
    element on the page where I'm using it. So simply using the table element
    rather than the asp:table element within the control definition is not
    sufficient in my case. Modifying the code that *uses* the user control is
    not a feasible solution since I have little or no control over that code.

    Please let me know what else you find out about this problem.

    Thanks,
    Bill

    "Walter Wang [MSFT]" <wawang@online.microsoft.com> wrote in message
    news:Zd$l35cuGHA.760@TK2MSFTNGXA01.phx.gbl...
    > Hi Bill,
    >
    > Thank you for your quick reply.
    >
    > I'll do further researching on this issue and will get back to you as soon
    > as possible. Thank you for for patience and understanding.
    >
    > In my test, the workaround using <table>, <td> rather than <asp:table>,
    > <asp:TableCell> correctly renders the UserControl at design-time. Do you
    > mean that this workaround didn't render the UserControl either?
    >
    >
    >
    > Regards,
    > Walter Wang (wawang@online.microsoft.com, remove 'online.')
    > Microsoft Online Community Support
    >
    > ==================================================
    > When responding to posts, please "Reply to Group" via your newsreader so
    > that others may learn and benefit from your issue.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >

    Bill Cohagan Guest

  19. #18

    Default Re: Design Time Rendering User Control?

    Hi Bill,

    I've consulted with product team and confirmed this is a limitation of
    Visual Studio 2005. For those who are monitoring this thread, here's the
    summary of this issue:


    Symptom
    =======
    UserControl will not render correctly at design time if it's used inside
    <asp:TableCell> tag.

    Reproduce Steps
    ===============
    1) Create a UserControl, add a <asp:Button>
    2) Use it on a WebForm inside <asp:TableCell> tag:

    <asp:Table ID="table1" runat="server">
    <asp:TableRow ID="row1" runat="server">
    <asp:TableCell ID="cell1" runat="server">
    <uc1:WebUserControl ID="WebUserControl2" runat="server" />
    </asp:TableCell>
    </asp:TableRow>
    </asp:Table>

    3) Switch to design time of the WebForm, the UserControl is not rendered
    correctly.


    Sorry for the inconvenience of this issue. Bill, thank you for your
    feedback. I believe this will help us to make our products much better.



    Regards,
    Walter Wang (wawang@online.microsoft.com, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Walter Wang [MSFT] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139