Hello all,
Here is my porblem. I have created a webservice to pull information from a database and return the results to a CascadingDropDown. This all works great on my local machine. The problem is when I post the site to a webserver the results never get returned. Below is the code for the web service and the CascadingDropDown. I am sure it is something very simple that I am missing and any help is greatly appreciated.
Web Service Code.
Imports System.Web.Services.Protocols
Imports AjaxControlToolkit
Imports System.Data
Imports System.Data.SqlClient
Imports System.Collections.Generic
Imports System.Web.Configuration
<System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class OpCoList
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function OpCoList(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue()
Dim objConn As New SqlConnection(WebConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
Dim objReader As SqlDataReader
Dim objcommand As New SqlCommand("Select * From OpCO", objConn)
Dim ListOfOPCOS As New List(Of CascadingDropDownNameValue)()
MsgBox("TESTING")
Try
objConn.Open()
objReader = objcommand.ExecuteReader
If objReader.HasRows Then
'System.Threading.Thread.Sleep(3000)
While objReader.Read()
ListOfOPCOS.Add(New CascadingDropDownNameValue(objReader.Item("CompanyName").ToString, objReader.Item("UniqueKey").ToString))
End While
End If
Catch ex As Exception
ListOfOPCOS.Add(New CascadingDropDownNameValue(ex.Message, ex.InnerException.ToString))
MsgBox(ex.Message)
Finally
objConn.Close()
End Try
Return ListOfOPCOS.ToArray
End Function
End Class
CascadingDropDown.
<ajaxToolkit:CascadingDropDown ID="cdd_OpCo" runat="server" Category="OpCo" LoadingText="Loading OpCo's ..."
PromptText="Select an OpCo" PromptValue="Select an OpCo" ServiceMethod="OpCoList"
ServicePath="OpCoList.asmx" TargetControlID="ddl_OpCo">