FineUI 官方论坛
标题:
Page_Load加载了两次(VS2013,Browser Link)
[打印本页]
作者:
gdcrx
时间:
2014-3-2 12:47
标题:
Page_Load加载了两次(VS2013,Browser Link)
如果不加Form验证,程序执行是正常的。加了Form验证后,Page_Load加载了两次。
通过下面几种方式找原因,没找出来,麻烦高手指点,谢谢。
1、因为页面加了验证码,怀疑是<img src=""这个原因引起,我把验证码的Image控件去掉,结果还是一样。
2、 把AutoEventWireup设置成"false",然后加了下面代码,也Page_Load还是加载两次。
override protected void OnInit(EventArgs e)
{
this.Load += new System.EventHandler(this.Page_Load);
}
3、利用【新手必备】FineUI 空项目(Net2.0 和 Net4.5 两个版本)
地址:
http://fineui.com/bbs/forum.php?mod=viewthread&tid=2123
用Net4.5这个项目,加了Form验证,Page_Load也是加载两次。
4、然后我把FineUI的Demo程序也启用了Form验证,Page_Load加载了6次。
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
InitMenuStyleButton();
InitLangMenuButton();
InitThemeMenuButton();
//// 显示源代码按钮
//btnSourceCode.OnClientClick = windowSourceCode.GetShowReference("./common/source.aspx?files=~/default.aspx;~/common/menu.xml;~/Web.config;~/Code/PageBase.cs;~/js/default.js;~/css/default.css");
}
}
5、Web.config的配置如下
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="FineUI" type="FineUI.ConfigSection, FineUI" requirePermission="false"/>
</configSections>
<!-- 可用的配置项(这里列的都是默认值): Language="zh_CN" AjaxTimeout="60" EnableAjax="true" Theme="Neptune" FormMessageTarget="Qtip" FormOffsetRight="20" FormLabelWidth="100" FormLabelSeparator=":" IconBasePath="~/icon" EnableAjaxLoading="true" AjaxLoadingType="default" CustomTheme="" CustomThemeBasePath="~/theme" -->
<FineUI DebugMode="false"/>
<appSettings/>
<connectionStrings/>
<system.web>
<pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID">
<controls>
<add assembly="FineUI" namespace="FineUI" tagPrefix="f"/>
</controls>
</pages>
<!--<httpModules>
<add name="FineUIScriptModule" type="FineUI.ScriptModule, FineUI"/>
</httpModules>-->
<httpRuntime maxRequestLength="102400 "/>
<customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.0"/>
<authentication mode="Forms">
<forms name=".ASPXFORMSAUTH" loginUrl="~/login.aspx" timeout="120" defaultUrl="~/default.aspx" protection="All" path="/"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
<location path="res.axd">
<system.web>
<authorization>
<allow users ="*" />
</authorization>
</system.web>
</location>
<location path="extjs">
<system.web>
<authorization>
<allow users ="*" />
</authorization>
</system.web>
</location>
<location path="captcha">
<system.web>
<authorization>
<allow users ="*" />
</authorization>
</system.web>
</location>
<location path="icon">
<system.web>
<authorization>
<allow users ="*" />
</authorization>
</system.web>
</location>
<!-- IIS7 Integrated Mode-->
<system.webServer>
<modules>
<add name="FineUIScriptModule" type="FineUI.ScriptModule, FineUI"/>
</modules>
<handlers>
<add name="FineUIResourceHandler" verb="GET" path="res.axd" type="FineUI.ResourceHandler, FineUI"/>
</handlers>
<httpErrors errorMode="Detailed"/>
<asp scriptErrorSentToBrowser="true"/>
</system.webServer>
</configuration>
作者:
sanshi
时间:
2014-3-2 13:05
请用【新手必备】FineUI 空项目 创建重现问题的示例,给出具体的操作步骤
作者:
gdcrx
时间:
2014-3-2 14:17
多谢回复!
最后发现是我开发环境的问题,我在VS2010下重新建了测试项目运行正常。
新装的VS2013,有个Browser Link功能引起脚本错误,又重定向到登陆页面了!
[attach]4559[/attach]
找到Enable Browser Link选项,将其左边的钩钩去掉就可以了!
[attach]4558[/attach]
作者:
sanshi
时间:
2014-3-2 14:21
好的,经验之谈
欢迎光临 FineUI 官方论坛 (https://www.fineui.com/bbs/)
Powered by Discuz! X3.4