Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to modify the value of the master page control on the page page after referencing the master page

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

Editor to share with you how to use the master page to modify the value of the master page control on the page page. I hope you will get something after reading this article. Let's discuss it together.

The specific conditions are as follows:

1. First, the page must refer to the master page to be modified

2. On the page page, create a strongly typed reference to the master page by setting the page directive @ MasterType, and specify the virtual path to generate the strongly typed file, for example:

The copy code is as follows:

3. Add a public property to the master page, and the set value is assigned to the master page control, for example:

The copy code is as follows:

Public string PageTitle

{

Set {

This.LabPageTitle.Text = value

}

}

After meeting the above conditions, you can modify the value of the control above the master page on the page page, for example:

The copy code is as follows:

Protected void Page_Load (object sender, EventArgs e)

{

If (! IsPostBack)

{

This.Master.PageTitle = "Page page modifies the value of the master page control"

}

}

In this way, the LabTitle control value on the Master page is set to "Page page modifies the value of the master page control".

After reading this article, I believe you have a certain understanding of "how to modify the value of the master page control on the page page after referencing the master page". If you want to know more about it, welcome to follow the industry information channel, thank you for your reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report