UserControl and data from Default.aspx ?
-
How can i get data from my Default.aspx to my Control? I've tried several things, like creating a property in the classes, but it still wont work I can't figure it out :( I'm using asp.net with c# in 2.0 please help! Thanks in advance :)
Stef
steffw wrote:
How can i get data from my Default.aspx to my Control?
Which control ? is it any user or custom control ?
steffw wrote:
I've tried several things, like creating a property in the classes, but it still wont work
Why ? Can you post what you have done and What type of control are you using ?
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
steffw wrote:
How can i get data from my Default.aspx to my Control?
Which control ? is it any user or custom control ?
steffw wrote:
I've tried several things, like creating a property in the classes, but it still wont work
Why ? Can you post what you have done and What type of control are you using ?
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
How can i get data from my Default.aspx to my Control? I've tried several things, like creating a property in the classes, but it still wont work I can't figure it out :( I'm using asp.net with c# in 2.0 please help! Thanks in advance :)
Stef
1. You can add a public property and initialize it from the page initialize method. If you are using property then you can assingn value through html code in the aspx page or dynamically pass value throgh code behind 2. You can use session, application etc.. variables for passing data.
Gg
-
It is an UserControl, and i've tried to cast the page class in the user control and tried to at a property... But I noticed that you needed namespaces for that and I don't use those
Stef
Why don't you pass the value using Session/ QueryString to pass those values from Default to other page Where you are using USer Control
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
1. You can add a public property and initialize it from the page initialize method. If you are using property then you can assingn value through html code in the aspx page or dynamically pass value throgh code behind 2. You can use session, application etc.. variables for passing data.
Gg
-
I've tried the first one, didn't work out... I'm now using sessions but is this good for the performance?
Stef
If you are using small amount of data it will not affect performance. But it will be a performance hit if there is a large amount of data, because session uses application memory area. Please read the following articles. Then decide which you can use. http://msdn2.microsoft.com/en-us/library/87069683.aspx[^] http://aspnet.4guysfromrolla.com/articles/100902-1.aspx[^] http://ggaben-developer.blogspot.com/[^]
Gg
-
If you are using small amount of data it will not affect performance. But it will be a performance hit if there is a large amount of data, because session uses application memory area. Please read the following articles. Then decide which you can use. http://msdn2.microsoft.com/en-us/library/87069683.aspx[^] http://aspnet.4guysfromrolla.com/articles/100902-1.aspx[^] http://ggaben-developer.blogspot.com/[^]
Gg