How to pass variables from a page to a web control?
-
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
-
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
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
-
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
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
-
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
-
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
-
[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 urlsRegards, Sylvester G sylvester_g_m@yahoo.com
-
[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 urlsRegards, Sylvester G sylvester_g_m@yahoo.com