专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > ASP.NET

page_load被执行了多次,该如何解决

发布时间:2011-06-22 17:15:04 文章来源:www.iduyao.cn 采编人员:星星草
page_load被执行了多次
各位,为什么在我启动页面时,被多次提交,也就是page_load被走了多次。
asp.net代码如下(page_load走了4次):
HTML code

<%@ Page Language="vb" AutoEventWireup="true" CodeFile="Login.aspx.vb" Inherits="Login" %>
<!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 id="Head1" runat="server">
    <title>login</title>
</head>
<body style="background-color: #fefefe">
<form id="form1" runat="server">
    <div style="top: 0px;">
    <table cellpadding="0" cellspacing="0" id="main" runat="server" style="width: 100%;
        height: 590px; text-align: center; background-color: #fefefe; top: 0px">
        <tr>
            <td style="height: 300px; vertical-align: bottom;">
               <asp:ScriptManager ID="ScriptManager1" runat="server">
                </asp:ScriptManager>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                <table cellpadding="0" cellspacing="0" id="main_up" runat="server" style="background-color: #fefefe;
                    width: 100%; text-align: center">
                    <!-- service logo -->
                    <tr>
                        <td style="background-image: url(image/backimage.gif); background-repeat:repeat-x; width: 20%; background-attachment: scroll; height: 100%;">
                        </td>
                        <td colspan="3" align="left" style="background-image: url(~/image/backimage.gif); background-repeat:repeat-x; width: 25%;">
                            <asp:Image ID="ImageLK" runat="server" ImageUrl="~/image/LK-logo.gif" />
                        </td>
                        <td style="background-image: url(image/backimage.gif); background-repeat:repeat-x; width: 20%; background-attachment: scroll;">
                        </td>
                    </tr>
                    
                </table>
                </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
    </table>
    </div>
    <div style="text-align : center;">
    <asp:Label ID="Label1" runat="server" Text="Copyright© aaa, Inc." Font-Names="Verdana" Font-Size="XX-Small"></asp:Label></div>
    </form>
</body>
</html>



如果去掉
HTML code

<td colspan="3" align="left" style="background-image: url(~/image/backimage.gif); background-repeat:repeat-x; width: 25%;">
                            <asp:Image ID="ImageLK" runat="server" ImageUrl="~/image/LK-logo.gif" />
                        </td>


那么page_load就被走了2次。

求解~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

------解决方案--------------------
诡异……
记得有一个IsPostback,可以试试
------解决方案--------------------
vb?
------解决方案--------------------
页面上有几个图片标签
------解决方案--------------------
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: