|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
dynamic image? store and retrieve properties values? resizable web control?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 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 > 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 > > 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 >> > >
Events fired from dynamically created controls-VB.net
Dynamic button event not firing C# Correct place to add an event handler in code? Adding layout elements within custom control Create A 3-Day Window Between 2 Calendars How to Persist Dynamic Rows within WebControls.Table? label control DropDownList -- setting by text? Problem getting a reference to the HTML code generated by an .aspx Panel not displaying fields - VS2005 |
|||||||||||||||||||||||