I have a web user control which contains a Repeater control inside a RadAjaxPanel. The Repeater control has an ItemTemplate which contains several table columns, one of which is a RadNumericTextBox.
What I want to happen is, when the user changes the value in the RadNumericTextBox it should via Ajax refresh the Repeater control. What is actually happening is a full page-postback.
Here is the ascx code:
The txtQuantity_OnTextChanged method does some internal processing and then:
rptBasket.DataSource = CartItems;
rptBasket.DataBind();
The Page_Load method doesn't do anything unless IsPostBack is FALSE.
The aspx page containing the user control has no Ajax on it. Any assistance much appreciated!
What I want to happen is, when the user changes the value in the RadNumericTextBox it should via Ajax refresh the Repeater control. What is actually happening is a full page-postback.
Here is the ascx code:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ShoppingBasketPanel.ascx.cs" Inherits="myapp.Controls.ShoppingBasketPanel" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<
div
>
<
div
style
=
"margin-top:10px; clear:both;"
>
</
div
>
<
div
style
=
"width: 600px; margin: auto;"
>
<
telerik:RadAjaxPanel
ID
=
"RadAjaxPanel1"
runat
=
"server"
Width
=
"600px"
EnableAJAX
=
"true"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
EnablePageHeadUpdate
=
"True"
HorizontalAlign
=
"NotSet"
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
Skin
=
"Default"
/>
<
asp:Repeater
ID
=
"rptBasket"
runat
=
"server"
onitemdatabound
=
"rptBasket_ItemDataBound"
>
<
HeaderTemplate
>
<
table
style
=
"width: 100%;"
>
<
thead
>
<
tr
>
<
th
align
=
"left"
>Quantity</
th
>
<
th
align
=
"left"
>Product</
th
>
<
th
align
=
"right"
>Item Price</
th
>
<
th
align
=
"right"
>Item Total</
th
>
<
th
> </
th
>
<
th
> </
th
>
</
tr
>
</
thead
>
</
HeaderTemplate
>
<
ItemTemplate
>
<
tr
>
<
td
align
=
"left"
><
telerik:RadNumericTextBox
ID
=
"txtQuantity"
runat
=
"server"
MaxLength
=
"3"
MinValue
=
"1"
MaxValue
=
"999"
Width
=
"40px"
DataType
=
"System.Int32"
ShowSpinButtons
=
"True"
NumberFormat-DecimalDigits
=
"0"
AutoPostBack
=
"True"
OnTextChanged
=
"txtQuantity_OnTextChanged"
/></
td
>
<
td
align
=
"left"
><
asp:Label
ID
=
"lblProduct"
runat
=
"server"
/></
td
>
<
td
align
=
"right"
><
asp:Label
ID
=
"lblItemPrice"
runat
=
"server"
/></
td
>
<
td
align
=
"right"
><
asp:Label
ID
=
"lblTotal"
runat
=
"server"
/></
td
>
<
td
><
asp:HiddenField
ID
=
"hfCode"
runat
=
"server"
/><
asp:HiddenField
ID
=
"hfOption"
runat
=
"server"
/> </
td
>
<
td
style
=
"margin-left:5px;"
><
asp:ImageButton
ID
=
"imgbRemove"
runat
=
"server"
ImageUrl
=
"~/Images/delete.png"
Width
=
"16"
Height
=
"16"
/></
td
>
</
tr
>
</
ItemTemplate
>
<
FooterTemplate
>
<
tfoot
>
<
tr
>
<
td
> </
td
>
<
td
> </
td
>
<
td
colspan
=
"2"
align
=
"right"
><
strong
>Total </
strong
><
asp:Label
ID
=
"lblBasketTotal"
runat
=
"server"
Text
=
"0"
/></
td
>
<
td
> </
td
>
<
td
> </
td
>
</
tr
>
</
tfoot
>
</
table
>
</
FooterTemplate
>
</
asp:Repeater
>
</
telerik:RadAjaxPanel
>
</
div
>
</
div
>
The txtQuantity_OnTextChanged method does some internal processing and then:
rptBasket.DataSource = CartItems;
rptBasket.DataBind();
The Page_Load method doesn't do anything unless IsPostBack is FALSE.
The aspx page containing the user control has no Ajax on it. Any assistance much appreciated!