Do not want designer properties to be rendered to html until runtime

Discussion in 'ASP .Net Web Controls' started by Ron Vecchi, Nov 25, 2003.

  1. Ron Vecchi

    Ron Vecchi Guest

    I am working on a webcontrol and ran into a little problem.

    How can I not have a property, which is set in the designer not render
    itself to the html view but only render itself at runtime.?


    thanks
    --
    Ron Vecchi
     
    Ron Vecchi, Nov 25, 2003
    #1
    1. Advertising

  2. Take a look at:

    Site.DesignMode

    This property tells you if you're in design mode or not...add your
    appropriate logic around it.

    Note, that when running outside of the IDE It returns 'null' rather than
    'false', like it should.

    "Ron Vecchi" <> wrote in message
    news:%...

    > I am working on a webcontrol and ran into a little problem.
    >
    > How can I not have a property, which is set in the designer not render
    > itself to the html view but only render itself at runtime.?
    >
    >
    > thanks
    > --
    > Ron Vecchi
    >
    >
    >
     
    Alan Corbett \(.NET MVP\), Nov 26, 2003
    #2
    1. Advertising

  3. Ron Vecchi

    MSFT Guest

    MSFT, Nov 26, 2003
    #3
  4. Ron Vecchi

    Ron Vecchi Guest

    Hello Alan,

    I'm not exactly sure where to implement this.
    I tried the get accessor of the actual property but this was obviousy wrong.
    After setting the value in the properties window the new value was
    immediatly discarded.

    Is their a method which can be overridin that directly handles writing the
    content to the html view.
    It seems that if there is I should be able to implement the "Site" in that
    method?

    -
    To give more insight of my problem.
    I have a property which will tell the webpage where to redirect to when it
    loads.
    The proplem is that the designer tries to open this page once the property
    is set.

    Thanks




    "Alan Corbett (.NET MVP)" <> wrote in message
    news:...
    > Take a look at:
    >
    > Site.DesignMode
    >
    > This property tells you if you're in design mode or not...add your
    > appropriate logic around it.
    >
    > Note, that when running outside of the IDE It returns 'null' rather than
    > 'false', like it should.
    >
    > "Ron Vecchi" <> wrote in message
    > news:%...
    >
    > > I am working on a webcontrol and ran into a little problem.
    > >
    > > How can I not have a property, which is set in the designer not render
    > > itself to the html view but only render itself at runtime.?
    > >
    > >
    > > thanks
    > > --
    > > Ron Vecchi
    > >
    > >
    > >

    >
    >
     
    Ron Vecchi, Nov 26, 2003
    #4
  5. What Webcontrol are you using?

    You could try disabling the webcontrol in the server-side and enabling it in
    the client-side.

    You could add a hidden field to the page, and on the client-side move the
    value from the hidden field to the webcontrol....

    I'm not exactly sure what you're after, here.

    "Ron Vecchi" <> wrote in message
    news:...
    > Hello Alan,
    >
    > I'm not exactly sure where to implement this.
    > I tried the get accessor of the actual property but this was obviousy

    wrong.
    > After setting the value in the properties window the new value was
    > immediatly discarded.
    >
    > Is their a method which can be overridin that directly handles writing the
    > content to the html view.
    > It seems that if there is I should be able to implement the "Site" in that
    > method?
    >
    > -
    > To give more insight of my problem.
    > I have a property which will tell the webpage where to redirect to when it
    > loads.
    > The proplem is that the designer tries to open this page once the property
    > is set.
    >
    > Thanks
    >
    >
    >
    >
    > "Alan Corbett (.NET MVP)" <> wrote in message
    > news:...
    > > Take a look at:
    > >
    > > Site.DesignMode
    > >
    > > This property tells you if you're in design mode or not...add your
    > > appropriate logic around it.
    > >
    > > Note, that when running outside of the IDE It returns 'null' rather than
    > > 'false', like it should.
    > >
    > > "Ron Vecchi" <> wrote in message
    > > news:%...
    > >
    > > > I am working on a webcontrol and ran into a little problem.
    > > >
    > > > How can I not have a property, which is set in the designer not render
    > > > itself to the html view but only render itself at runtime.?
    > > >
    > > >
    > > > thanks
    > > > --
    > > > Ron Vecchi
    > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Alan Corbett \(.NET MVP\), Nov 26, 2003
    #5
  6. Sorry, let me offer more information.

    I am creating a custom control inheriting from System.Web.UI.Control.
    The control is a wrapper for embedding a flash movie in a web page.

    There is a property called OutputMethod that is an enumeration
    [possible values]
    ClientScriptVersionDetection, //This value will tell the control to
    output the client script to perform a plugin version detection(Mimics exacty
    what Macromedia outputs from publish)
    SWF_VersionDetection, //This value is added to handle MX2004's version
    detection inwhich an SWF movie actully performs the detection and rediects
    to a good or bad page.
    FlashOnly only outputs the Object and Embed tags for the flash movie.


    There is also a property called MovieName which is a virtual path to the
    flash movie.

    There are also two properties (AlternateContentUrl) and (GoodContentUrl).


    --------------------------------------------------------------------------
    My Problem is with setting the OutputMethod to SWF_VersionDetection
    --------------------------------------------------------------------------
    (SWF_VersionDection is implemented in Flash MX2004 and actually uses a SWF
    file to redirect to a good or bad url depending on if the plugin was found.
    If the plugin is NOT found the SWF redirects to the AlternateContentUrl else
    it wil redirect to the GoodContentUrl.)


    When the control is rendered using the SWF_VersionDetection OutputMethod the
    AlternateContentUrl and GoodContentUrl are passed as a querystring to the
    flash movie: Example below:

    <Param name="movie"
    value="FlashMovieName.swf?AlternateContentUrl=MyAltValue&GoodContentUrl=MyGo
    odContentVal">

    The proplem is that when I set the MovieName to the Redirecting Flash.swf
    file and then set the OutputMethod to SWF_VersionDetection and then Specify
    the GoodContentUrl the flash movie is tring to open the GodContentUrl in a
    seperate IE window.

    Soit seems that If I can hide the values of the two Urls from the designers
    rendering of the content but still allowing the user to set them in the
    properties window.
    I should be in business ;)

    Thanks


    "Alan Corbett (.NET MVP)" <> wrote in message
    news:...
    > What Webcontrol are you using?
    >
    > You could try disabling the webcontrol in the server-side and enabling it

    in
    > the client-side.
    >
    > You could add a hidden field to the page, and on the client-side move the
    > value from the hidden field to the webcontrol....
    >
    > I'm not exactly sure what you're after, here.
    >
    > "Ron Vecchi" <> wrote in message
    > news:...
    > > Hello Alan,
    > >
    > > I'm not exactly sure where to implement this.
    > > I tried the get accessor of the actual property but this was obviousy

    > wrong.
    > > After setting the value in the properties window the new value was
    > > immediatly discarded.
    > >
    > > Is their a method which can be overridin that directly handles writing

    the
    > > content to the html view.
    > > It seems that if there is I should be able to implement the "Site" in

    that
    > > method?
    > >
    > > -
    > > To give more insight of my problem.
    > > I have a property which will tell the webpage where to redirect to when

    it
    > > loads.
    > > The proplem is that the designer tries to open this page once the

    property
    > > is set.
    > >
    > > Thanks
    > >
    > >
    > >
    > >
    > > "Alan Corbett (.NET MVP)" <> wrote in message
    > > news:...
    > > > Take a look at:
    > > >
    > > > Site.DesignMode
    > > >
    > > > This property tells you if you're in design mode or not...add your
    > > > appropriate logic around it.
    > > >
    > > > Note, that when running outside of the IDE It returns 'null' rather

    than
    > > > 'false', like it should.
    > > >
    > > > "Ron Vecchi" <> wrote in message
    > > > news:%...
    > > >
    > > > > I am working on a webcontrol and ran into a little problem.
    > > > >
    > > > > How can I not have a property, which is set in the designer not

    render
    > > > > itself to the html view but only render itself at runtime.?
    > > > >
    > > > >
    > > > > thanks
    > > > > --
    > > > > Ron Vecchi
    > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Joe Bob Briggs, Nov 26, 2003
    #6
  7. OK, let me see if I have this right:

    In the DESIGNER, when you set certain properties on thsi control, it's
    executing code based on the properties that is causing the designer to pop
    up a new IE window?

    In short, if you need to set these properties from within the properties
    window of the designer, but not have the designer do anything as a result of
    your setting this property, wrap a Site.DesignMode check around that code.

    If this doesn't get you what you're looking for, create different properties
    that the user cannot see, and put the real execution code in there, only
    setting their values at execution time from the properties the user CAN set.

    Make sense?






    "Joe Bob Briggs" <> wrote in message
    news:...
    > Sorry, let me offer more information.
    >
    > I am creating a custom control inheriting from System.Web.UI.Control.
    > The control is a wrapper for embedding a flash movie in a web page.
    >
    > There is a property called OutputMethod that is an enumeration
    > [possible values]
    > ClientScriptVersionDetection, //This value will tell the control to
    > output the client script to perform a plugin version detection(Mimics

    exacty
    > what Macromedia outputs from publish)
    > SWF_VersionDetection, //This value is added to handle MX2004's version
    > detection inwhich an SWF movie actully performs the detection and rediects
    > to a good or bad page.
    > FlashOnly only outputs the Object and Embed tags for the flash movie.
    >
    >
    > There is also a property called MovieName which is a virtual path to the
    > flash movie.
    >
    > There are also two properties (AlternateContentUrl) and (GoodContentUrl).
    >
    >
    > --------------------------------------------------------------------------
    > My Problem is with setting the OutputMethod to SWF_VersionDetection
    > --------------------------------------------------------------------------
    > (SWF_VersionDection is implemented in Flash MX2004 and actually uses a SWF
    > file to redirect to a good or bad url depending on if the plugin was

    found.
    > If the plugin is NOT found the SWF redirects to the AlternateContentUrl

    else
    > it wil redirect to the GoodContentUrl.)
    >
    >
    > When the control is rendered using the SWF_VersionDetection OutputMethod

    the
    > AlternateContentUrl and GoodContentUrl are passed as a querystring to the
    > flash movie: Example below:
    >
    > <Param name="movie"
    >

    value="FlashMovieName.swf?AlternateContentUrl=MyAltValue&GoodContentUrl=MyGo
    > odContentVal">
    >
    > The proplem is that when I set the MovieName to the Redirecting Flash.swf
    > file and then set the OutputMethod to SWF_VersionDetection and then

    Specify
    > the GoodContentUrl the flash movie is tring to open the GodContentUrl in

    a
    > seperate IE window.
    >
    > Soit seems that If I can hide the values of the two Urls from the

    designers
    > rendering of the content but still allowing the user to set them in the
    > properties window.
    > I should be in business ;)
    >
    > Thanks
    >
    >
    > "Alan Corbett (.NET MVP)" <> wrote in message
    > news:...
    > > What Webcontrol are you using?
    > >
    > > You could try disabling the webcontrol in the server-side and enabling

    it
    > in
    > > the client-side.
    > >
    > > You could add a hidden field to the page, and on the client-side move

    the
    > > value from the hidden field to the webcontrol....
    > >
    > > I'm not exactly sure what you're after, here.
    > >
    > > "Ron Vecchi" <> wrote in message
    > > news:...
    > > > Hello Alan,
    > > >
    > > > I'm not exactly sure where to implement this.
    > > > I tried the get accessor of the actual property but this was obviousy

    > > wrong.
    > > > After setting the value in the properties window the new value was
    > > > immediatly discarded.
    > > >
    > > > Is their a method which can be overridin that directly handles writing

    > the
    > > > content to the html view.
    > > > It seems that if there is I should be able to implement the "Site" in

    > that
    > > > method?
    > > >
    > > > -
    > > > To give more insight of my problem.
    > > > I have a property which will tell the webpage where to redirect to

    when
    > it
    > > > loads.
    > > > The proplem is that the designer tries to open this page once the

    > property
    > > > is set.
    > > >
    > > > Thanks
    > > >
    > > >
    > > >
    > > >
    > > > "Alan Corbett (.NET MVP)" <> wrote in message
    > > > news:...
    > > > > Take a look at:
    > > > >
    > > > > Site.DesignMode
    > > > >
    > > > > This property tells you if you're in design mode or not...add your
    > > > > appropriate logic around it.
    > > > >
    > > > > Note, that when running outside of the IDE It returns 'null' rather

    > than
    > > > > 'false', like it should.
    > > > >
    > > > > "Ron Vecchi" <> wrote in message
    > > > > news:%...
    > > > >
    > > > > > I am working on a webcontrol and ran into a little problem.
    > > > > >
    > > > > > How can I not have a property, which is set in the designer not

    > render
    > > > > > itself to the html view but only render itself at runtime.?
    > > > > >
    > > > > >
    > > > > > thanks
    > > > > > --
    > > > > > Ron Vecchi
    > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Alan Corbett \(.NET MVP\), Nov 26, 2003
    #7
  8. Ron Vecchi

    Ron Vecchi Guest

    Thank you Alan,

    Thats exactly what i'm going to do.

    That makes sense for sure. Putting the Site.DesignMode around the piece of
    code where the property is actually rendered out to the HtmlTextWriter.

    For some reason I couldn't figure it out and tried putting it around the get
    accessor. Two many long nights on my computer. But this makes sense.

    Thanks a bunch!

    "Alan Corbett (.NET MVP)" <> wrote in message
    news:...
    > OK, let me see if I have this right:
    >
    > In the DESIGNER, when you set certain properties on thsi control, it's
    > executing code based on the properties that is causing the designer to pop
    > up a new IE window?
    >
    > In short, if you need to set these properties from within the properties
    > window of the designer, but not have the designer do anything as a result

    of
    > your setting this property, wrap a Site.DesignMode check around that code.
    >
    > If this doesn't get you what you're looking for, create different

    properties
    > that the user cannot see, and put the real execution code in there, only
    > setting their values at execution time from the properties the user CAN

    set.
    >
    > Make sense?
    >
    >
    >
    >
    >
    >
    > "Joe Bob Briggs" <> wrote in message
    > news:...
    > > Sorry, let me offer more information.
    > >
    > > I am creating a custom control inheriting from System.Web.UI.Control.
    > > The control is a wrapper for embedding a flash movie in a web page.
    > >
    > > There is a property called OutputMethod that is an enumeration
    > > [possible values]
    > > ClientScriptVersionDetection, //This value will tell the control to
    > > output the client script to perform a plugin version detection(Mimics

    > exacty
    > > what Macromedia outputs from publish)
    > > SWF_VersionDetection, //This value is added to handle MX2004's

    version
    > > detection inwhich an SWF movie actully performs the detection and

    rediects
    > > to a good or bad page.
    > > FlashOnly only outputs the Object and Embed tags for the flash

    movie.
    > >
    > >
    > > There is also a property called MovieName which is a virtual path to the
    > > flash movie.
    > >
    > > There are also two properties (AlternateContentUrl) and

    (GoodContentUrl).
    > >
    > >

    >
    > --------------------------------------------------------------------------
    > > My Problem is with setting the OutputMethod to SWF_VersionDetection

    >
    > --------------------------------------------------------------------------
    > > (SWF_VersionDection is implemented in Flash MX2004 and actually uses a

    SWF
    > > file to redirect to a good or bad url depending on if the plugin was

    > found.
    > > If the plugin is NOT found the SWF redirects to the AlternateContentUrl

    > else
    > > it wil redirect to the GoodContentUrl.)
    > >
    > >
    > > When the control is rendered using the SWF_VersionDetection OutputMethod

    > the
    > > AlternateContentUrl and GoodContentUrl are passed as a querystring to

    the
    > > flash movie: Example below:
    > >
    > > <Param name="movie"
    > >

    >

    value="FlashMovieName.swf?AlternateContentUrl=MyAltValue&GoodContentUrl=MyGo
    > > odContentVal">
    > >
    > > The proplem is that when I set the MovieName to the Redirecting

    Flash.swf
    > > file and then set the OutputMethod to SWF_VersionDetection and then

    > Specify
    > > the GoodContentUrl the flash movie is tring to open the GodContentUrl

    in
    > a
    > > seperate IE window.
    > >
    > > Soit seems that If I can hide the values of the two Urls from the

    > designers
    > > rendering of the content but still allowing the user to set them in the
    > > properties window.
    > > I should be in business ;)
    > >
    > > Thanks
    > >
    > >
    > > "Alan Corbett (.NET MVP)" <> wrote in message
    > > news:...
    > > > What Webcontrol are you using?
    > > >
    > > > You could try disabling the webcontrol in the server-side and enabling

    > it
    > > in
    > > > the client-side.
    > > >
    > > > You could add a hidden field to the page, and on the client-side move

    > the
    > > > value from the hidden field to the webcontrol....
    > > >
    > > > I'm not exactly sure what you're after, here.
    > > >
    > > > "Ron Vecchi" <> wrote in message
    > > > news:...
    > > > > Hello Alan,
    > > > >
    > > > > I'm not exactly sure where to implement this.
    > > > > I tried the get accessor of the actual property but this was

    obviousy
    > > > wrong.
    > > > > After setting the value in the properties window the new value was
    > > > > immediatly discarded.
    > > > >
    > > > > Is their a method which can be overridin that directly handles

    writing
    > > the
    > > > > content to the html view.
    > > > > It seems that if there is I should be able to implement the "Site"

    in
    > > that
    > > > > method?
    > > > >
    > > > > -
    > > > > To give more insight of my problem.
    > > > > I have a property which will tell the webpage where to redirect to

    > when
    > > it
    > > > > loads.
    > > > > The proplem is that the designer tries to open this page once the

    > > property
    > > > > is set.
    > > > >
    > > > > Thanks
    > > > >
    > > > >
    > > > >
    > > > >
    > > > > "Alan Corbett (.NET MVP)" <> wrote in message
    > > > > news:...
    > > > > > Take a look at:
    > > > > >
    > > > > > Site.DesignMode
    > > > > >
    > > > > > This property tells you if you're in design mode or not...add your
    > > > > > appropriate logic around it.
    > > > > >
    > > > > > Note, that when running outside of the IDE It returns 'null'

    rather
    > > than
    > > > > > 'false', like it should.
    > > > > >
    > > > > > "Ron Vecchi" <> wrote in message
    > > > > > news:%...
    > > > > >
    > > > > > > I am working on a webcontrol and ran into a little problem.
    > > > > > >
    > > > > > > How can I not have a property, which is set in the designer not

    > > render
    > > > > > > itself to the html view but only render itself at runtime.?
    > > > > > >
    > > > > > >
    > > > > > > thanks
    > > > > > > --
    > > > > > > Ron Vecchi
    > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Ron Vecchi, Nov 26, 2003
    #8
    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. Timo
    Replies:
    4
    Views:
    500
  2. ChrisN
    Replies:
    3
    Views:
    508
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Apr 4, 2007
  3. Max2006
    Replies:
    2
    Views:
    536
    Max2006
    Jul 13, 2007
  4. Alexander Higgins
    Replies:
    3
    Views:
    1,108
    Teemu Keiski
    Jul 30, 2007
  5. Alexander Higgins
    Replies:
    0
    Views:
    469
    Alexander Higgins
    Jul 21, 2007
Loading...

Share This Page