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

Pass parameters to WCF service

1 Answer 101 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jagat
Top achievements
Rank 1
Jagat asked on 20 Mar 2012, 05:27 PM
I followed a blog post exactly as explained here.
http://blogs.telerik.com/veselinvasilev/posts/09-04-08/how-to-use-wcf-services-with-asp-net-ajax-databound-controls.aspx

How do I pass additional parameters to the LoadData method? I need to pass customer status as parameter to the LoadData method and retrieve a list of customers that Active/ Inactive/deleted depending on the parameter 'status'.
Thank you!!

Neelima

1 Answer, 1 is accepted

Sort by
0
Jagat
Top achievements
Rank 1
answered on 20 Mar 2012, 11:56 PM

I finally figured this out...Here is how I did...
function
OnClientItemsRequesting(sender, args) {
 
    var context = args.get_context();
    context["Status"] = "Active";
    if (document.getElementById('<%=rbtnClientStatus.ClientID %>')) {
        var rbtnStatus = document.getElementById('<%=rbtnClientStatus.ClientID %>').getElementsByTagName("input");
                  
        if (rbtnStatus) {
            for (var j = 0; j < rbtnStatus.length; j++) {
                if (rbtnStatus[j].checked) {
                    context["Status"] = rbtnStatus[j].value;          
                }
            }
        }
    }
 
}

<asp:RadioButtonList ID="rbtnClientStatus" runat="server"  RepeatDirection="Horizontal">
     <asp:ListItem Value="Active" Selected="True">Active</asp:ListItem>
      <asp:ListItem Value="InActive">InActive</asp:ListItem>
      <asp:ListItem Value="Deleted">Deleted</asp:ListItem>
</asp:RadioButtonList>
 
<telerik:RadComboBox runat="server" ID="rcbClients" Height="100px" EnableLoadOnDemand="true" AutoPostBack="true"  ValidationGroup="Client"
    ShowMoreResultsBox="true" EnableVirtualScrolling="true" AllowCustomText="false" OnClientItemsRequesting = "OnClientItemsRequesting"
    EmptyMessage="Type lastname ...">
    <WebServiceSettings Path="WCFClients.svc" Method="LoadClients" />
</telerik:RadComboBox>
Tags
ComboBox
Asked by
Jagat
Top achievements
Rank 1
Answers by
Jagat
Top achievements
Rank 1
Share this question
or