Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to pass variables from a page to a web control?

How to pass variables from a page to a web control?

Scheduled Pinned Locked Moved ASP.NET
tutorialquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    steffw
    wrote on last edited by
    #1

    Hello everybody, I've searched for this for a long time, but could not find an easy example or something that made sence (for me) I've asked several collegue's of mine but they are not that good in communication, so i don't understand anything of what they are trying to explain me. Do you have a clear example of passing variables from a page to a web control? Thanks in adavce!

    Stef

    S B 2 Replies Last reply
    0
    • S steffw

      Hello everybody, I've searched for this for a long time, but could not find an easy example or something that made sence (for me) I've asked several collegue's of mine but they are not that good in communication, so i don't understand anything of what they are trying to explain me. Do you have a clear example of passing variables from a page to a web control? Thanks in adavce!

      Stef

      S Offline
      S Offline
      Sylvester george
      wrote on last edited by
      #2

      Add One property (setter, getter) for the control, Then use this as a varible to pass value.

      Regards, Sylvester G sylvester_g_m@yahoo.com

      S 1 Reply Last reply
      0
      • S steffw

        Hello everybody, I've searched for this for a long time, but could not find an easy example or something that made sence (for me) I've asked several collegue's of mine but they are not that good in communication, so i don't understand anything of what they are trying to explain me. Do you have a clear example of passing variables from a page to a web control? Thanks in adavce!

        Stef

        B Offline
        B Offline
        Bijay Bhaskar Deo
        wrote on last edited by
        #3

        Can u a little bit clearer on ur Question ? Wht do u mean by passing value from webpage ,because web page already contains web controls ? R u talking about user controls and passing value between them ? Type : Clarification of Question Deo

        Bijay Bhaskar Deo Thanks & Regard

        S 1 Reply Last reply
        0
        • B Bijay Bhaskar Deo

          Can u a little bit clearer on ur Question ? Wht do u mean by passing value from webpage ,because web page already contains web controls ? R u talking about user controls and passing value between them ? Type : Clarification of Question Deo

          Bijay Bhaskar Deo Thanks & Regard

          S Offline
          S Offline
          steffw
          wrote on last edited by
          #4

          Well... Nevermind =D i get it know :) thanks in advacne -- modified at 3:55 Friday 11th May, 2007

          Stef

          1 Reply Last reply
          0
          • S Sylvester george

            Add One property (setter, getter) for the control, Then use this as a varible to pass value.

            Regards, Sylvester G sylvester_g_m@yahoo.com

            S Offline
            S Offline
            steffw
            wrote on last edited by
            #5

            Yea! i mean that! Do you have an example for me?

            Stef

            S 1 Reply Last reply
            0
            • S steffw

              Yea! i mean that! Do you have an example for me?

              Stef

              S Offline
              S Offline
              Sylvester george
              wrote on last edited by
              #6

              [DefaultProperty("ImageUrl"), ToolboxData("<{0}:ImageButton runat=server>")] public class ImageButton : System.Web.UI.WebControls.LinkButton { [Bindable(true), Category("Appearance"), DefaultValue(""), Description("Specifies the image url for the button when in its normal state.")] public string ImageUrl { get { object o = ViewState["RollOverImageUrl"]; if (o != null) return (string) o; else return String.Empty; } set { ViewState["RollOverImageUrl"] = value; } } [Bindable(true), Category("Appearance"), DefaultValue(""), Description("Specifies the image url for the button when the mouse is hovered above the button.")] public string DownImageUrl { get { object o = ViewState["RollOverRollOverImageUrl"]; if (o != null) return (string) o; else return String.Empty; } set { ViewState["RollOverRollOverImageUrl"] = value; } } [Bindable(true), Category("Appearance"), DefaultValue(""), Description("Specifies the image url for the button when the mouse is Rollovered above the button.")] public string RollOverImageUrl { get { object o = ViewState["RollOverRollOverRollOverImageUrl"]; if (o != null) return (string) o; else return String.Empty; } set { ViewState["RollOverRollOverRollOverImageUrl"] = value; } } This is my ImageButton derived from LinkButton And I have added some more properties for image urls

              Regards, Sylvester G sylvester_g_m@yahoo.com

              S 1 Reply Last reply
              0
              • S Sylvester george

                [DefaultProperty("ImageUrl"), ToolboxData("<{0}:ImageButton runat=server>")] public class ImageButton : System.Web.UI.WebControls.LinkButton { [Bindable(true), Category("Appearance"), DefaultValue(""), Description("Specifies the image url for the button when in its normal state.")] public string ImageUrl { get { object o = ViewState["RollOverImageUrl"]; if (o != null) return (string) o; else return String.Empty; } set { ViewState["RollOverImageUrl"] = value; } } [Bindable(true), Category("Appearance"), DefaultValue(""), Description("Specifies the image url for the button when the mouse is hovered above the button.")] public string DownImageUrl { get { object o = ViewState["RollOverRollOverImageUrl"]; if (o != null) return (string) o; else return String.Empty; } set { ViewState["RollOverRollOverImageUrl"] = value; } } [Bindable(true), Category("Appearance"), DefaultValue(""), Description("Specifies the image url for the button when the mouse is Rollovered above the button.")] public string RollOverImageUrl { get { object o = ViewState["RollOverRollOverRollOverImageUrl"]; if (o != null) return (string) o; else return String.Empty; } set { ViewState["RollOverRollOverRollOverImageUrl"] = value; } } This is my ImageButton derived from LinkButton And I have added some more properties for image urls

                Regards, Sylvester G sylvester_g_m@yahoo.com

                S Offline
                S Offline
                steffw
                wrote on last edited by
                #7

                THANK YOU!! =D You make my day (acually week but who cares)

                Stef

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups