一个Div导致Ajax中UpdatePanel以外的数据执行操作的时候全部消失2012-03-25 10:05

原创 2012年03月25日 11:21:05

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
    <title></title>

    <style type="text/css">
        .style1
        {
            width: 824px;
        }
        .style2
        {
            width: 158px;
        }
        .style3
        {
            width: 305px;
        }
    </style>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div>
                <asp:TextBox ID="txtSay" runat="server" Height="117px" TextMode="MultiLine" Width="359px"></asp:TextBox><br />
            </div>
          <%-- <div> --%>
                 浏览总数: <asp:Label ID="asdf" runat="server" Text="Label" Font-Bold="True" Font-Size="Larger"
                    ForeColor="#CC0000" ></asp:Label>
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="884px">
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <table class="style1">
                                    <tr>
                                        <td style="background-color: #eee;" class="style3">
                                            昵称:<%# Eval("username") %></td>
                                    </tr>
                                    <tr>
                                        <td style="background-color: Aqua;" class="style3">
                                            内容:<%# Eval("content") %></td>
                                    </tr>
                                    <tr>
                                        <td class="style3">
                                            时间:<%# Eval("timespan")%>分钟之前
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="link1" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="link2" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="link3" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="link4" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
 
             <asp:Button ID="btn1" runat="server" Text="Button" onclick="btn1_Click" />
            <asp:LinkButton ID="link1" runat="server" OnClick="LinkButton1_Click">第一页</asp:LinkButton>
            <asp:LinkButton ID="link2" runat="server" OnClick="LinkButton2_Click">下一页</asp:LinkButton>
            <asp:LinkButton ID="link3" runat="server" OnClick="LinkButton3_Click">上一页</asp:LinkButton>
            <asp:LinkButton ID="link4" runat="server" OnClick="LinkButton4_Click">末页</asp:LinkButton>
  

    </form>
    </body>
</html>

 

以上是正确的执行的

以下是出现问题的:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
    <title></title>

    <style type="text/css">
        .style1
        {
            width: 824px;
        }
        .style2
        {
            width: 158px;
        }
        .style3
        {
            width: 305px;
        }
    </style>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div>             <%-- <问题所在就是这里> --%> 

                <asp:TextBox ID="txtSay" runat="server" Height="117px" TextMode="MultiLine" Width="359px"></asp:TextBox><br />
            </div>
              <div>    

                 浏览总数: <asp:Label ID="asdf" runat="server" Text="Label" Font-Bold="True" Font-Size="Larger"
                    ForeColor="#CC0000" ></asp:Label>
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="884px">
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <table class="style1">
                                    <tr>
                                        <td style="background-color: #eee;" class="style3">
                                            昵称:<%# Eval("username") %></td>
                                    </tr>
                                    <tr>
                                        <td style="background-color: Aqua;" class="style3">
                                            内容:<%# Eval("content") %></td>
                                    </tr>
                                    <tr>
                                        <td class="style3">
                                            时间:<%# Eval("timespan")%>分钟之前
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="link1" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="link2" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="link3" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="link4" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
 
             <asp:Button ID="btn1" runat="server" Text="Button" onclick="btn1_Click" />
            <asp:LinkButton ID="link1" runat="server" OnClick="LinkButton1_Click">第一页</asp:LinkButton>
            <asp:LinkButton ID="link2" runat="server" OnClick="LinkButton2_Click">下一页</asp:LinkButton>
            <asp:LinkButton ID="link3" runat="server" OnClick="LinkButton3_Click">上一页</asp:LinkButton>
            <asp:LinkButton ID="link4" runat="server" OnClick="LinkButton4_Click">末页</asp:LinkButton>
  

    </form>
    </body>
</html>

位图的像素操作练习(2012-05-25)

很久没有较长篇的代码练习了,今天偷闲回顾练习了一下位图文件的像素操作,备忘,参考了: 水平翻转,垂直翻转,转灰度: void BMPOpt(){ BITMAPFILEHEADER fhd; B...
  • XuyfLy
  • XuyfLy
  • 2012年05月25日 16:18
  • 1078

pljava snapshot.20120525 (2012-05-25 10:43)

  • 2014年03月24日 08:34
  • 232KB
  • 下载

Syncany开源共享软件的介绍以及其在linux下的安装 2012-03-10 05:51:03

原文地址:Syncany开源共享软件的介绍以及其在linux下的安装 作者:mengl_2011 Syncany 是一个开源的云存储及文件分享工具,灵感来源于 Dropbox 和 JungleDis...
  • cssiqi
  • cssiqi
  • 2013年07月31日 17:06
  • 551

MTK RF参数写入代码操作步骤 (2012-09-25 11:43:10)

转载▼ 标签:  杂谈 分类: 电子信息   一、     使用MTK提供的META工具的Update Parameters项...

(重点)为一个新用户在Oracle中创建新数据库步骤 2012-10-25 10:27:02

(重点)为一个新用户在Oracle中创建新数据库步骤 2012-10-25 10:27:02 分类: Oracle 首先用sys或system等具备dba权限的用户登录 1.创建表空...

STM32F10X SPI操作flash MX25L64读写数据

STM32F10X、SPI、flash、MX25L64
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:一个Div导致Ajax中UpdatePanel以外的数据执行操作的时候全部消失2012-03-25 10:05
举报原因:
原因补充:

(最多只允许输入30个字)