Wednesday, March 28, 2012

Updateprogress problem

I am new to AJAX. And I don't understand why this doesn't update the label. The problem started on another page with Placeholders that don't get updated if I use UpdatePanels.

Thanks Asger

<%@dotnet.itags.org.PageLanguage="VB" %>

<%@dotnet.itags.org.RegisterAssembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"Namespace="System.Web.UI"TagPrefix="asp" %>

<%@dotnet.itags.org.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="ajaxToolkit" %>

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

<scriptrunat="server">

ProtectedSub tbCity_TextChanged(ByVal senderAsObject,ByVal eAs System.EventArgs)

lbl1.Text = tbCity.Text

EndSub

</script>

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>Untitled Page</title>

</head>

<body>

<formid="form1"runat="server">

<div>

<asp:ScriptManagerID="ScriptManager1"runat="server">

</asp:ScriptManager>

<asp:UpdateProgressID="UpdateProgress1"runat="server">

<ProgressTemplate>

<div>

<asp:ImageID="Image1"runat="server"ImageUrl="~/images/vent.gif"ImageAlign="Top"/>

</div>

</ProgressTemplate>

</asp:UpdateProgress>

<asp:UpdatePanelID="UpdatePanel2"runat="server">

<ContentTemplate>

<asp:TextBoxID="tbCity"runat="server"AutoCompleteType="None"autocomplete="off"Width="200px"AutoPostBack="true"OnTextChanged="tbCity_TextChanged"/><br/>

</ContentTemplate>

</asp:UpdatePanel>

<asp:Labelrunat="server"ID="lbl1"/>

</div>

</form>

</body>

</html>

AsgerJornow:

I am new to AJAX. And I don't understand why this doesn't update the label. The problem started on another page with Placeholders that don't get updated if I use UpdatePanels.

Hi asger,

Your setup is wrong!

The label doesn't get updated because it is NOT on this updatepanel!!!!

Your textbox should be outside the updatepanel, the label inside, then define the textbox as a trigger of the updatepanel.

Or just place them both on the updatepanel.

Kind regards,
Wim


Thank you, now I get the picture. And it seems to be working.

Kind regards
Asger J?rnow

No comments:

Post a Comment