ASP.Net主页面和内容页面 [英] ASP.Net master page and content page
本文介绍了ASP.Net主页面和内容页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在内容页面有一个登录界面,Aftre登录的值应该转到标签上的Master页面。
请给出一些解决方案........... ....
I have a login screen in the content page ,Aftre login the values should go to the Master page on the Label.
please give some solution...............
推荐答案
登录控件由微软发布,看看它们这里 [ ^ ]。
对于使用Login控件构建登录页面,请查看:
如何:创建ASP.NET登录页面 [ ^ ]
ASP.NET登录控件概述 [ ^ ]
如何将登录,角色和配置文件系统添加到ASP.NET 2.0 [< a href =http://weblogs.asp.net/scottgu/archive/2005/10/18/427754.aspxtarget =_ blanktitle =新窗口> ^ ]
如果需要更多,请从此处选择任何示例: Google搜索结果 [ ^ ]。
Login Controls were released by Microsoft, have a look at them here[^].
For, building Login Page using Login control, look:
How to: Create an ASP.NET Login Page[^]
ASP.NET Login Controls Overview[^]
How to add a Login, Roles and Profile system to an ASP.NET 2.0 [^]
If needed more, pick any example from here: Google Search result on the same[^].
使用 Master.FindControl 功能从内容页面中查找 MasterPage 控件。
试试这个:
Use Master.FindControl function to find the MasterPage controls from a content page.
Try this:
Label mpLabel = (Label)Master.FindControl("masterPageLabel");
if(mpLabel != null)
{
mpLabel.Text = "Your Text Here";
}
--Amit
--Amit
我不使用微软''登录控件。事实上,在专业级别,没有人使用微软的控件,而是根据他们的需要制作自己的用户控件。
我认为你的根源问题是将数据从内容页面传递到MasterPage。没有更多细节,我一半猜测你的需求。我会说登录页面可以创建一个会话(设置会话变量),所有父页面和子页面都应该能够访问你的会话变量。
I do not use Microsoft''s controls for logins. In fact, at the professional level, nobody uses Microsoft''s controls, but instead make their own user controls to fit their needs.
I think the root of you question goes to passing data from a content page to a MasterPage. Without more detail, I am half guessing on your needs. I would say that the login page can create a session (set a session variable) and all parent and child pages should be able to access your session variables.
这篇关于ASP.Net主页面和内容页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文