D DC Gringo Dec 30, 2004 #1 How can I access a "public var1 as new string" from a .aspx page's user control?
J John Saunders Dec 30, 2004 #2 DC Gringo said: How can I access a "public var1 as new string" from a .aspx page's user control? Click to expand... That's a bad idea. Variables should almost never be public - you lose any control over what happens to it. You should define a property in the user control, and the page should set that property to var1. BTW, you don't need to say "New String". Also, be sure to turn Options Strict On. John Saunders
DC Gringo said: How can I access a "public var1 as new string" from a .aspx page's user control? Click to expand... That's a bad idea. Variables should almost never be public - you lose any control over what happens to it. You should define a property in the user control, and the page should set that property to var1. BTW, you don't need to say "New String". Also, be sure to turn Options Strict On. John Saunders
G Guest Dec 30, 2004 #3 You can access a public variable or property of your page object with the <%# %> data binding syntax. You also need to call this.DataBind() on your page object.
You can access a public variable or property of your page object with the <%# %> data binding syntax. You also need to call this.DataBind() on your page object.