nu får du hele koden so mden kører lige nu:
Partial Class TestReload
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
TextBox1.Text = CInt(TextBox1.Text) + 1
TextBox2.Text = CInt(TextBox2.Text) + 1
End Sub
End Class
og
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="TestReload.aspx.vb" Inherits="TestReload" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<!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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<script type="text/javascript">
function clickMyTrigger() {
var myTrigger = document.getElementById("<%=Button1.ClientID%>");
myTrigger.click();
}
</script>
<div>
<asp:TextBox ID="TextBox1" runat="server">1</asp:TextBox>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:TextBox ID="TextBox2" runat="server">1</asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" /><img src="Img/arrow.gif" onload="clickMyTrigger();"/>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>