Click here to Skip to main content
15,914,350 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Literal ltrlCloseWindowText = (Literal)this.Page.Master.FindControl("ltrlCloseWindowText");
Posted

Read from bottom to top. I hope you will understand this weirdly written explanation. if not let me know and I will try to put it in another form.

P.S. I broke the line of code and explained each segment.
C#
// 4. create a literal control variable to hold a literal control we find from somewhere else
Literal ltrlCloseWindowText 

// 3. assignment
 =
// 2. type cast the generic control type to literal control
 (Literal) 

// 1. Find a control names ltrlCloseWindowText in the masterpage associated with this page.
this.Page.Master.FindControl("ltrlCloseWindowText"); 

in short, we want to find the value associated with some literal control named ltrlCloseWindowText in masterpage and use it in content page.
 
Share this answer
 
It searches for and if found returns the control with ID ltrlCloseWindowText. The control is expected to be of control type Literal.

Refer to:
http://msdn.microsoft.com/de-de/library/vstudio/486wc64h.aspx[^]
 
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