vs2003 转换过程 vs2010 过程

一、       转4.0 Web应用程序步骤... 1

1.1      转换... 1

1.2      关于TreeView的修改... 1

1.3      替换工作... 2

1.4      关于ReadOnly的修改... 3

1.4.1       发现的现象... 3

1.4.2       怎么修改... 4

1.5      Web.config. 5

1.5.1       web.config 解决微软大数据提交出错的问题... 5

1.5.2       web.config 解决ajax回发出脚本提示的问题。... 6

1.5.3       globalization. 6

1.5.4       验证... 6

1.6      列表布局... 6

1.7      为ajax做准备... 7

1.8      Qwin.js. 9

1.9      验证控件... 9

1.10        可以不做,最好做... 9

1.10.1     把常用类加入新的Dll 9

1.10.2     日志和调试Log4net 9

1.10.3     Ajax选择器,弹出的时候比别的慢... 10

1.11     关于Vss. 10

二、       如果转为网站看看这里... 10

三、       Ajax应用看看这里... 12

一、   转4.0 Web应用程序步骤

1.1     转换

先转vs2010,转换为web应用程序,再把 .resx 的文件删除,再把“Bsdqpqx.csproj”里的类似这样的

 <EmbeddedResource Include="Zzcx\ZhuangPeiShow.aspx.resx">

      <DependentUpon>ZhuangPeiShow.aspx.cs</DependentUpon>

</EmbeddedResource>

全部删除

1.2     关于TreeView的修改

       对于*.aspx;*.cs文件,选上全字匹配

1)        建议依然引用原来的微软自带的控件TreeView 和 TreeNode和TreeNodeCollection,原来的命名空间加上前缀   Microsoft.Web.UI.WebControls.TreeView

2)        iewc:Microsoft.Web.UI.WebControls.TreeView 替换为 iewc:TreeView

3)        lb_top == "Microsoft.Web.UI.WebControls.TreeNode" 替换为 lb_top == "TreeNode"

 

1.3     替换工作

1)        msg = msg; 替换为"";

2)        添加引用“Configuration”

3)        ConfigurationSettings 替换为 ConfigurationManager

4)        IsStartupScriptRegistered 替换为ClientScript.IsStartupScriptRegistered

5)        RegisterStartupScript 替换为ClientScript.RegisterStartupScript this.GetType()

6)        GetPostBackEventReference 替换为 ClientScript.GetPostBackEventReference

7)        用工具将未自动转(datagrid和分页控件)的事件转过去,工具“转换DataGrid_aspnetPager事件工具”,然后全局检查void InitializeComponent() 对不对,如果有打不开的页面方法:直接改文件中的类名+”1”

8)        将cs 文件中,private 都替换为 protected

9)        分页控件,要换成“AspNetPager732DLL.rar”,删除原来的引用,换成这个

10)     cs文件中Wuqi.Webdiyer.PageChangedEventArgs 替换为 System.EventArgs;

11)     cs文件中 int currPageIndex=e.NewPageIndex; 替换为 ""

12)     cs文件中 AspNetPager1.CurrentPageIndex = currPageIndex; 替换为""

13)     cs文件中 BindDataList(currPageIndex 替换为 BindDataList(AspNetPager1.CurrentPageIndex

14)     pubfunc.cs中

a)         AspNetPager.CustomInfoText 替换为AspNetPager.CustomInfoHTML,

b)        InputBox 替换为PageIndexBox

c)        CustomInfoText 替换为 CustomInfoHTML

d)        CustomInfoHTMLAlign 替换为 CustomInfoTextAlign

e)         SetPageSizeCss 增加

a)         AspNetPager.FirstPageText = "<font face="webdings">9</font>";

b)        AspNetPager.LastPageText = "<font face="webdings">:</font>";

c)        AspNetPager.PrevPageText = "<font face="webdings">3</font>";

d)        AspNetPager.NextPageText = "<font face="webdings">4</font>";

e)         AspNetPager.LayoutType = Wuqi.Webdiyer.LayoutType.Table;

15)     AspNetPager.PageIndexBoxType=Wuqi.Webdiyer.PageIndexBoxType.DropDownList;

16)     freetextbox 在设计界面出错,但不影响运行

17)     当有中文的时候报脚本错误,是因为 js 文件本身不是utf-8格式的,转成即可用转换工具“E:\work\2007-1-30After\Source\软件移植功能,文档\1.0转2.0\转换DataGrid_aspnetPager事件工具\bin\Debug\TextReplace.exe”

修改方法的文件,先把baseModels,rptModels,rptStructs这3个文件夹剪切出去,再替换 js aspx,cs htc

 Encoding.GetEncoding("gb2312")

  在qkeyin.cs 中搜索gb2312 改为 utf-8

error.aspx

   strErrorMessage 判断下 strErrorMessage == null

   public static string strErrorMessage=""

 

18)     Qwinpanel.aspx的#6e94c5 改为 white

19)      

37.dgList$ctl04$lbtnKehu 选择器全选报错

  1.  __ctl2 应换为 _ctl02

     __ctl"+i 替换为

     __ctl"+String(i) 替换为 _ctl" + (parseInt(i,10) < 10 ? "0" + String(parseInt(i,10)) : String(i))

 

 

     __ctl"+String(index) 替换为 _ctl" + (parseInt(index,10) < 10 ? "0" + String(parseInt(index,10)) : String(index))

     $_ctl" + String(index)  替换为 $ctl" + (parseInt(index,10) < 10 ? "0" + String(parseInt(index,10)) : String(index))

  

 

     __ctl"+HangHao 替换为

 

     __ctl"+String(HangHao) 替换为 _ctl" + (parseInt(HangHao,10) < 10 ? "0" + String(parseInt(HangHao,10)) : String(HangHao))

     JScriptFuncMoveCursor.js 特殊处理

      var id = objId.replace(HangHao,String(parseInt(HangHao) + 1)); 替换为

               var HangHao1 = String(parseInt(HangHao,10) + 1);

                HangHao1 = (parseInt(HangHao1,10) < 10 ? "0" + String(parseInt(HangHao1,10)) : String(HangHao1)) ;

                var id = objId.replace(HangHao, HangHao1);

 

      var id = objId.replace(HangHao,String(parseInt(HangHao) - 1)); 替换为

           var HangHao1 = String(parseInt(HangHao,10) + 1);

         HangHao1 = (parseInt(HangHao1,10) < 10 ? "0" + String(parseInt(HangHao1,10)) : String(HangHao1));

      var id = objId.replace(HangHao, HangHao1);

1.4     关于ReadOnly的修改

1.4.1        发现的现象

A.当界面中如果有readonly 为 true 的控件或者在后台把文本框的 readonly=true 赋值为 true 那么后台取不到前台改变的文本框的值,

    B.改为 txtKehu_dm.Attributes.Add( "readonly",   "true") 这种方式给在后台修改只读后,可以在后台取到值,但是又不能通过后台readonly=false 和 Attributes.Add( "readonly",   "false"),这2中方式改变控件为不只读,前台readOnly=false修改为不只读后,后台依然取不到值,

    C.所以对于后台用readonly=true 的情况,都要这样解决,前台的ReadOnly属性改为false,后台的readonly=true改为.Attributes.Add("ContentEditable", "false");或者Add("readonly", "true");  而readonly=false 改为.Attributes.Add("ContentEditable", true);前台使用这个属性也可以ContentEditable。

    D.以后最好还是前台控制文本框的只读

1.4.2           怎么修改

    对于咱们现在的版本按下面的修改吧

    所有cs文件中的readonly都要用 txtKehu_dm.Attributes.Add("readonly", "true");//代替readonly,不要用readonly了以便后台可以取;txtKehu_dm.ReadOnly =true;和txtKehu_dm.ReadOnly=true;注意等号左右的空格 这句保存的时候会出错应改为(2.0以后的版本,1.1的没事) txtKehu_dm.Attributes.Add( "readonly",   "true")     txtKehu_no.ReadOnly = true;和txtKehu_no.ReadOnly = true;注意等号左右的空格 这句保存的时候会出错应改为(2.0以后的版本,1.1的没事) txtKehu_no.Attributes.Add( "readonly",   "true")

    洗车单特殊处理 

    ChangePageState 函数里的 PubFunc.setTextBox(Page,true,false)改为PubFunc.setTextBox(Page,false,false)

    然后在ChangeMenu函数里加上

            txtKehu_no.Attributes.Add("readonly", "true");

            txtCard_kind.ReadOnly = true;

            txtCard_enddate.ReadOnly = true;

            txtCard_lx.ReadOnly = true;

            txtCard_cs.ReadOnly = true;

            txtCard_useje.ReadOnly = true;

            txtCard_leftje.ReadOnly = true;

    对于销售单,销退单等单据上的 统一替换ReadOnly=True ForeColor="DarkGray" 和ForeColor="DarkGray" ReadOnly=True 为 contentEditable="false" ForeColor="DarkGray"     用再正则表达式搜索检查漏掉的

    \<asp\:TextBox[^)]+ReadOnly[^)]+text='\<%# 搜索,结果1个1个修改吧 ReadOnly =true 的要改为 contentEditable="false"

   

 

    对于新建会员卡cardedit.aspx,选择车辆,界面上的txtChe_no ReadOnly =true 的要改为 contentEditable="false",后台bindText

    else if (sState == "new")   txtChe_no.ReadOnly = true;这句屏蔽

   if (sState == "edit")

                     {

   加上           txtChe_no.ReadOnly = false;

}

 

 

    对于 WxHuiFangDanNew 界面 , 这些文本框的只读属性去掉,ispostback 增加下面的代码

     //qzf 2012-2-29

                txtkehu_mc.Attributes.Add("readonly", "true");

                txtKehu_xm.Attributes.Add("readonly", "true");

                txtkehu_dh.Attributes.Add("readonly", "true");

                txtwork_no.Attributes.Add("readonly", "true");

                txtwork_rq.Attributes.Add("readonly", "true");

                txtche_no.Attributes.Add("readonly", "true");

    对于 KhGyshRelateSearch.aspx txtKehu_no 和 txtGys_no的只读去掉

 

对于ZhuangPei.aspx 去掉 OnPageIndexChanged="dgList_PageIndexChanged"

对于YeJi/yuangong.aspx  ddlGZRY.SelectedIndex = 0 改为 if (ddlGZRY.Items.Count>0)ddlGZRY.SelectedIndex = 0;

对于WxHuiFangTiXing.aspx dgList_ItemCommand kehu_mc参数加encode

   PubFunc.jsShowModal("WxHuiFangDanNew.aspx?kehu_mc=" + Server.UrlEncode(strKehu_mc) + "&Kehu_xm=" + Server.UrlEncode

(strKehu_xm) + "&kehu_dh=" + Server.UrlEncode(strkehu_dh) + "&work_no=" + strwork_no + "&work_rq=" + strwork_rq + "&che_no="

+ Server.UrlEncode(strche_no), "", 510, 560);

 

 对于  WxHuiFangDanNew.aspx 接收kehu_mc 改为decode

对于拆装文件夹下4个查询  ,BindDdl 里的函数  PubFunc.BindGongSiDeptJb(ddlGongSi,null, null);改为

     PubFunc.BindGongSiDeptJb(ddlGongSi, ddlDept_mc, ddlJb); 

对于BtnBehavior.htc 的引用他的地方去掉吧

1.5     Web.config

1.5.1        web.config 解决微软大数据提交出错的问题

 <appSettings>

         <add key="aspnet:MaxHttpCollectionKeys" value="5000" />

      </appSettings>

支持 2.0 的类库

<startup useLegacyV2RuntimeActivationPolicy="true">

    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>

    <requiredRuntime version="v1.1.4322"/>

</startup>

 

 

 

1.5.2        web.config 解决ajax回发出脚本提示的问题。

 <pages validateRequest="false" enableEventValidation="false" >

<compilation defaultLanguage="c#" debug="true" targetFramework="4.0">

                     <assemblies><add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral,

PublicKeyToken=31bf3856ad364e35"/></assemblies></compilation>

 

  去掉authentication

  去掉 trace

  去掉sessionState节点

1.5.3        globalization

web.config 改为<globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="gb2312" culture="zh-cn"/>  再确认,否则ajax数据提交的时候乱码

1.5.4        验证

在全局级别(Web.config中)设置

<configuration>

    <system.web>

        <pages validateRequest="false">

 

但是,以上设置仅对ASP.NET4.0以上有效。在ASP.NET4.0版本上,我们需要更多一行的配置:

 

在全局级别(Web.config中)设置

<configuration>

    <system.web>

        <httpRuntime requestValidationMode="2.0">

 

 

1.6     列表布局

列表布局显示不出来了,或者直接考“E:\work\2007-1-30After\Source\软件移植功能文档\1.0转2.0\TableLayout”

  这样修改

  LayoutBase.cs 文件 395920986

  EditDataGridLayout

  {

   ...

      HttpContext.Current.Server.UrlEncode(_strCaozuoyuan)

   ...

  }

 

  TableListControl.aspx文件

    1.public void Page_Load(Object src,EventArgs e)

    {

      strcaozuoyuan= HttpContext.Current.Server.UrlDecode(Request["strcaozuoyuan"].ToString());

    }

    2.<form  action="TableListControlExe.aspx?formname=<% =formname %>&gridname=<% =gridname %

>&shuaxin=<% =shuaxin%>&strcaozuoyuan=<%=HttpContext.Current.Server.UrlEncode(strcaozuoyuan)%>&Rows=<% = tmpRowsCount%>"

method="post" name="Form1" target=_self>其中 strcaozuoyuan 要编码

   TableListControlExe.aspx

   Page_Load

     {

        strcaozuoyuan = HttpContext.Current.Server.UrlDecode(Request["strcaozuoyuan"].ToString());

     }

 

1.7     为ajax做准备

为ajax 做好准备应将 pubfunc  中所有的Response.Write,替换为 ajax输出(excel 导出除外),注意最后要加“;”,不能要script节点,

切记,如果本页面使用ajax,那么也要将Response.Write,替换为 ajax 输出;  注意,

System.Web.UI.ScriptManager.RegisterStartupScript(page, page.GetType(), "s2", msg, true);其中的S2,是关键字,尽量不要相同,如

果输出了1次,就不会输入出了,造成第2次执行的脚本不输出

  否则,不能将原来的response.write都替换为ajax输出,像进货单执行OutPutDecDigitsUsedByJs,再执行选择供应商,供应商选择器出不来

 

#region 弹出窗口

        //弹出窗口,ajax可用

        public static void AjaxAlert(string msg)

        {

            System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;

            System.Web.UI.ScriptManager.RegisterStartupScript(page, page.GetType(), "ajaxShowMessage", "alert('" + msg +

"');", true);

        }

        //弹出窗口并跳转页面,ajax可用

        public static void AjaxLocation(string msg, string url)

        {

            System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;

            System.Web.UI.ScriptManager.RegisterStartupScript(page, page.GetType(), "ajaxLocation", "alert('" + msg +

"');window.location.href= '" + url + "';", true);

        }

        //执行脚本,ajax可用

        public static void AjaxJs(string msg)

        {

            System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;

            System.Web.UI.ScriptManager.RegisterStartupScript(page, page.GetType(), "ajaxJs"+(new Random()).Next(100000),

msg, true);

        }

        //执行confirm点确定跳转到相应页面,ajax可用

        public static void AjaxConfirm(string info, string url)

        {

            System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;

            System.Web.UI.ScriptManager.RegisterStartupScript(page, page.GetType(), "ajaxConfirm", "if(confirm('" + info +

"')){window.location.href='" + url + "';}", true);

        }

        //执行confirm,点确定执行脚本,点否执行另外脚本,ajax可用

        public static void AjaxConfirm(string info, string tjs, string fjs)

        {

            System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;

            System.Web.UI.ScriptManager.RegisterStartupScript(page, page.GetType(), "ajaxConfirm1", "if(confirm('" + info +

"')){" + tjs + "}else{" + fjs + "}", true);

        }

        #endregion

1.8     Qwin.js

Qwin.js 拖拽的table 增加 style='background-color:#d4d0c8'

1.9     验证控件

验证控件,在 .net 4.0 的条件下,xp sp2报错 xp sp3 没事。不知道为什么

1.10         可以不做,最好做

1.10.1   把常用类加入新的Dll

1)        把解决方案,bsdqpqx48的上层目录

2)        上层目录加入BLL文件夹,新建工程BLL,把常用类和业务类放入之中,引用相应的类库

1.10.2   日志和调试Log4net

加入log4net 记录日志。

a)         在Lib 加入 log4net.dll

b)        在Bsdqpqx工程中加入 Config 文件夹,里面有这个文件“Log4Net.config”

c)        在Bsdqpqx工程加入 log 文件夹,,

d)        在system里加入“log.aspx”

e)         在Global.asax.cs Application_Start 加入PubFunc.ConfigLog()

在要使用的类中加入

       public static readonly log4net.ILog loger = LogManager.GetLogger(typeof(PubFunc));

      loger.Error("数据源:" + e.Source + "错误信息:" + e.Message + "错误方法:" + e.TargetSite + "错误数据:" + e.Data);

f)         在PubFunc.cs 加入

     #region log 配置

        public static readonly log4net.ILog loger = LogManager.GetLogger(typeof(PubFunc));

        public static void ConfigLog()

        {

            string ss = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;

            System.IO.FileInfo FiLog4Net = new System.IO.FileInfo(AppDomain.CurrentDomain.SetupInformation.ApplicationBase +

@"\Config\Log4Net.config");

            log4net.Config.XmlConfigurator.Configure(FiLog4Net);

 

        }

        #endregion

1.10.3   Ajax选择器,弹出的时候比别的慢

修改选择器Ajax 选择器

    1.建议先不修改界面ajax,改动的地方比较多

    2.具体选择器修改的地方

1)        界面上的 DataGrid 要换成 GridView,因为DataGrid 不触发sort事件

2)        界面上的 updatePanel ,同时应用几个 updatepanel ,每个panel只更新自己的,还要配合 hdn 和 按钮。

                         i.              C.GridView ViewState 如果改为 false   ,除了sort事件,其他事件失效,我现在点击行,调用按钮

3)        pubfunc 中 gridview 的排序,分页,合计

4)        TableLayout 文件夹直接换了吧

5)        增加 gvStyle.css

6)        绑定明细也改为用分页存储过程调用。

7)        GridView.JS,需要引用jquery

1.11         关于Vss

建立的vss 程序,可以直接拷贝到别人的机子上建立web共享,打开解决方案即可

  

二、   如果转为网站看看这里

 

1.Codebehind 改为 codeFile

2.删除控件声明

3.所有aspx 控件的在aspx 页面加入事件,原来cs 中事件 private 改为 protected  -------比较麻烦,

  如果不做这一步,在原有控件上双击按钮会增加新的事件,生成项目的时候,出错;新增加的按钮,双击在aspx 页面加入事件,但是"Web

窗体设计器生成的代码"oninit里面没有

3.当AutoEventWireup 为 false (vs2003 是false),page_load 不执行;当为true ,可以删除Web 窗体设计器生成的代码 OnInit

4.未将对象引用到实例,必须删除" Web 窗体设计器生成的代码"

  或者,但是,这段会影响以后的新控件,添加事件的开发

   A. override protected void OnInit(EventArgs e) 函数改为

   if (!this.DesignMode)

    {

            InitializeComponent();

            base.OnInit(e);

    }

5.删除resx

6.aspx 中 AutoEventWireup 由 false 改为 "true"

7.好处,发布的时候,加密aspx

8.写的类 app_code

---没有bin

 

手动复制到vs2010里

项目:web 应用程序

如果不在 vs2010 转换为web应用程序

1.命名空间要一致,就能打开

2.不用删除控件声明,但是新增加的控件,也没有出现在控件声明中,如果不在 vs2010 转换为web应用程序 we

3.所有aspx 控件的在aspx 页面加入事件,原来cs 中事件 private 改为 protected  -------比较麻烦,

  如果不做这一步,在原有控件上双击按钮会增加新的事件,生成项目的时候,出错;新增加的按钮,双击在aspx 页面加入事件,但是"Web

3.当AutoEventWireup 为 false (vs2003 是false),page_load 不执行;当为true ,可以删除Web 窗体设计器生成的代码 OnInit

4.未将对象引用到实例,必须删除" Web 窗体设计器生成的代码"

  或者,但是,这段会影响以后的新控件,添加事件的开发,可能只有datagrid 是这样

   A. override protected void OnInit(EventArgs e) 函数改为

   if (!this.DesignMode)

    {

            InitializeComponent();

            base.OnInit(e);

    }

 

如果在 vs2010 转换为web应用程序

1.命名空间不一致,也能打开页面

 

自动转换

1.       命名空间要一致,就能打开

====================但是商用,乘用按项目分,又不好建立网站

 

 

及时编译,

 

 

1.当按钮在 updatepanel 外部,指定

 <Triggers >

       <asp:AsyncPostBackTrigger ControlID ="Button1" />

 </Triggers>

 后,也是无刷新。

总结:对于updatepanel外部的控件在后台修改后,不会更新回来;

      对于updatepanel内部的控件在后台修改后,会更新回来;

 

2.用 enableviewstate 设置为false ,可以通过 Request.Form["控件名"]获取

 

 

4.DataGrid 问题

   A. override protected void OnInit(EventArgs e) 函数改为

   if (!this.DesignMode)

    {

            InitializeComponent();

            base.OnInit(e);

    }

   B.DataGrid 事件的声明 private 改为 protected

======================================================================================================================

 

 

 

 

 

三、   Ajax应用看看这里

 

-----------------------ajax 修改相关-------------------------------

 

1)        对于导出excel和打印按钮,要用

  <Triggers>

        <asp:PostBackTrigger ControlID = "btnCsv"/>

        <asp:PostBackTrigger ControlID = "btnpreview"/>

        </Triggers>

  还是保留回发

2)        PubFunc.ReturnArrTextBoxName(Page) 如果放置了UpdatePanel1,应该为PubFunc.ReturnArrTextBoxName(UpdatePanel1)

3)        应将 pubfunc  中所有的Response.Write,替换为 ajax输出,不能要script节点,切记,如果本页面使用ajax,那么也要将Response.Write,替换为 ajax 输出;  注意, System.Web.UI.ScriptManager.RegisterStartupScript(page, page.GetType(), "s2", msg, true);其中的S2,是关键字,尽量不要相同,如果输出了1次,就不会输入出了,造成第2次执行的脚本不输出 否则,不能将原来的response.write都替换为ajax输出,像进货单执行OutPutDecDigitsUsedByJs,再执行选择供应商,供应商选择器出不来

4)        Ajax 脚本输出函数

#region 弹出窗口

        //弹出窗口,ajax可用

        public static void AjaxAlert(string msg)

        {

            System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;

            System.Web.UI.ScriptManager.RegisterStartupScript(page, page.GetType(), "ajaxShowMessage", "alert('" + msg +

"');", true);

        }

        //弹出窗口并跳转页面,ajax可用

        public static void AjaxLocation(string msg, string url)

        {

            System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;

            System.Web.UI.ScriptManager.RegisterStartupScript(page, page.GetType(), "ajaxLocation", "alert('" + msg +

"');window.location.href= '" + url + "';", true);

        }

        //执行脚本,ajax可用

        public static void AjaxJs(string msg)

        {

            System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;

            System.Web.UI.ScriptManager.RegisterStartupScript(page, page.GetType(), "ajaxJs"+(new Random()).Next(100000),

msg, true);

        }

        //执行confirm点确定跳转到相应页面,ajax可用

        public static void AjaxConfirm(string info, string url)

        {

            System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;

            System.Web.UI.ScriptManager.RegisterStartupScript(page, page.GetType(), "ajaxConfirm", "if(confirm('" + info +

"')){window.location.href='" + url + "';}", true);

        }

        //执行confirm,点确定执行脚本,点否执行另外脚本,ajax可用

        public static void AjaxConfirm(string info, string tjs, string fjs)

        {

            System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;

            System.Web.UI.ScriptManager.RegisterStartupScript(page, page.GetType(), "ajaxConfirm1", "if(confirm('" + info +

"')){" + tjs + "}else{" + fjs + "}", true);

        }

        #endregion

 

 

5)        发送短信的界面好像有问题(选择多个客户)

6)        4.为了保证布局 ,滚动条不动,应用ajax的时候,应该执行以下查询,updatepanel应放到 <div  autodiv >里面 而且必须放置静态 <div  autodiv >

7)        现在用了 htc 文件,导致使用ajax后,还是有进度条显示;脚本没有问题

8)          把这个加在,scriptmanager 后<script type="text/javascript">

         Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function () {//任何updatepanel 更新的时候都会执行

 

             doContentreadyForTable();//函数体,可以放到日历控件中

         }

 

    );

    </script>

9)         考虑改为脚本处理颜色样式

10)       配件选择器,加了ajax后,关闭的时候特别慢,不知道为什么。showmodal 阻止页面回发

11)       div有滚动条第1次,滚动条回到最上面。因为,div 回发了。

12)       htc对于页面呈现比较慢

13)       页面之中有图片的话,也会有进度条的

14)       ----总结页面之中最好不要有htc,图片少些,用脚本替代

15)     linkbutton .ajax2.0 bug ,按钮:如linkbutton 通过脚本调用另1个按钮点击,不能执行第2个按钮的后台事件,前台的可以执行。但是pageload里,可以执行调用按钮的点击事件

 

16)     8.对于选择器按钮,应设置 前台事件,不执行后天事件

   A.需要控制按钮的可用

   B.showmodal 会卡,无刷新放置了后会卡;最好是前台输出,否则关闭时数据量大的时候卡。showmodal 阻止页面回发

   C.传值

   E.怎么保存页面

   D.第1个按钮,调用另1个按钮的情况很多。

17)     session 丢失后,会出现脚本错误,ajaxtimer不写事件即可

18)     对于无刷新,脚本的输出不会反应出来

19)     验证控件,__postback的脚本会发生变化。

20)     放多个updatepanel 比放1个要快,当单据数据多的时候,合理放置updatepanel ,比如:保存按钮放updatepanel1,datagrid放

20)

21)     updatepanel2,保存中的验证不需要刷新datagrid

 

 

 

 

 

=====================web.config 2.0==============================

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <!--微软树控件-->
  <configSections>
    <section name="MicrosoftWebControls" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  </configSections>
  <MicrosoftWebControls>
    <add key="CommonFiles" value="../Images/Tree">
    </add>
  </MicrosoftWebControls>
  <!--微软树控件-->
  <system.web>
    <compilation defaultLanguage="c#" debug="true" >
      <assemblies>
        <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </assemblies>
    </compilation>
    <customErrors mode="RemoteOnly" />
    <identity impersonate="false" />
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="gb2312" culture="zh-cn"/>

   <httpRuntime requestValidationMode="2.0"/>
    <pages validateRequest="false" enableEventValidation="false" >
      <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </controls>
    </pages>
    <httpHandlers>
      <remove verb="*" path="*.asmx"/>
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
    </httpHandlers>
    <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>
  </system.web>
  <appSettings>
    <add key="aspnet:MaxHttpCollectionKeys" value="5000" />
    <add key="connString" value="packet size=4096;Max Pool Size=512;user id=sa;data source=localhost;persist security info=True;initial catalog=master;password=pwd" />
    <add key="serverName" value="(local)" />
    <add key="userName" value="sa" />
    <add key="serverPassword" value="" />
    <add key="dbName" value="bs2s48" />
    <add key="admin" value="admin" />
    <add key="adminPwd" value="1234" />
    <add key="MaxOnLineCount" value="5" />
    <add key="DaoqiRiqi" value="2011-12-26" />
    <add key="GongNeng" value="ABC" />
    <add key="DianShu" value="5" />
  </appSettings>
</configuration>

===================================web.config 4.0==================================

<?xml version="1.0"?>
<configuration>
 <!--微软树控件-->
 <configSections>
  <section name="MicrosoftWebControls"

type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,

Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
 </configSections>
 <MicrosoftWebControls>
  <add key="CommonFiles" value="../Images/Tree">
  </add>
 </MicrosoftWebControls>
 <!--微软树控件-->
 <system.web>
  <compilation defaultLanguage="c#" debug="true" targetFramework="4.0">
   <assemblies><add assembly="System.Web.Extensions, Version=4.0.0.0,

Culture=neutral, PublicKeyToken=31bf3856ad364e35"/></assemblies></compilation>
    
  <customErrors mode="RemoteOnly"/>
  <identity impersonate="false"/>
  <globalization requestEncoding="utf-8" responseEncoding="utf-8"

fileEncoding="gb2312" culture="zh-cn"/>
  <pages validateRequest="false" enableEventValidation="false"

controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
  </pages>
 </system.web>
 <appSettings>
  <add key="aspnet:MaxHttpCollectionKeys" value="5000"/>
  <add key="connString" value="packet size=4096;Max Pool Size=512;user

id=sa;data source=localhost;persist security info=True;initial catalog=master;password=pwd"/>
  <add key="serverName" value="(local)"/>
  <add key="userName" value="sa"/>
  <add key="serverPassword" value=""/>
  <add key="dbName" value="bs2s48"/>
  <add key="admin" value="admin"/>
  <add key="adminPwd" value="1234"/>
  <add key="MaxOnLineCount" value="5"/>
  <add key="DaoqiRiqi" value="2011-12-26"/>
  <add key="GongNeng" value="ABC"/>
  <add key="DianShu" value="5"/>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值