Ajax : 使用 UpdatePanel 后页面弹出的语法改变

Ajax : 使用 UpdatePanel 后页面弹出的语法改变

 

1.Response.Write("");

变为:

System.Web.UI.ScriptManager.RegisterStartupScript(btnconfirm, this.GetType(), "btnconfirm", "alert('注册失败');", true);

btnconfirm 为控件名称)

2.Page.RegisterStartupScript("","");

变为:

System.Web.UI.ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "", " window.close('Register_Detail_forMember.aspx');", true);

3.要使用 Response.Redirect("Index.aspx");需要在web.config中加入这么一段:

<system.web>

  ………

<httpModules>

    <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

httpModules>

4. web.config

 

 

xml version="1.0"?>

<configuration>

    <connectionStrings/>

    <system.web>

        <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="GET" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler" 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>

 

       

        <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>

        <compilation debug="true">

            <assemblies>

                <add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

                <add assembly="CrystalDecisions.ReportSource, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

                <add assembly="CrystalDecisions.Shared, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

                <add assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

                <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

                <add assembly="CrystalDecisions.Enterprise.Framework, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

                <add assembly="CrystalDecisions.Enterprise.InfoStore, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

                <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

                <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

                <add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

                <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>assemblies>compilation>

       

        <authentication mode="Windows"/>

       

       

        <customErrors mode="Off"/>

    system.web>

    <location allowOverride="true" inheritInChildApplications="true">

        <appSettings>

            <add key="SqlStr" value="server=10.108.14.31;database=lvgu;uid=sa;pwd=sa;pooling=true"/>

            <add key="CrystalImageCleaner-AutoStart" value="true"/>

            <add key="CrystalImageCleaner-Sleep" value="60000"/>

            <add key="CrystalImageCleaner-Age" value="120000"/>

        appSettings>

    location>

configuration>

 

 

      

 

你可能感兴趣的:(Ajax : 使用 UpdatePanel 后页面弹出的语法改变)