ascx render something in design time

Last post 06-26-2009 3:07 AM by XIII. 2 replies.

Sort Posts:

  • ascx render something in design time

    06-24-2009, 5:09 AM
    • Member
      2 point Member
    • hnj_judge
    • Member since 01-29-2009, 2:19 AM
    • Posts 27

    hi

    i have an ascx file that do something just in run time so there is nothing to display at design time

    is there any way to render something in design time just to know that i have this control in the page (for example render just "I am ascx") but sure i dont want this message to render in user browser


    thank you

  • Re: ascx render something in design time

    06-26-2009, 3:02 AM
    Answer

     

    Hi,

    If you do everything at code behind probably custom control is a better choice and it's design time behavior can be controlled by writing a custom designer. If you persist to use UserControl, in which case we cannot customize its designer, you can add a Label in ascx:

    <asp:Label ID="Label1" runat="server" Text="I am ascx"></asp:Label>

    And set its Visible to false in code behind.

    Sincerely,
    Allen Chen
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: ascx render something in design time

    06-26-2009, 3:07 AM
    Answer
    • All-Star
      124,039 point All-Star
    • XIII
    • Member since 06-30-2002, 11:59 PM
    • Essen, Belgium
    • Posts 13,706
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    In case you want to go for the custom control solution I advice to take a look at these documentations:

    Control designers and Developing custom controls.

    Grz, Kris.

Page 1 of 1 (3 items)