Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i m create webpage with master page. In my content page i have a usercontrol for gridview. So i m creating Gridview Editing event. In c# page in that event i have to set the value to master page control. So i m accessing that control like following. But it is not working. If I used this method outside of the usercontrol events means it is working fine. But in between that usercontrol event that is not working.

((Label)Page.Master.FindControl("lblMsg")).Text = "Updated Successfully";


How to solve this problem?
If i check the value using breakpoint that value is changed. But it is not showing on the webpage

XML
<pre>Label l=((Label)Page.Master.FindControl("lblMsg"));
l.Text = "Updated Successfully";</pre>

Then i check that 'l' text property it is changed. It has 'Updated Successfully. But it is not showing on my webpage
Posted
Updated 14-May-13 23:38pm
v3
Comments
Mohammed Hameed 15-May-13 5:28am    
Which event of the usercontrol, are you placing this code? And you mean like you have a user control under a page and this page is having a master page also, am I right?
UshaCbe 15-May-13 5:33am    
GridviewContainer_RowEditing Event GridviewContainer is my userccontrol. It has Gridview. I intailize that event in my content page Preinit event like following

grvState.RowEditing += new UserControls_GridviewContainer.GridViewEditEventHandler(grvState_RowEditing);
_Amy 15-May-13 5:55am    
Where is your UserControl? I mean, in update panel?
UshaCbe 15-May-13 6:59am    
No, it is not in update panel
UshaCbe 15-May-13 7:45am    
But I m using update panel in my usercontrol .ascx page

1 solution

 
Share this answer
 

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



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