We help IT Professionals succeed at work.

ASP.NET causes full postback via IIS, but not asp.net development server

Michhoho
Michhoho asked
on
I have this website running asp.net version 4.0, in a sub-virtual directory of a virtual directory in IIS (in XP Pro)

each virtual directory is different version of asp.net

one is set to isolation mode medium, another is high. both can run

however, there's something weird going on

if i run a simple page (code attached) via IIS, the ajax causes full postback, but when I try to run it via vs2010's built-in webserver, it doesn't.

What's wrong?

Edit = Same problem if I create a root virtual directory for the site. But no problem on Win2K3 IIS 6


<%@ Page Language="VB" %>

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

<script runat="server">

	Protected Sub x_Click(ByVal sender As Object, ByVal e As System.EventArgs)
	haha.Text = Guid.NewGuid.ToString 
	End Sub
	
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:ScriptManager runat="server" ID="sc" />
	<asp:UpdatePanel runat="server" ID="up"><ContentTemplate>
	<asp:Literal runat="server" ID="haha" />

	<asp:Button ID="x" Text="xx" runat="server" OnClick="x_Click" />


	</ContentTemplate></asp:UpdatePanel>
    </div>
    </form>
</body>
</html>

Open in new window

Comment
Watch Question

Author

Commented:
ok

I added   <xhtmlConformance mode="Transitional" />  in web.config, and now it works in IIS

WEIRD
Try putting UpdateMode="Conditional" property in the UpdatePanel and test it out.v

<asp:UpdatePanel runat="server" ID="up" UpdateMode="Conditional">