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

Discussion in 'ASP .Net Web Controls' started by bob95226@yahoo.com, Aug 2, 2006.

  1. Guest

    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
     
    , Aug 2, 2006
    #1
    1. Advertising

  2. 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/li...scriptmanager.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

    <> ha scritto nel messaggio
    news:...
    > 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 Zifiglio, Aug 2, 2006
    #2
    1. Advertising

  3. Guest

    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/li...scriptmanager.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
    >
    > <> ha scritto nel messaggio
    > news:...
    > > 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
    > >
     
    , Aug 2, 2006
    #3
  4. 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

    <> ha scritto nel messaggio
    news:...
    > 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/li...scriptmanager.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
    >>
    >> <> ha scritto nel messaggio
    >> news:...
    >> > 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 Zifiglio, Aug 2, 2006
    #4
    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. Thiago Almeida

    Resizable columns on a web datagrid

    Thiago Almeida, Oct 15, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    755
    Thiago Almeida
    Oct 15, 2003
  2. balamurukan

    How to retrieve child properties values

    balamurukan, Nov 28, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    312
    balamurukan
    Nov 28, 2003
  3. angus
    Replies:
    2
    Views:
    484
    Elliot M. Rodriguez, MCSD
    May 20, 2004
  4. =?Utf-8?B?UnVkeQ==?=

    to store or not to store an image

    =?Utf-8?B?UnVkeQ==?=, Mar 29, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    657
    =?Utf-8?B?UnVkeQ==?=
    Mar 30, 2005
  5. MattM

    AJAX resizable control extender

    MattM, Apr 24, 2007, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    231
    MattM
    Apr 24, 2007
Loading...

Share This Page