I'm following a simple example of how to use the update panel from here (http://www.asp.net/Ajax/Documentation/Live/tutorials/IntroductionUpdatePanel.aspx). Outside the update panel i've another html input control which calls a javascript function which displays an count to the user in an alert box. simple stuff. My problem is that the page behaves differently when running on IIS and on the inbuilt asp.net web server (cassini). Under IIS clicking the button within the update panel causes a full postback and so the count displayed to the user in the js function gets reset after that eachtime. under the inbuilt web server hitting the button inside the update panel behaves how i would expect it to and how i want it to in that it refreshes the label only so that the counter on the client side isn't reset.
.net 3.5 is the target framework and I'm running IIS 5.1.
I've seen posts elsewhere describing the same problem (http://forums.asp.net/t/1169282.aspx)
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
var count=0;
function incrementCounter()
{
count ++;
alert(count);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Panel Created"></asp:Label>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
<input type="button" id="Button2" value="JS Clicker" onclick="incrementCounter();" />
</form>
</body>
</html>