母版页标签值会在导航到下一页后更改吗?

编程入门 行业动态 更新时间:2024-10-25 16:30:25
本文介绍了母版页标签值会在导航到下一页后更改吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嗨.. 我毫不怀疑.. 如果我在母版页眉中具有标签控件,则在导航到下一页后,其他页面将更改标签值/文本.如何执行此操作,请帮帮我. 我尝试过 在aspx页面中:

Hi.. I have small doubt.. If i have label control in master page header.that label value/text will be changed after navigation to next page ,other pages.How to do this please help me. i tried like in aspx page:

page load(); Label lbl = (Label)Page.master.findcontrol("lbl"); lbl.text ="fggf";

还有其他方法可以更改标签文本..请帮助我 在此先感谢

Is there is any other way to change label text..please help me Thanks in advance

推荐答案

使用公共属性是其中之一. Use the public properties is one of theway.

您必须在此处查看事件触发机制,放置母版页后,可以将标签控件公开为属性,如下所示: You have to see the event firing mechanism here, when master pages in place, you can expose the label control as a property as shown below: public Label NameLabel { get { return lbl; } set { lbl = value; } }

在代码中访问NameLabel,还请牢记母版页的应用程序生命周期,您的问题在此处得到解决

Access NameLabel in the code, also keep in mind application life cycle with master pages, your issue get solved here

更多推荐

母版页标签值会在导航到下一页后更改吗?

本文发布于:2023-06-13 05:25:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/674911.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:下一页   会在   标签   母版

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!