Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6098153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:07:31+00:00 2026-05-23T13:07:31+00:00

Expert, I would like to create a custom control with following feature and this

  • 0

Expert,

I would like to create a custom control with following feature and this is successfully created:

<fv:Album Runat="Server" Id="WeddingAlbum" Width="600" Height="600" SkinColor="SkyBlue" AllowedFileExtensions="jpg|png|jpeg|gif" MessageDelay="6000" 
SavePageUrl="saveupload.aspx" RemovePageUrl="removeupload.aspx"
ThumbnailHeight="150" Thumbnailwidth="150" ThumbnailFadeIn="slow" ThumbnailFadeOut="slow" ThumbnailShowDelete="true"
PopupView="true" PopupViewType="All" PopupOverlayShow="true" PopupTransitionIn="elastic" PopupTransitionOut="elastic"
</fv:Album>

but i would like to segregate Album with Thumbnail and Popup tag. it look like

<fv:Album Runat="Server" Id="WeddingAlbum" Width="600" Height="600" SkinColor="SkyBlue" AllowedFileExtensions="jpg|png|jpeg|gif" MessageDelay="6000" SavePageUrl="saveupload.aspx" RemovePageUrl="removeupload.aspx">
    <fv:Thumbnail Height="150" width="150" FadeIn="slow" FadeOut="slow" ShowDelete="true" />
    <fv:Popup View="true" ViewType="All" OverlayShow="true" TransitionIn="elastic" TransitionOut="elastic"/>
</fv:Album>

can any body tell me how can i achieve the above functionality?

Example:

 <asp:GridView ID="productGridView" Runat="server" DataSourceID="productsDataSource"
            <FooterStyle ForeColor="#8C4510" BackColor="#F7DFB5"></FooterStyle>
            <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center"></PagerStyle>
            <HeaderStyle ForeColor="White" BackColor="#A55129"></HeaderStyle> 
</asp:GridView>

Thanks in advance!
Imdadhusen

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:07:32+00:00Added an answer on May 23, 2026 at 1:07 pm

    Album.cs

    namespace Imdadhusen.Controls.Web
    {
        [DefaultProperty("Text")]
        [ToolboxData("<{0}:Album runat=\"server\" />")]
        [ToolboxBitmap(typeof(Album), "Album.bmp")]
        public class Album : WebControl, IScriptControl
        {
            #region "Popup Properties"
            private Popup _popup = new Popup();
            //PersistenceMode.InnerProperty: Specifies that the property persists in
            //the ASP.NET server control as a nested tag. 
            //DesignerSerializationVisibility.Content: Specifies that a visual
            //designer serializes the contents of this property instead of the 
            //property itself. 
            [DefaultValue("")]
            [Category("Custom")]
            [PersistenceMode(PersistenceMode.InnerProperty)]
            [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
            public Popup Popup
            {
                get { return _popup; }
                set { _popup = value; }
            }
            #endregion
    
            #region "Popup Properties"
            private Thumbnail _thumbnail = new Thumbnail();
            [DefaultValue("")]
            [Category("Custom")]
            [PersistenceMode(PersistenceMode.InnerProperty)]
            [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
            public Thumbnail Thumbnail
            {
                get { return _thumbnail; }
                set { _thumbnail = value; }
            }
            #endregion
    
            #region "Control Properties"
            public string UploadButtonID
            {
                get { return this.ViewState["UploadButtonID"] == null ? string.Empty : (string)this.ViewState["UploadButtonID"]; }
                set { this.ViewState["UploadButtonID"] = value; }
            }
            /// <summary>
            /// Location of the server-side upload script
            /// </summary>
            public string Action
            {
                get { return this.ViewState["Action"] == null ? string.Empty : (string)this.ViewState["Action"]; }
                set { this.ViewState["Action"] = value; }
            }
            /// <summary>
            /// Additional data to send
            /// </summary>
            public string ExtraData
            {
                get { return this.ViewState["ExtraData"] == null ? string.Empty : (string)this.ViewState["ExtraData"]; }
                set { this.ViewState["ExtraData"] = value; }
            }
            /// <summary>
            /// Callback to fire before file is uploaded
            /// You can return false to cancel upload
            /// </summary>
            public string OnSubmitFunction
            {
                get { return this.ViewState["OnSubmitFunction"] == null ? string.Empty : (string)this.ViewState["OnSubmitFunction"]; }
                set { this.ViewState["OnSubmitFunction"] = value; }
            }
            /// <summary>
            /// Submit file as soon as it's selected
            /// </summary>
            public bool AutoSubmit
            {
                get { return this.ViewState["AutoSubmit"] == null ? true : (bool)this.ViewState["AutoSubmit"]; }
                set { this.ViewState["AutoSubmit"] = value; }
            }
            /// <summary>
            /// The type of data that you're expecting back from the server.
            /// Html and xml are detected automatically.
            /// Only useful when you are using json data as a response.
            /// Set to "json" in that case.
            /// </summary>
            public string ResponseType
            {
                get { return this.ViewState["ResponseType"] == null ? string.Empty : (string)this.ViewState["ResponseType"]; }
                set { this.ViewState["ResponseType"] = value; }
            }
            // When user selects a file, useful with autoSubmit disabled            
            public string OnChangeFunction
            {
                get { return this.ViewState["OnChangeFunction"] == null ? string.Empty : (string)this.ViewState["OnChangeFunction"]; }
                set { this.ViewState["OnChangeFunction"] = value; }
            }
            /// <summary>
            /// Fired when file upload is completed
            /// WARNING! DO NOT USE "FALSE" STRING AS A RESPONSE!
            /// </summary>
            public string OnCompleteFunction
            {
                get { return this.ViewState["OnCompleteFunction"] == null ? string.Empty : (string)this.ViewState["OnCompleteFunction"]; }
                set { this.ViewState["OnCompleteFunction"] = value; }
            }
            #endregion
    
            #region "Page Events"
            protected override void OnPreRender(EventArgs e)
            {
                if (!this.DesignMode)
                {
                    //test for the existence of a ScriptManager  
                    ScriptManager sMgr = ScriptManager.GetCurrent(Page);
    
                    if (sMgr == null)
                        throw new HttpException(
                           "A ScriptManager control must exist on the page.");
    
                    sMgr.RegisterScriptControl(this);
                }
                base.OnPreRender(e);
            }
            protected override void Render(HtmlTextWriter output)
            {
                Control btnUpload = this.NamingContainer.FindControl(this.UploadButtonID);
                if (btnUpload == null) throw new HttpException("A UploadButtonID must point to an existing control on the page.");
    
                StringBuilder startupscript = new StringBuilder();
                startupscript.AppendLine("$().ready(function () {");
                startupscript.AppendLine("    $(function () {");
                startupscript.AppendFormat("        var btnUpload = $('#{0}');\n", btnUpload.ClientID);
                startupscript.AppendLine("        new AjaxUpload(btnUpload, {");
                startupscript.AppendFormat("            name: '{0}'", this.UniqueID);
                if (!string.IsNullOrEmpty(this.OnChangeFunction))
                    startupscript.AppendFormat(",\n            onChange: {0}", this.OnChangeFunction);
    
                if (this.AutoSubmit)
                {
                    startupscript.AppendFormat(",\n            action: '{0}'", this.Action);
    
                    if (!string.IsNullOrEmpty(this.ResponseType))
                        startupscript.AppendFormat(",\n            responseType: {0}", this.ResponseType);
    
                    if (!string.IsNullOrEmpty(this.OnSubmitFunction))
                        startupscript.AppendFormat(",\n            onSubmit: {0}", this.OnSubmitFunction);
    
                    if (!string.IsNullOrEmpty(this.OnCompleteFunction))
                        startupscript.AppendFormat(",\n            onComplete: {0}", this.OnCompleteFunction);
                }
                else
                {
                    startupscript.Append(",\n            autoSubmit: false");
                }
                startupscript.AppendLine("\n        });");
                startupscript.AppendLine("    });");
                startupscript.AppendLine("});");
    
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "startupscript", startupscript.ToString(), true);
    
    
                base.Render(output);
    
            }
            #endregion
    
            #region "IScriptControl Members"
            IEnumerable<ScriptDescriptor> IScriptControl.GetScriptDescriptors()
            {
                return new ScriptDescriptor[] { };
            }
            IEnumerable<ScriptReference> IScriptControl.GetScriptReferences()
            {
                ScriptReference reference = new ScriptReference();
                reference.Assembly = "PhotoAlbum";
                reference.Name = "Imdadhusen.Controls.Web.Script.ajaxupload.3.5.js";
                return new ScriptReference[] { reference };
            }
            #endregion
        }
    }
    

    Popup.cs

    namespace Imdadhusen.Controls.Web
    {
        /// <summary>
        ///ExpandableObjectConverter: Provides a type converter to convert expandable 
        ///objects. It adds support for properties on an object to the methods and 
        ///properties that TypeConverter provides.
        /// </summary>
        [TypeConverter(typeof(ExpandableObjectConverter))]
        public class Popup
        {
            //View="true" ViewType="All" OverlayShow="true" TransitionIn="elastic" TransitionOut="elastic"
            public Popup()
            {
            }
    
            //start View
            private bool _view;
            [DefaultValue(true)]
            [NotifyParentProperty(true)]
            [RefreshProperties(RefreshProperties.Repaint)]
            public bool View
            {
                get { return _view; }
                set { _view = value; }
            }
            //end View
    
            //start ViewType
            private _ViewType _viewtype;
            public enum _ViewType
            {
                All,
                Single
            }
            [DefaultValue(_ViewType.All)]
            [NotifyParentProperty(true)]
            [RefreshProperties(RefreshProperties.Repaint)]
            public _ViewType ViewType
            {
                get { return _viewtype; }
                set { _viewtype = value; }
    
            }
            //end ViewType
    
            //start ShowOverlay
            private bool _overlayshow;
            [DefaultValue(true)]
            [NotifyParentProperty(true)]
            [RefreshProperties(RefreshProperties.Repaint)]
            public bool ShowOverlay
            {
                get { return _overlayshow; }
                set { _overlayshow = value; }
            }
            //end ShowOverlay
    
            //start TransitionIn
            private _TransitionIn _transitionin;
            public enum _TransitionIn
            {
                Elastic,
                Fade,
                None
            }
            [DefaultValue("")]
            [NotifyParentProperty(true)]
            [RefreshProperties(RefreshProperties.Repaint)]
            public _TransitionIn TransitionIn
            {
                get { return _transitionin; }
                set { _transitionin = value; }
            }
            //end TransitionIn
    
            //start TransitionOut
            private _TransitionOut _transitionout;
            public enum _TransitionOut
            {
                Elastic,
                Fade,
                None
            }
            [DefaultValue(_TransitionOut.Elastic)]
            [NotifyParentProperty(true)]
            [RefreshProperties(RefreshProperties.Repaint)]
            public _TransitionOut TransitionOut
            {
                get { return _transitionout; }
                set { _transitionout = value; }
            }
            //end TransitionOut
        }
    }
    

    Thumbnail.cs

    namespace Imdadhusen.Controls.Web
    {
        /// <summary>
        ///ExpandableObjectConverter: Provides a type converter to convert expandable 
        ///objects. It adds support for properties on an object to the methods and 
        ///properties that TypeConverter provides.
        /// </summary>
        [TypeConverter(typeof(ExpandableObjectConverter))]
        public class Thumbnail
        {
            //<fv:Thumbnail Height="150" width="150" FadeIn="slow" FadeOut="slow" ShowDelete="true" />
            public Thumbnail()
            {
            }
    
            //start Height
            private int _height;
            [DefaultValue(150)]
            [NotifyParentProperty(true)]
            [RefreshProperties(RefreshProperties.Repaint)]
            public int Height
            {
                get { return _height; }
                set { _height = value; }
            }
            //end Height
    
            //start Width
            private int _width;
            [DefaultValue(150)]
            [NotifyParentProperty(true)]
            [RefreshProperties(RefreshProperties.Repaint)]
            public int Width
            {
                get { return _width; }
                set { _width = value; }
            }
            //end Width
    
            //start FadeIn
            private _FadeIn _fadein;
            public enum _FadeIn
            {
                Slow,
                Medium,
                Fast
            }
            [DefaultValue(_FadeIn.Medium)]
            [NotifyParentProperty(true)]
            [RefreshProperties(RefreshProperties.Repaint)]
            public _FadeIn FadeIn
            {
                get { return _fadein; }
                set { _fadein = value; }
    
            }
            //end FadeIn
    
            //start FadeOut
            private _FadeOut _fadeout;
            public enum _FadeOut
            {
                Slow,
                Medium,
                Fast
            }
            [DefaultValue(_FadeOut.Medium)]
            [NotifyParentProperty(true)]
            [RefreshProperties(RefreshProperties.Repaint)]
            public _FadeOut FadeOut
            {
                get { return _fadeout; }
                set { _fadeout = value; }
    
            }
            //end FadeOut
    
            //start ShowDelete
            private bool _showdelete;
            [DefaultValue(true)]
            [NotifyParentProperty(true)]
            [RefreshProperties(RefreshProperties.Repaint)]
            public bool ShowDelete
            {
                get { return _showdelete; }
                set { _showdelete = value; }
            }
            //end View
        }
    }
    

    Index.cshtml
    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to create a custom NSView that takes a layered approach to
From our existing, internal tracking system I would like to create an XML export
Ok I really would like to know how expert MVVM developers handle an openfile
I have the following code, which works as I expect. What I would like
I would like to create an application that runs on XBox 360 (downloaded using
I hope you are all fine. I would like to ask the expert php
I am using Drupal 6, and would like to create content that can be
I'd like to create a plugin that exports into a custom document format similar
I created a table with this schema using sqlite3: CREATE TABLE monitored_files (file_id INTEGER
I would like to export some macros that I have defined and be able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.