Home All Groups Group Topic Archive Search About

dynamic image? store and retrieve properties values? resizable web control?

Author
2 Aug 2006 2:45 PM
bob95226
I'm designing a web control, there are 3 issues for me:

(1) How to display a dynamic image in the web control, can HttpModules
and ControlDesigner do it?

(2) How to store and retrieve the properties values? so runtime web
control can set properties values based on designer time settings?

(3) How to make web control resizable during the designer time?

Thanks,

Bob

Author
2 Aug 2006 3:19 PM
Alessandro Zifiglio
hi Bob,

1. You can add the images to your project, right click on them and go in the
properties window and change the build action to "Embedded resources". To
retrieve the resources you can use the ClientScriptManager.GetWebResourceUrl
Method. Also dont forget to apply the WebResourceAttribute metadata
attribute to mark the assembly for the resources that will be served.  The
sample code in the following msdn resource covers all this, and since you
have images and they were gif format, you would do for eg.
[assembly: WebResourceAttribute("mydllname.imagename.gif", "image/gif")]
            instead of
[assembly: WebResource("script_include.js", "application/x-javascript")]
as per the sample code.

http://msdn2.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.getwebresourceurl(d=robot).aspx

2. You just expose public properties with getters and setters. Optionally
storing also into viewstate for persistance between postbacks for properties
set in code versus set declaratively on the vs.net designer. You can
reference the following resources on msdn :
http://msdn2.microsoft.com/en-us/library/ms178648.aspx

3. You associate your custom web control with a ControlDesigner. This
reference on msdn included below might help you get started, however it only
scratches the surface so you might want to look for other references as you
deal with issues or want to do more than what you see in the sample code  :
http://msdn2.microsoft.com/en-us/library/system.web.ui.design.controldesigner.aspx

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net

<bob95***@yahoo.com> ha scritto nel messaggio
Show quoteHide quote
news:1154529931.783011.272440@m79g2000cwm.googlegroups.com...
> I'm designing a web control, there are 3 issues for me:
>
> (1) How to display a dynamic image in the web control, can HttpModules
> and ControlDesigner do it?
>
> (2) How to store and retrieve the properties values? so runtime web
> control can set properties values based on designer time settings?
>
> (3) How to make web control resizable during the designer time?
>
> Thanks,
>
> Bob
>
Author
2 Aug 2006 3:54 PM
bob95226
Alessandro,

Thanks for your posting!

I want to display a dynamic image (e.g. chart image) which is created
by web control on the fly (not from a physical file)

I managed to make the dynamic image work during the runtime via
HttpModules, however I don't know how to make the image visible during
the design time.

Not much documentation available on how to make web control resizable
during the design time ...

Thanks,

Bob


Alessandro Zifiglio wrote:
Show quoteHide quote
> hi Bob,
>
> 1. You can add the images to your project, right click on them and go in the
> properties window and change the build action to "Embedded resources". To
> retrieve the resources you can use the ClientScriptManager.GetWebResourceUrl
> Method. Also dont forget to apply the WebResourceAttribute metadata
> attribute to mark the assembly for the resources that will be served.  The
> sample code in the following msdn resource covers all this, and since you
> have images and they were gif format, you would do for eg.
> [assembly: WebResourceAttribute("mydllname.imagename.gif", "image/gif")]
>             instead of
> [assembly: WebResource("script_include.js", "application/x-javascript")]
> as per the sample code.
>
> http://msdn2.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.getwebresourceurl(d=robot).aspx
>
> 2. You just expose public properties with getters and setters. Optionally
> storing also into viewstate for persistance between postbacks for properties
> set in code versus set declaratively on the vs.net designer. You can
> reference the following resources on msdn :
> http://msdn2.microsoft.com/en-us/library/ms178648.aspx
>
> 3. You associate your custom web control with a ControlDesigner. This
> reference on msdn included below might help you get started, however it only
> scratches the surface so you might want to look for other references as you
> deal with issues or want to do more than what you see in the sample code  :
> http://msdn2.microsoft.com/en-us/library/system.web.ui.design.controldesigner.aspx
>
> Regards,
> Alessandro Zifiglio
> http://www.AsyncUI.net
>
> <bob95***@yahoo.com> ha scritto nel messaggio
> news:1154529931.783011.272440@m79g2000cwm.googlegroups.com...
> > I'm designing a web control, there are 3 issues for me:
> >
> > (1) How to display a dynamic image in the web control, can HttpModules
> > and ControlDesigner do it?
> >
> > (2) How to store and retrieve the properties values? so runtime web
> > control can set properties values based on designer time settings?
> >
> > (3) How to make web control resizable during the designer time?
> >
> > Thanks,
> >
> > Bob
> >
Author
2 Aug 2006 4:51 PM
Alessandro Zifiglio
Bob, unfortunately, if this is for a dynamic image you are generating then i
dont find anything useful on msdn and i'll conclude that it is not a
supported feature in visual studio 2005. I just know that by looking at the
url generated in debug mode, for image resources, the images are prefix with
a special protocol  mvwres: and handled through the IResourceUrlGenerator,
you can lookup it up here :
http://www.nikhilk.net/WebResourceAttributeAtDesignTime.aspx
http://msdn2.microsoft.com/en-us/library/system.web.ui.iresourceurlgenerator.aspx

However that implies that you have an embedded resource. It does not seem
like it takes a stream file which is what you want.

The only alternative is to look at antonio bakula's PStreamImage, which
seems to be free and supposedly working at designtime too. You can look it
up at the following url :
http://www.antoniob.com/projects/PStreamImage.aspx

For resizing the control, associate a controldesigner and return true for
allowResize property as per that example on msdn i posted earlier.

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net

<bob95***@yahoo.com> ha scritto nel messaggio
Show quoteHide quote
news:1154534060.763991.279800@b28g2000cwb.googlegroups.com...
> Alessandro,
>
> Thanks for your posting!
>
> I want to display a dynamic image (e.g. chart image) which is created
> by web control on the fly (not from a physical file)
>
> I managed to make the dynamic image work during the runtime via
> HttpModules, however I don't know how to make the image visible during
> the design time.
>
> Not much documentation available on how to make web control resizable
> during the design time ...
>
> Thanks,
>
> Bob
>
>
> Alessandro Zifiglio wrote:
>> hi Bob,
>>
>> 1. You can add the images to your project, right click on them and go in
>> the
>> properties window and change the build action to "Embedded resources". To
>> retrieve the resources you can use the
>> ClientScriptManager.GetWebResourceUrl
>> Method. Also dont forget to apply the WebResourceAttribute metadata
>> attribute to mark the assembly for the resources that will be served.
>> The
>> sample code in the following msdn resource covers all this, and since you
>> have images and they were gif format, you would do for eg.
>> [assembly: WebResourceAttribute("mydllname.imagename.gif", "image/gif")]
>>             instead of
>> [assembly: WebResource("script_include.js", "application/x-javascript")]
>> as per the sample code.
>>
>> http://msdn2.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.getwebresourceurl(d=robot).aspx
>>
>> 2. You just expose public properties with getters and setters. Optionally
>> storing also into viewstate for persistance between postbacks for
>> properties
>> set in code versus set declaratively on the vs.net designer. You can
>> reference the following resources on msdn :
>> http://msdn2.microsoft.com/en-us/library/ms178648.aspx
>>
>> 3. You associate your custom web control with a ControlDesigner. This
>> reference on msdn included below might help you get started, however it
>> only
>> scratches the surface so you might want to look for other references as
>> you
>> deal with issues or want to do more than what you see in the sample code
>> :
>> http://msdn2.microsoft.com/en-us/library/system.web.ui.design.controldesigner.aspx
>>
>> Regards,
>> Alessandro Zifiglio
>> http://www.AsyncUI.net
>>
>> <bob95***@yahoo.com> ha scritto nel messaggio
>> news:1154529931.783011.272440@m79g2000cwm.googlegroups.com...
>> > I'm designing a web control, there are 3 issues for me:
>> >
>> > (1) How to display a dynamic image in the web control, can HttpModules
>> > and ControlDesigner do it?
>> >
>> > (2) How to store and retrieve the properties values? so runtime web
>> > control can set properties values based on designer time settings?
>> >
>> > (3) How to make web control resizable during the designer time?
>> >
>> > Thanks,
>> >
>> > Bob
>> >
>