各位,为什么在我启动页面时,被多次提交,也就是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?
------解决方案--------------------------------------------------------
页面上有几个图片标签
------解决方案--------------------------------------------------------