Saturday, March 24, 2012

passing variables from an aspx file to an ascx file...

I had a page that used includes, the include files used a variable which was set in the main page for certain functions...

I want to duplicate this using asp.net but haven't been able to successfully do it.

For clarity, I want to:

*define a variable in my aspx page
*call a user control in an ascx file
*inside the user control I want to see and use the variable set in the aspx file...

Help!!

Thanks in advance!

GeorgeI'm pretty sure if you create public global variables in your ascx file you can then set their value in the aspx file:


//In your .aspx file

MyUserControl.VariableA = "this and that";


check this thread...

http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=332537

0 comments:

Post a Comment