Wednesday, March 28, 2012

Very simple example... with masterpage!

I create a really simple example using atlas on a masterpage.

Ihave this code:

<

cc1:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true"></cc1:ScriptManager><cc1:UpdatePanelID="up2"runat="server"><ContentTemplate><asp:Labelid="lbl1"runat="server"Text="Label"></asp:Label><BR/><asp:LinkButtonid="LinkButton1"runat="server"OnClick="LinkButton1_Click">LinkButton</asp:LinkButton></ContentTemplate>

</cc1:UpdatePanel>

and this:

protectedvoid LinkButton1_Click(object sender,EventArgs e)

{

lbl1.Text =

"egege";

}

the problem is that the event is raised, lbl1.Text became "egege", but the text of the label on the page it is still the same...

what can be wrong?

Can you supply a bit more code and perhaps explain how the cc1 namespace prefix got placed in front of your atlas controls?

<cc1:ScriptManager......

Instead of

<atlas:ScriptManager....

Etc.

I'm not saying that's the problem, but I'm unfamiliar with how that prefix got there.


hello.

btw, you should also start by using fiddler to see the msg that the client is receiving from the server...is there any forbidden xml chars on the head section?


Eureka!

The problem was that there was a<script language="Javascript"> block on the head of my masterpage.

I canceled it and everythigs works!

Can anybody tell me why?


hello.

well, currently, atlas packages the content of the head element in the msg that is sent from the server in response to a partial postback. since it doesn't escape those elements (say, by using a cdata section), you can't have any forbidden xml chars there (and it's really easy to get one of those inside a javascript script - for instance, this would make your document not well formed: for( ; i < 10; i++ ))

in the current version of atlas, when the returned xml document isn't well formed, the client platform discards it without giving any feedback.

No comments:

Post a Comment