Wednesday, January 20, 2010

How to pass the value to the user control using c#.net with asp.net?

U nee dto create events n delegates.


public color p_setuserbackcolor


{


get


{


value;


}


set{


tetxbox1.backcolor=value;


}


}


Declaring delegate:


public delegate void abc(object s,eventargs e);


public event abc myclic;








Hope u get the concept n can use nowHow to pass the value to the user control using c#.net with asp.net?
It necessarily depends on where the value is produced.


If it is on the client side like a field in a form, you can access Request object from the user control, hence the value. You can also use Session object to pass values, but this will consume some memory depending on the value.How to pass the value to the user control using c#.net with asp.net?
user control is also a class,so you can use the same way to pass the value to the user control as to the class.
I think you are asking about the Web User Controls, its better to use the session values.





Set the value on session on the Page_Load()





use the session value in the User Control Code.

No comments:

Post a Comment