asp.net母版页C# [英] asp.net Master Page C#

查看:95
本文介绍了asp.net母版页C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我的网站上有一个母版页.
我们在

Dear All,

We have one Master page in my website.
We have placed on one label under

部分下放置了一个标签,以始终显示用户名.
但是,当我们登录我的登录页面并重定向到所需页面时,label-value
重置了.

请给我任何想法.


--- Anil Kumar
section to show user-name consistently.
But when we log on my login page and redirect to the desired page, the label-value
got reset.

Kindly give me any idea.


--- Anil Kumar

推荐答案

必须从母版页代码的Load事件设置标签值,并且不得在其他任何标签下使用页面.
The label value will have to be set from the Load event of the Master Page code, and not touched under any other page.


您好..
将标签值存储在会话中,并在Page_Lode事件中获取它,并将其设置为该标签文本..这是解决问题的方法. 一切顺利.
Hi there..
Store the label value in session and fetch it inside Page_Lode event and set it to that label text.. This is the solution of your problem..
All the best..


这篇关于asp.net母版页C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆