Click here to Skip to main content
15,894,646 members
Articles / Programming Languages / Javascript

Cascaded dropdown using jQuery

Rate me:
Please Sign up or sign in to vote.
4.93/5 (12 votes)
28 May 2009CPOL2 min read 64.9K   1.4K   44  
Implementation of cascaded dropdowns using jQuery.
  • jquery.zip
    • Jquery
      • App_Code
      • App_Data
      • Bin
        • AjaxControlToolkit.dll
        • ar
          • AjaxControlToolkit.resources.dll
        • cs
          • AjaxControlToolkit.resources.dll
        • de
          • AjaxControlToolkit.resources.dll
        • es
          • AjaxControlToolkit.resources.dll
        • fr
          • AjaxControlToolkit.resources.dll
        • he
          • AjaxControlToolkit.resources.dll
        • hi
          • AjaxControlToolkit.resources.dll
        • it
          • AjaxControlToolkit.resources.dll
        • ja
          • AjaxControlToolkit.resources.dll
        • ko
          • AjaxControlToolkit.resources.dll
        • nl
          • AjaxControlToolkit.resources.dll
        • pt
          • AjaxControlToolkit.resources.dll
        • ru
          • AjaxControlToolkit.resources.dll
        • tr-TR
          • AjaxControlToolkit.resources.dll
        • zh-CHS
          • AjaxControlToolkit.resources.dll
        • zh-CHT
          • AjaxControlToolkit.resources.dll
      • Default.aspx
      • Default.aspx.cs
      • Default.js
      • jquery.validate.js
      • jquery-1.3.2.min.js
      • web.config
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Web.Services;
using System.Data.OracleClient;
using System.Text;
using System.Collections.Generic;
public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    [WebMethod]
    //public static List<string> GetDate(string x, string y)
    public static Dictionary<string, object> GetFileType(string x, string y)
    {
        try
        {
            Dictionary<string, object> dd = new Dictionary<string, object>();
            dd = GetFromDataBase("Select FiletypeId,Filetypename from M_FileType");
            return dd;
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
  
    [WebMethod]
    public static Dictionary<string, object> GetFileColumn(string Param)
    {
        try
        {
            Dictionary<string, object> dd = new Dictionary<string, object>();
            dd = GetFromDataBase("Select FilecolId,Name from M_FileColumn where filetypeid='" + Param + "'");
            return dd;

        }
        catch (Exception ex)
        {
            throw ex;
        }

    }

    [WebMethod]
    public static Dictionary<string, object> GetValidations(string Param)
    {
        try
        {
            Dictionary<string, object> dd = new Dictionary<string, object>();
            dd = GetFromDataBase("SELECT m_v.validationname as ValidationName, m_v.validationid as ValidationID FROM m_filecolvalidation_map m_f, m_validation m_v WHERE (m_v.validationid = m_f.validationid) AND FILECOLID='" + Param + "'");
            return dd;

        }
        catch (Exception ex)
        {
            throw ex;
        }

    }

    private static Dictionary<string, object> GetFromDataBase(string Query)
    {
        try
        {
            DataSet ds = new DataSet();
            OracleConnection oCon = new OracleConnection("Password=LIFECONNECT_DEV;Persist Security Info=True;User ID=LIFECONNECT_DEV;Data Source=KOTAK.BZNMUM.COM");
            OracleCommand oCmd = new OracleCommand(Query, oCon);
            OracleDataAdapter da = new OracleDataAdapter(oCmd);
            da.Fill(ds);
          //  string ss= HimJSON.GetJSONString(ds.Tables[0]);
     
          return  HimJSON1.ToJson(ds.Tables[0]);
          
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
India India
g

Comments and Discussions