This is a migrated thread and some comments may be shown as answers.

Updatepanel only working on initial postback

4 Answers 143 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Axel
Top achievements
Rank 2
Axel asked on 09 Dec 2009, 12:07 AM
Hi,

I am trying out the AjaxLoadPanel for the first time. I want a wait msg to appear after I click my search image-button while my Radgrid is loading. This works the first time I search after loading the page, but not the second time. I am sure I am making a beginner mistake somewhere.

btw. If I create another AjaxSetting with my ImgButton as trigger and my Radgrid as updatecontrol then I get a error complaining that my control contains code blocks. This happens even if I wrap it with an asp:panel, and yes I have to script in my header.

Hope someone can help me out here :-)

Axel

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"   
    DefaultLoadingPanelID="RadAjaxLoadingPanel1">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="UserControlContainer">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="UserControlContainer" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
</telerik:RadAjaxManager> 
 
 <asp:Panel id="UserControlContainer" class="UserControlContainer pealHeader" DefaultButton="btnSearch" runat="server">  
 <li class="full">  
        <asp:TextBox ID="tbSearch" runat="server" TabIndex="1" ></asp:TextBox> 
        <asp:ImageButton ID="btnSearch" runat="server" 
             Enabled="true" onclick="btnSearch_Click" TabIndex="3" ImageUrl="~/images/icons/lookingglass.png" /> 
 </li> 
 <div> 
   <telerik:RadGrid ID="RadGrid1" runat="server" EnableAJAX="true" EnableAjaxSkinRendering="true">  
 
     . . .  
 
   </telerik:RadGrid> 
 </div> 
 
 <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" EnableSkinTransparency="true" BackgroundPosition="Center" runat="server">  
 </telerik:RadAjaxLoadingPanel> 
 
      
</asp:Panel> 
 
 
 
... serverside ......  
 
        protected void LoadData()  
        {  
            PartyDataContext pdc = new PartyDataContext();  
            var prty = pdc.IndividualsGetComplex(tbSearch.Text.ToUpper()).ToList();  
 
            RadGrid1.DataSourceID = "";  
            RadGrid1.DataSource = prty;  
        }  
 
        protected void btnSearch_Click(object sender, ImageClickEventArgs e)  
        {  
            LoadData();  
            RadGrid1.Rebind();              
        } 

4 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 09 Dec 2009, 11:20 AM
Hi Axel,

Please go through the following help document and see if it helps.
RadCodeBlock and RadScriptBlock

Greetings,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Axel
Top achievements
Rank 2
answered on 09 Dec 2009, 11:45 AM
Hi Pavlina

thanks for the reply.

Did you look at the main issue in my issue i.e. upload panel only showing up on initial search (when search btn is pressed right after pageload)?

On the codeblock issue, I have scrips like these inside my radgrid
<NoRecordsTemplate> 
<span class="information center"><%= GetLocalResourceObject("NothingFound").ToString() %></span>  
</NoRecordsTemplate> 
 

These along with other like (HeaderText="<%$ Resources:HeaderName %>") may be causing problems. Wrapping the Radgrid with Radcodeblock does not seem to be the solution.

Axel.
0
Pavlina
Telerik team
answered on 11 Dec 2009, 12:31 PM
Hi Axel,

Attached to this message is a simple working application which handles the desired functionaltity. Please examine it and let me know what is the difference in your scenario.

Sincerely yours,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Axel
Top achievements
Rank 2
answered on 14 Dec 2009, 10:21 PM
Thanks.

This code piece and discovering the "RadAjaxManagerProxy" solved my issue. Great Job.
Tags
Ajax
Asked by
Axel
Top achievements
Rank 2
Answers by
Pavlina
Telerik team
Axel
Top achievements
Rank 2
Share this question
or