Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Web
Mobile
Document Management
Desktop
Reporting
Testing & Mocking
CMS
UI/UX Tools
Debugging
Free Tools
Support and Learning
Productivity and Design Tools
New to Telerik UI for ASP.NET AJAX? Download free 30-day trial
<
telerik:RadXmlHttpPanel
ID
=
"RadXmlHttpPanel1"
runat
"server"
WcfRequestMethod
"POST"
WcfServiceMethod
"PostRetrieveProductByID"
WcfServicePath
"XmlHttpPanelWcfService.svc"
>
</
There are three client events where you can handle the items request:
[ServiceContract]
public
interface
IXmlHttpPanelWcfService
{
//"POST" or "GET" depends on the WcfRequestMethod property value
[OperationContract]
[WebInvoke(Method =
, BodyStyle = WebMessageBodyStyle.Wrapped,
ResponseFormat = WebMessageFormat.Json)]
string
PostRetrieveProductByID(
ProductID);
}
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
class
XmlHttpPanelWcfService : IXmlHttpPanelWcfService
ProductID)
return
"The content of the XmlHttpPanel"
;
system.serviceModel
behaviors
endpointBehaviors
behavior
name
"XmlHttpPanelWcfBehavior"
webHttp
/>
serviceBehaviors
serviceMetadata
httpGetEnabled
"true"
serviceDebug
includeExceptionDetailInFaults
services
service
behaviorConfiguration
"XmlHttpPanelWcfService"
endpoint
address
""
binding
"webHttpBinding"
contract
"IXmlHttpPanelWcfService"
<%@ Page Language="vb" AutoEventWireup="true" Inherits="Telerik.Web.Examples.XmlHttpPanel.Default.DefaultVB"CodeFile="DefaultVB.aspx.vb" %> <!DOCTYPE html> <html xmlns='http://www.w3.org/1999/xhtml'> <head runat="server"> <title>Telerik ASP.NET Example</title> <link href="styles.css" rel="stylesheet" type="text/css" /> </head> <body> <form id="form1" runat="server"> <telerik:RadScriptManager runat="server" ID="RadScriptManager1" /> <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" /> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" ProviderName="System.Data.SqlClient" SelectCommand="SELECT TOP(11) [ProductID], [ProductName], [QuantityPerUnit], [UnitPrice], [UnitsInStock] FROM [Products] WHERE ([CategoryID] = @CategoryID)"> <SelectParameters> <asp:Parameter DefaultValue="8" Name="CategoryID" Type="Int32"></asp:Parameter> </SelectParameters> </asp:SqlDataSource> <div class="demo-container no-bg"> <div class="divContainer"> <div class="divContainerHeader"> <img src="images/good-food.png" alt="good food" /> </div> <div class="divGrid"> <telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" Skin="Telerik" DataSourceID="SqlDataSource1" Width="370px" AllowSorting="True" AllowPaging="true" runat="server" AutoGenerateColumns="false" PageSize="7" GridLines="None"> <MasterTableView ClientDataKeyNames="ProductID" Width="100%" Summary="RadGrid table"> <Columns> <telerik:GridBoundColumn DataField="ProductID" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="Product Name" DataField="ProductName" UniqueName="ContactName"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="Unit Price" DataField="UnitPrice" UniqueName="Address"> </telerik:GridBoundColumn> </Columns> </MasterTableView> <PagerStyle Mode="Slider" PageButtonCount="5"></PagerStyle> <ClientSettings EnableRowHoverStyle="true" Selecting-AllowRowSelect="true" ClientEvents-OnRowSelected="telerikDemo.rowSelected"> </ClientSettings> </telerik:RadGrid> </div> <div class="divXmlHttpPanel"> <telerik:RadXmlHttpPanel ID="RadXmlHttpPanel1" runat="server" RenderMode="Block" WcfRequestMethod="POST" WcfServiceMethod="PostRetrieveProductByID" WcfServicePath="XmlHttpPanelWcfService.svc"> </telerik:RadXmlHttpPanel> </div> </div> </div> <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> </telerik:RadScriptBlock> <qsf:ConfiguratorPanel runat="server"> <Views> <qsf:View runat="server"> <qsf:RadioButtonList ID="RequestMethodChooser" runat="server" Label="Select WCF Service request method"> <asp:ListItem Value="post" Text="Post" Selected="True" /> <asp:ListItem Value="get" Text="Get" /> </qsf:RadioButtonList> </qsf:View> </Views> </qsf:ConfiguratorPanel> <script src="scripts.js" type="text/javascript"></script> <script type="text/javascript"> serverIDs({ xmlHttpPanelID: "<%=RadXmlHttpPanel1.ClientID %>", requestMethodChooserID: "<%=RequestMethodChooser.ClientID%>", gridID: "<%= RadGrid1.ClientID %>" }); </script> </form> </body> </html>