事件处理程序可能无法在默认文档不提出了IIS 7或IIS 7.5集成模式? [英] Event Handlers Might Not Be Not Raised in a Default Document in IIS 7 or IIS 7.5 Integrated Mode?

查看:255
本文介绍了事件处理程序可能无法在默认文档不提出了IIS 7或IIS 7.5集成模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

拉​​我的头发在过去三天我的第一个未升级的ASP.NET 4.0 Web应用程序后,我偶然发现这篇文章解释了这一切。

After pulling my hair out for the last three days in my first non-upgraded ASP.NET 4.0 Web Application, I stumble across this post explaining it all.

<一个href=\"http://jai-on-asp.blogspot.com/2010/06/changes-and-differences-between-aspnet.html\">http://jai-on-asp.blogspot.com/2010/06/changes-and-differences-between-aspnet.html根据标记部分:事件处理程序可能不能被在一个默认的文件中提出在IIS 7或IIS 7.5集成模式

显然,在这个地址的页面asp.net: http://www.mydomain.com/ 将不会发布回本身没有明确中加入行动=的Default.aspx的&LT;形式>标签

Apparently, an asp.net page at this address: http://www.mydomain.com/ will not post back to itself without explicitly adding action="default.aspx" in the <form> tag.

那么,当你使用一个母版页会发生什么(其中&LT;形式>标签是使用母版页时的位置)?

Well, what happens when you are using a Master Page (where the <form> tag is location when using Master Pages)?

我如何得到我的Default.aspx页面回发到自己在.NET 4.0中使用母版页?

How do I get my default.aspx pages to postback to themselves in .NET 4.0 using Master Pages?

推荐答案

不管的默认页面上指定的形式的,或在母版页的,它仍然是通过表格的属性的页面上访问。

Whether the form is specified on the default page, or in the master page, it is still accessible via the Form property on the page.

因此​​,你应该能够设置它的后面该页面的code动作。

Therefore, you should be able to set it's action in the code behind for that page.

protected void Page_Load(object sender, System.EventArgs e)
{
    this.Form.Action = "Default.aspx";
}

这篇关于事件处理程序可能无法在默认文档不提出了IIS 7或IIS 7.5集成模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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