Click here to Skip to main content
15,907,000 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionLocalozation Problem (RightToLeft and LeftToRight). Pin
hdv21211-Sep-08 6:11
hdv21211-Sep-08 6:11 
QuestionLocate the map , just howww?? Pin
vjvjvjvj11-Sep-08 5:57
vjvjvjvj11-Sep-08 5:57 
QuestionHelp with form post method Pin
amymarie311-Sep-08 5:57
amymarie311-Sep-08 5:57 
AnswerRe: Help with form post method Pin
John_Adams11-Sep-08 12:12
John_Adams11-Sep-08 12:12 
GeneralMultiple Item Display Pin
Brady Kelly11-Sep-08 4:46
Brady Kelly11-Sep-08 4:46 
QuestionRe: Multiple Item Display Pin
led mike11-Sep-08 4:49
led mike11-Sep-08 4:49 
AnswerRe: Multiple Item Display Pin
Brady Kelly11-Sep-08 5:02
Brady Kelly11-Sep-08 5:02 
QuestionSecond Dropdown Says Metohd Error 500 with Ajax CaseCading Dropdown [modified] Pin
Saurabh11-Sep-08 4:03
Saurabh11-Sep-08 4:03 
hi,

i have created 2 drop down lists and made a web service.

// This is Web servie, which is having the 2 web methods.
// a GetCountries
//b. GetStates

using System;<br />
using System.Web;<br />
using System.Collections;<br />
using System.Collections.Generic;<br />
using System.Web.Services;<br />
using System.Web.Services.Protocols;<br />
using System.Xml.Serialization;<br />
<br />
using System.Collections.Specialized;<br />
using AjaxControlToolkit;<br />
<br />
<br />
/// <summary><br />
/// Summary description for TerritoriesService<br />
/// </summary><br />
[WebService(Namespace = "http://tempuri.org/")]<br />
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />
[System.Web.Script.Services.ScriptService]<br />
public class TerritoriesService : System.Web.Services.WebService<br />
{<br />
<br />
    public TerritoriesService()<br />
    {<br />
<br />
        //Uncomment the following line if using designed components <br />
        //InitializeComponent(); <br />
    }<br />
    <br />
    <br />
    <br />
    [WebMethod]<br />
    public string HelloWorld()<br />
    {<br />
        return "Hello World";<br />
    }<br />
<br />
<br />
    /// <summary><br />
    /// <br />
    /// </summary><br />
    /// <param name="knownCategoryValues"></param><br />
    /// <param name="category"></param><br />
    /// <returns></returns><br />
    [WebMethod]<br />
    public CascadingDropDownNameValue[] GetCountries(string knownCategoryValues, string category)<br />
    {<br />
        UNIVERSAL.CommonBLL.Country.Country oCountry = UNIVERSAL.CommonBLL.Country.CountryFactory.GetInstance();<br />
        UNIVERSAL.CommonBLL.Country.CountryCollection objCountryCollection = (UNIVERSAL.CommonBLL.Country.CountryCollection)oCountry.GetAll();<br />
        List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>();<br />
<br />
        foreach (UNIVERSAL.CommonBLL.Country.Country objCountry in objCountryCollection)<br />
        {<br />
            values.Add(new CascadingDropDownNameValue(objCountry.Name,objCountry.PKID.ToString()));<br />
        }<br />
<br />
        return values.ToArray();<br />
                            <br />
<br />
    }<br />
    <br />
    [WebMethod]<br />
    public CascadingDropDownNameValue[] GetStates(string knownCategoryValues, string Category)<br />
    {<br />
        StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);<br />
        int CountryID;<br />
       <br />
        if (!kv.ContainsKey("Country") || !Int32.TryParse(kv["Country"], out CountryID))<br />
        {<br />
           return null;<br />
        }<br />
<br />
        UNIVERSAL.CommonBLL.States.States oState = UNIVERSAL.CommonBLL.States.StatesFactory.GetInstance();<br />
        UNIVERSAL.CommonBLL.States.StatesCollection objStateCollection = (UNIVERSAL.CommonBLL.States.StatesCollection)oState.GetAll(CountryID.ToString());<br />
        List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>();<br />
<br />
        foreach (UNIVERSAL.CommonBLL.States.States objState in objStateCollection)<br />
        {<br />
            values.Add(new CascadingDropDownNameValue(objState.Name, objState.PKID.ToString()));<br />
        }<br />
        return values.ToArray();<br />
    }<br />
}<br />




My aspx page codeing is belo

<asp:ScriptManager ID="ScriptManager1" runat="server">
              <asp:DropDownList ID="ddlCountry" runat="server">
                    </asp:DropDownList></td>
                <td style="width: 100px">
                    <cc1:CascadingDropDown ID="CascadingDropDown1" runat="server" 
                            TargetControlID="ddlCountry" 
                            Category ="Country"
                            PromptText="PleaseSelectCountry" 
                            LoadingText="Please Wait..." 
                            ServiceMethod="GetCountries"
                            ServicePath="TerritoriesService.asmx" />                       
                       
                </td>
            </tr>
            <tr>
                <td style="width: 100px">
                    States</td>
                <td style="width: 100px">
                    <asp:DropDownList ID="ddlStates" runat="server">
                    </asp:DropDownList></td>
                <td style="width: 100px">
                    <cc1:CascadingDropDown ID="CascadingDropDown2" runat="server"
                            Category ="Country"
                            TargetControlID="ddlStates" 
                            ParentControlID="ddlCountry"
                            PromptText="Please Select State" 
                            LoadingText="Please Wait..." 
                            ServiceMethod="GetStates" 
                            ServicePath="TerritoriesService.asmx" /> 



It works well for first dropdown list but in second drop down list it give the error messaage Method Erro 500after the prompt message of CasecadingDropdown

The web service is working fine, but in the page its not giveing result.
Pleaes help.

modified on Thursday, September 11, 2008 10:11 AM

QuestionCapturing Download Dialog box events using javascript Pin
goradaranaresh11-Sep-08 1:45
goradaranaresh11-Sep-08 1:45 
QuestionHow to disable browser back button of a particular child page (Master Page) Pin
G Nathan11-Sep-08 1:42
G Nathan11-Sep-08 1:42 
Questionrestrict text box to take only numbers Pin
dhumplopoka11-Sep-08 1:35
dhumplopoka11-Sep-08 1:35 
AnswerRe: restrict text box to take only numbers Pin
Rangarajan K11-Sep-08 2:17
Rangarajan K11-Sep-08 2:17 
AnswerRe: restrict text box to take only numbers Pin
Abhijit Jana11-Sep-08 4:35
professionalAbhijit Jana11-Sep-08 4:35 
GeneralRe: restrict text box to take only numbers Pin
J4amieC11-Sep-08 4:48
J4amieC11-Sep-08 4:48 
GeneralRe: restrict text box to take only numbers Pin
led mike11-Sep-08 4:50
led mike11-Sep-08 4:50 
GeneralRe: restrict text box to take only numbers Pin
Pete O'Hanlon11-Sep-08 5:13
mvePete O'Hanlon11-Sep-08 5:13 
GeneralRe: restrict text box to take only numbers Pin
dhumplopoka12-Sep-08 3:20
dhumplopoka12-Sep-08 3:20 
Questionhow to find reference count for an object in unmanaged code ? Pin
ademsandeepreddy11-Sep-08 1:09
ademsandeepreddy11-Sep-08 1:09 
QuestionSocket Programming Pin
ramesh148211-Sep-08 0:56
ramesh148211-Sep-08 0:56 
AnswerRe: Socket Programming Pin
Manas Bhardwaj11-Sep-08 3:45
professionalManas Bhardwaj11-Sep-08 3:45 
QuestionSize restriction on file upload Pin
seee sharp11-Sep-08 0:52
seee sharp11-Sep-08 0:52 
AnswerRe: Size restriction on file upload Pin
NanaAM11-Sep-08 1:37
NanaAM11-Sep-08 1:37 
QuestionGet the set of records from the data Table in asp.net Pin
Rajeshwary11-Sep-08 0:36
Rajeshwary11-Sep-08 0:36 
AnswerRe: Get the set of records from the data Table in asp.net Pin
The Web Developer11-Sep-08 0:57
The Web Developer11-Sep-08 0:57 
GeneralRe: Get the set of records from the data Table in asp.net Pin
Rajeshwary11-Sep-08 1:05
Rajeshwary11-Sep-08 1:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.