473,322 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Cascading drop down list method error 500 in asp.net

Expand|Select|Wrap|Line Numbers
  1. Imports System.Web
  2. Imports System
  3. Imports System.Collections.Specialized
  4. Imports System.Web.Services
  5. Imports System.Web.Services.Protocols
  6. Imports System.Data
  7. Imports AjaxControlToolkit
  8. Imports System.Data.SqlClient
  9. Imports System.Collections.Generic
  10. ' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
  11. <System.Web.Script.Services.ScriptService()> _
  12. <WebService(Namespace:="http://tempuri.org/")> _
  13. <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
  14. <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
  15. Public Class CountryServiceInherits System.Web.Services.WebService
  16. <System.Web.Services.WebMethod()> _
  17. Public Function GetMakes(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue()
  18. Dim countrymakeadaptor As New datacountryTableAdapters.CountryTableAdapter()
  19. Dim makevalues As New List(Of CascadingDropDownNameValue)()
  20. For Each row As DataRow In countrymakeadaptor.GetAllCountries()
  21. makevalues.Add(New CascadingDropDownNameValue(row("COUNTRY").ToString(), row("ID").ToString()))
  22. Next
  23. Return makevalues.ToArray()
  24. End Function
  25. <WebMethod()> _
  26. Public Function GetCity(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue()
  27. Dim kv As StringDictionary = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues)
  28. Dim citymakeadaptor As New DatacityTableAdapters.CitiesTableAdapter()
  29. Dim cityvalues As New List(Of CascadingDropDownNameValue)()
  30. For Each row As DataRow In citymakeadaptor.GetAllCities(CLng(kv.Values(0).ToString))
  31. cityvalues.Add(New CascadingDropDownNameValue(row("CITIES").ToString(), row("CID").ToString()))
  32. Next
  33. Return cityvalues.ToArray()
  34. End Function
  35. End Class
  36.  
This is the code:
Expand|Select|Wrap|Line Numbers
  1. <asp:DropDownList ID="DropDownList1" runat="server" Height="34px" Width="199px">
  2. </asp:DropDownList>
  3. <br />
  4. <cc1:CascadingDropDown ID="DropDownList1_CascadingDropDown"
  5. runat="server"
  6. Enabled="True"
  7. TargetControlID="DropDownList1"
  8. category="Country"
  9. PromptText="Select the country"
  10. LoadingText ="Please wait...."
  11. ServicePath="~/countryservice.asmx"
  12. ServiceMethod="GetMakes">
  13. </cc1:CascadingDropDown>
  14. <br />
  15. <asp:DropDownList ID="DropDownList2" runat="server" Height="31px" Width="197px">
  16. </asp:DropDownList>
  17. <cc1:CascadingDropDown ID="DropDownList2_CascadingDropDown"
  18. runat="server"
  19. Enabled="True"
  20. TargetControlID="DropDownList2"
  21. ParentControlID="DropDownList1"
  22. category="Cities"
  23. PromptText="Select the City"
  24. LoadingText ="Please wait...."
  25. ServicePath="~/countryservice.asmx"
  26. ServiceMethod="GetCity"
  27. EnableViewState="True">
  28. </cc1:CascadingDropDown>
Dec 29 '08 #1
1 7856
Frinavale
9,735 Expert Mod 8TB
I've moved your question to the ASP.NET forum.

Check your Windows Event Log for more details about the problem and let us know more about it.

-Moderator Frinny
Dec 29 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Dan | last post by:
Can anyone offer suggestions on how to do this or if it is possible? I have a form that uses a drop down box and 2 text fields. What I am trying to do is have the value of each text box set by...
1
by: Dan | last post by:
This is one that has me stumped and I need an expert's input. Any ideas why the values from the second script-generated drop down list isn't recognized by the script to add time values to the...
2
by: Dave A | last post by:
I am stuggling with databinding a drop down list, hooking into the SelectedIndexChanged and attempting to avoid using the viewstate. The drop down list is quite large so I would prefer to avoid...
9
by: Edwinah63 | last post by:
Hi everyone, Please let there be someone out there who can help. I have two BOUND combo boxes on a continuous form, the second being dependent on the first. I have no problem getting the...
3
kcdoell
by: kcdoell | last post by:
Hello: I have been struggling with building a cascading list on a form that I created. My problem is that I am getting a "Datatype Mismatch in criteria expression" error that I can not seem to...
7
kcdoell
by: kcdoell | last post by:
I have three tables: One for the Division location: tblDivision DivisionID = Autonumber DivisionName = Text One for the Working Region: tblWrkRegion
1
kcdoell
by: kcdoell | last post by:
Good Morning: I have a form where I am trying to create cascading combo boxes. I have done this before but I am getting the following error that is throwing me off: Procedure declaration...
3
kcdoell
by: kcdoell | last post by:
I have 5 cascading combo boxes on a form. Below is a sample of my vb in the first combo box: Private Sub CboDivision_AfterUpdate() 'When the Division is selected, the appropriate Segment...
18
by: LosLobo | last post by:
Greetings all. I know that cascading lists are a common problem and in truth I my initial post here was to request help with my own, but then I figured out the right code. That being said, I have a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.