FineUI 官方论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

本论坛已关闭(禁止注册、发帖和回复)
请移步 三石和他的朋友们

FineUI首页 WebForms - MVC & Core - JavaScript 常见问题 - QQ群 - 十周年征文活动

FineUI(开源版) 下载源代码 - 下载空项目 - 获取ExtJS - 文档 在线示例 - 版本更新 - 捐赠作者 - 教程

升级到 ASP.NET Core 3.1,快、快、快! 全新ASP.NET Core,比WebForms还简单! 欢迎加入【三石和他的朋友们】(基础版下载)

搜索
查看: 6339|回复: 3
打印 上一主题 下一主题

Page_Load加载了两次(VS2013,Browser Link)

[复制链接]
跳转到指定楼层
楼主
发表于 2014-3-2 12:47:12 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
如果不加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>

沙发
发表于 2014-3-2 13:05:13 | 只看该作者
请用【新手必备】FineUI 空项目 创建重现问题的示例,给出具体的操作步骤
板凳
 楼主| 发表于 2014-3-2 14:17:57 | 只看该作者
多谢回复!
最后发现是我开发环境的问题,我在VS2010下重新建了测试项目运行正常。
新装的VS2013,有个Browser Link功能引起脚本错误,又重定向到登陆页面了!

找到Enable Browser Link选项,将其左边的钩钩去掉就可以了!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
地板
发表于 2014-3-2 14:21:57 | 只看该作者
好的,经验之谈
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|FineUI 官方论坛 ( 皖ICP备2021006167号-1 )

GMT+8, 2024-5-10 19:24 , Processed in 0.047988 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表