We help IT Professionals succeed at work.

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

Michhoho asked
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

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <form id="form1" runat="server">
    <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" />


Open in new window

Watch Question



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

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

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