Click here to Skip to main content
15,072,209 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am using Usercontrol which have property like

C#
private string _requestid;
   public String Requestid
   {
       get { return _requestid; }
       set { _requestid = value; }
   }


and also page_load of usercontrol.
now i want to bind that property from my aspx page where i have gridview with RowCommand method where i found id to bind that usercontrol.

and i m doing like
usercontrol.Requestid = e.CommandArgument.ToString()


i can find
e.CommandArgument.ToString()
value bt i cant assign to usercontrol. i have also debug whole code and i found page load event of usercontrol is fired first and then property is going to assigned thats why problem comes. but i dont know how to resolve it.

Thanx for any reply.
Posted

What ever you are writing on "PageLoad" event, write that code in your "Set" property of "RequestID".

That should solved your problem.
   
I got solution....
i was doing Rowcommand of gridview.
and then i was assigning so i value was changed somehome.

but when i did buttom click event in gridview...nd then do the same process...it works find... anyways thanx for help
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900