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

[Solved] AjaxPanel in ASCX question

1 Answer 64 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Sayid s Yoshi
Top achievements
Rank 1
Sayid s Yoshi asked on 15 Jul 2009, 06:14 AM
ASCX
<telerik:RadAjaxLoadingPanel ID="TheRadAjaxLoadingPanel" runat="server" Height="75px"
    Width="75px" meta:resourcekey="TheRadAjaxLoadingPanelResource1">
</telerik:RadAjaxLoadingPanel>
<
asp:Button runat="server" ID="btnUseDefault" Text="Test" OnClick="btnUseDefault_Click" /> 
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="TheRadAjaxLoadingPanelResource1"
    <table cellpadding="5" border="1" runat="server" ID="tblGameSetting"
        <tr> 
            <td> 
                <telerik:RadNumericTextBox ID="txt1" runat="server" MinValue="0"></telerik:RadNumericTextBox> 
            </td> 
            <td> 
                <telerik:RadNumericTextBox ID="txt2" runat="server" MinValue="0"></telerik:RadNumericTextBox> 
            </td> 
            <td> 
                <telerik:RadNumericTextBox ID="txt3" runat="server" MinValue="0"></telerik:RadNumericTextBox> 
            </td> 
            <td> 
                <telerik:RadNumericTextBox ID="txt4" runat="server" MinValue="0"></telerik:RadNumericTextBox> 
            </td> 
        </tr> 
</table> 
</telerik:RadAjaxPanel> 

.CS:
        protected void btnUseDefault_Click(object sender, EventArgs e) 
        { 
            txt1.Value = 11.11; 
        } 

But after click the button, it postback. Please advice.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 15 Jul 2009, 09:23 AM
Hello Sayid,

To avoid post back on clicking the button(btnUseDefault), you would have to add the button inside the Ajax panel as shown below:
aspx:
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="TheRadAjaxLoadingPanelResource1" >  
  <asp:Button runat="server" ID="btnUseDefault" Text="Test" OnClick="btnUseDefault_Click"  />  
  <table cellpadding="5" border="1" runat="server" ID="tblGameSetting">  
       <tr> 
          ...... 

Thanks
Princy.
Tags
Ajax
Asked by
Sayid s Yoshi
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or