send parameter to webservice howto

Last post 03-05-2008 8:35 AM by Jonathan Shen – MSFT. 1 replies.

Sort Posts:

  • send parameter to webservice howto

    02-29-2008, 11:09 PM
    • Member
      9 point Member
    • Gasing
    • Member since 11-08-2007, 5:25 AM
    • Posts 24

     Is there a way that i can send a parameter to the webservice of the cascading dropdown?

    <cc1:CascadingDropDown ID="ddlSijil_CascadingDropDown" runat="server" PromptText="Sila Buat Pilihan"
    TargetControlID="ddlSijil" Category="Sijil" ServicePath="~/WebService.asmx" ServiceMethod="GetSijil">
    </cc1:CascadingDropDown>

     here's the webservice

    Public Function GetNegeriPemohon( _
    ByVal knownCategoryValues As String, _ByVal category As String) As _
    CascadingDropDownNameValue()
    Dim values As New System.Collections.Generic.List( _
    Of AjaxControlToolkit.CascadingDropDownNameValue)Dim ds As DataSet ds = HttpContext.Current.Cache("Car")
    If ds Is Nothing Then
    Dim connectionString As String
    connectionString = _
    WebConfigurationManager.ConnectionStrings( _
    "Conn").ConnectionString


    Dim conn As New SqlConnection(connectionString)Dim comm As New SqlCommand("SELECT * " & _
    " FROM Car where OfficerId = '" & ddl.selecteditem.text & "' ")

    Dim ad As New SqlDataAdapter(comm)ds = New DataSet
    ad.Fill(ds)
    HttpContext.Current.Cache.Insert(
    "Car", ds)
    Else
    ds = CType(HttpContext.Current.Cache("Car"), DataSet)
    End If
    For Each row As DataRow In ds.Tables(0).Rows
    values.Add(
    New CascadingDropDownNameValue( _
    row(
    "Car"), row("CarID")))
    Next
    Return values.ToArray
    End Function

  • Re: send parameter to webservice howto

    03-05-2008, 8:35 AM
    Answer

    Hi Gasing,

    CascadingDropDown provides ContextKey to send a parameter back to your WebService. For more details, please visit my replies on the threads below.

    http://forums.asp.net/p/1163803/1936059.aspx#1936059

    http://forums.asp.net/p/1219578/2181172.aspx#2181172

    Best regards,

    Jonathan

    Jonathan Shen
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (2 items)