Showing posts with label postbacks. Show all posts
Showing posts with label postbacks. Show all posts

Wednesday, March 28, 2012

LinkButton plays "click sound" (postbacks the whole page?)

Hi,

This is my first post here at the ASP.NET forums and I'm not sure if I'm in the correct category, so please correct me if I'm wrong.

My question concerns the LinkButton when used with AJAX .NET 1.0 RC1. I have a GridView inside a UpdatePanel. Inside that GridView there are various controls, some of them LinkButtons. When I click, for example, a ImageButton the UpdatePanel refreshes without making any "click sound" (the sound that Internet Explorer plays when a new page is requested). However, if I click a LinkButton the click sound is played. Why is this? If I replace all LinkButtons with normal Buttons or ImageButtons no click sound is heard, so the issue seems related to the LinkButton only. Is this behavior by design, or am I doing something wrong? Is the whole page postbacked when I click a LinkButton even if it resides in an UpdatePanel?

Thanks in advance!

If you place a asp:LinkButton in a asp:UpdatePanel and specify asynchronous post back, there should not be the whole page postback.Try to google "Click Sound" of the asp:LinkButton for some ideas.Maybe this is caused by the designers, which there is sound when clicking a asp:LinkButton.

Monday, March 26, 2012

ListSearchExtender caused 2 postbacks instead of one

When I change selected item in DropDownList, then begins asynchronous postback and some UpdatePanels are reloading. I put one break point in the Page_load event. This break point activated once for each time when I changed selection in the DropDownList. So everything was ok.

 <asp:DropDownList ID="ddl_otdel" runat="server" AutoPostBack="True" DataTextField="otdel_name" DataValueField="id" OnDataBound="ddl_otdel_DataBound" OnSelectedIndexChanged="ddl_otdel_SelectedIndexChanged" />  <%-- <ajax:ListSearchExtender ID="listSearch_ddl_otdel" runat="server" TargetControlID="ddl_otdel" PromptCssClass="ListSearchExtenderPrompt" PromptText="Введите начало строки..." > </ajax:ListSearchExtender> --%>
After that I decided to use ListSearchExtender with my DropDownList. Since that moment my break point (in Page_load) began to activate twice for each time when I changed selection in the DropDownList. When I commented ListSearchExtender then everything became ok. Why there are 2 asynchronous postback instead of one?

May be my question isn't correct. Maybe I don't understand many things. But there is a problem that in some conditions ObjectDataSource executes SelectMethod when it's not necessary and page is going through server-cycle twice during one postback.