加载母版页 [英] Load master page

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

问题描述

如何在提交按钮上加载母版页单击

How to load a master page on submit button click

protected void Go_Click(object sender, EventArgs e)
{
    Response.Redirect("~/MasterPage.master");
}



这样可以做到吗如果他是授权用户,则只有在他单击提交按钮之后他应该能够看到母版页之后,才会打开第一个登录表单.

请帮我..
在此先感谢.



is this possible to do like this. First login form will open after if he is an authorised user only he should be able to see the master page after clicking submit button.

help me pls..
Thanks in advance.

推荐答案

无法通过Response.Redirect(〜/MasterPage.master");
coz主页仅提供子页面的布局.

用母版页制作子页.如home.aspx

然后,如果用户登录成功,请写
Response.Redirect(〜/Home.aspx");
There is no way to pass Response.Redirect("~/MasterPage.master");
coz master page only provides layout to child pages.

Make child pages with master page .like home.aspx

Then if the user is login successfully write
Response.Redirect("~/Home.aspx");


您不能编写这样的代码.您需要导入母版页.

如果需要导入InnerMasterNew.master,请在重定向页面中使用下面的代码.

You cant write the code like that. You need to import master page.

If you need to import InnerMasterNew.master, then use the code below in your redirecting page.

this.MasterPageFile = "~/MasterPage/InnerMasterNew.master";



会起作用的.



it wil work.


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

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