Change the label text in master from content page

Posted by Thiru under ASP.NET on 9/18/2011 | Points: 10 | Views : 4948 | Status : [Member] | Replies : 3
Hi,

We can change the label text of master page from content page.
Please Note:
I have two content page ( cntA and cntB for a MSTpg)
Start page is cntA

note: MSTpg lable text is changed in MSTpg page load event
as lbl.text="text changed in master page"

now i like to change the label text in MSTpg from cntB pageload event

how its possible.
When i click on cntB -- first cntB pageload event is triggering and then MSTpg pageload event




Responses

Posted by: Vuyiswamb on: 9/18/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Sheo wrote an article similar to what you want , look at this

http://www.dotnetfunda.com/articles/article1504-how-to-access-master-page-control-from-the-content-page-.aspx

Thank you for posting at Dotnetfunda
[Administrator]

Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Thiru on: 9/18/2011 [Member] Starter | Points: 25

Up
0
Down
I agree. Sheo article is great.
But my thing is similar but different :-)

I assigned default label value in master page event.
it should not change when content-page1 is loading.
but it should be change when content-page2 is loading through content-page2_pageload_event

Here: When i visit contentpg2 -- label changed when its pageload_event triggers
but after that maste_pg_loadevent triggering know -- in that part its change back to default. :-)

My question is: how to handle this ?

Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 9/18/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Yes , in Page2 go and find the Control using the FindControl("") function and change the text of the label from the content page 2. So what Sheo did can work for what you want.

Thank you for posting at Dotnetfunda
[Administrator]

Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response