-
April 5th, 2011, 03:20 PM
#1
[RESOLVED] UpdatePanel works strange
Dear experts,
I have an UpdatePanel and some controls within it, as you can see below. If I change a number in txtGoToPage textbox and press Enter, GoToPage_TextChanged() event handler is called. But if I enter first any page number other than 1, press Enter, and then enter number 1 again, after pressing Enter GoToPage_TextChanged() is not called. The same problem exists with ddlPageSize dropdown list. As you can see, by default the third item is selected. If I select another item, ddlPageSize_SelectedIndexChanged() is called, but if after that I select the third (initially selected) item, ddlPageSize_SelectedIndexChanged() is not called.
Could you please help me fix that?
Thanks.
Code:
<asp:UpdatePanel ID="upnlLicensing" runat="server" UpdateMode="Conditional" >
<ContentTemplate>
...
<asp:Label ID="Label1" runat="server" Text="Show rows:" />
<asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<asp:ListItem Value="20" />
<asp:ListItem Value="50" />
<asp:ListItem Value="100" Selected="True" />
</asp:DropDownList>
Page
<asp:TextBox ID="txtGoToPage" runat="server" AutoPostBack="true"
OnTextChanged="GoToPage_TextChanged" CssClass="gotopage" onchange="JSSetSessionValue('ReloadLicensing', true);JSSetSessionValue('NewPageNumber', this.value)" />
of
<asp:Label ID="lblTotalNumberOfPages" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
-
April 11th, 2011, 12:51 AM
#2
Re: UpdatePanel works strange
Okay a few things..
With a ASP textbox, If you enter the same info that was in the box in the first place it does not trigger the change events.. (ASP applications have a different set of rules to Desktop applications).. and the same goes for DDL's if you select the same item that was set as default, a changed event does not trigger...
A work around is to normally add a "[Please Select one]" item to the DDL and set it as default, and clear the Textbox, every time the page loads..
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
-
April 12th, 2011, 10:15 AM
#3
Re: UpdatePanel works strange
Thank you for your answer. But my problem was not that that I was trying to trigger an event without making any change. The default value was selected (or entered in case of textbox) originally, but not immediately before the currently selected value, so a change has taken place.
And everything worked before I added UpdatePanel.
But I found the solution:
http://stackoverflow.com/questions/1...in-updatepanel
-
April 13th, 2011, 12:02 AM
#4
Re: UpdatePanel works strange
Cool .. Dont forget to mark this thread resolved....
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
-
April 18th, 2011, 02:26 PM
#5
Re: UpdatePanel works strange
May I ask how I can mark this thread as resolved?
Thanks.
-
April 20th, 2011, 03:51 AM
#6
Re: UpdatePanel works strange
Originally Posted by dpreznik
May I ask how I can mark this thread as resolved?
Thanks.
Just above the first post .. Thread Tools -> Mark thread Resolved...
Cheers ..
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|