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

R

Ron Vecchi

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
 
A

Alan Corbett \(.NET MVP\)

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.
 
R

Ron Vecchi

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
 
A

Alan Corbett \(.NET MVP\)

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.
 
J

Joe Bob Briggs

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
 
A

Alan Corbett \(.NET MVP\)

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 said:
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) said:
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.
when
 
R

Ron Vecchi

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) said:
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 said:
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


it writing
the in
that when rather
than
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top