Data Dropdown Listing Control

Page - Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="ncToolControls" Namespace="ncToolControls" TagPrefix="nc" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Testing</title>    
</head>
<body>
    <form id="form1" runat="server">
    <div>
       <p>
        <nc:CountryListing ID="ddlCountry" runat="server"></nc:CountryListing>
        <nc:EducationListing ID="EducationListing1" runat="server"></nc:EducationListing>
        <nc:LanguageListing ID="ddlLanguage" runat="server"></nc:LanguageListing>
        <nc:EthnicityListing ID="ddlEthnicity" runat="server"></nc:EthnicityListing>
        <nc:MaritalStatusListing ID="ddlMarital" runat="server"></nc:MaritalStatusListing>
        <nc:MonthInWordListing ID="ddlMonth" runat="server"></nc:MonthInWordListing>
        <nc:PersonRelationListing ID="ddlRelated" runat="server"></nc:PersonRelationListing>
        <nc:YearListing ID="ddlYear" runat="server"></nc:YearListing>
        <nc:RaceListing ID="ddlRace" runat="server"></nc:RaceListing>
        <nc:ReferredByListing ID="ddlPreferred" runat="server"></nc:ReferredByListing>
        </p>
                   
        <p><nc:MedicalSpecialtyListing ID="ddlSpecialist" runat="server"></nc:MedicalSpecialtyListing></p>
        <p><asp:Image ID="imgCaptcha" ImageUrl="~/nCaptcha.ashx" runat="server" /></p>
        <p><asp:TextBox ID="txtCaptcha" runat="server"></asp:TextBox></p>
        <p><asp:Label ID="lblCaptcha" runat="server"></asp:Label></p>
        <asp:Button ID="btnTest" runat="server" OnClick="btnTest_Click" Text="Run" />        
        <asp:Literal ID="lit_Content" runat="server"></asp:Literal>
        <br />
        <nc:WinPanel ID="panel1" WinPanelWidth="480" TitleCaption="Your Answer" FontSize="14" runat="server" />
        <br />
        <nc:MessageBox ID="msgCtrl" BoxMessageType="success" runat="server" />

    </div>
    </form>
</body>
</html>
Code behind - Default.aspx.cs
using System;
using System.Configuration;
using System.Collections.Generic;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Drawing.Imaging;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ncTools;

public partial class _Default : System.Web.UI.Page
{

    protected void Page_Init(object sender, EventArgs e)
    {
       // System.IO.TextWriter wsr = new System.IO.TextWriter();
       // HtmlTextWriter writer = new HtmlTextWriter(wsr);
        //this.ddlCountry.Text = "Korea";        
        //this.ddlCountry.SelectedValue = "Korea";
        //this.ddlCountry.SelectedValue = "Korea";          
        
    }
    protected void Page_Load(object sender, EventArgs e)
    {   
        if (!Page.IsPostBack)
        {   
          //= LoadDataToComboBoxControl();   
            //btnTest_Click(btnTest, null);
            
            //btnTest_Click(sender,e);
            

        }
        //ddlSpecialist.SelectedValue = "Dentist";
        //ddlSpecialist.Text = "Dentist";
        
    }
    /*
  protected void LoadDataToComboBoxControl()
  {
      
      <p>
      <%
          <nc:DropDownListChosen ID="ddlDoctors" NoResultsText="No results match." width="350px"
              DataPlaceHolder="Search...." AllowSingleDeselect="true" runat="server">
          </nc:DropDownListChosen>                                               
      %>
      </p>    
      string strConn = ConfigurationManager.ConnectionStrings["sqldb_ConnectionString"].ToString();
        
        
      //-- Using the sample provided by DevExpress 
      SqlDataSource1.ConnectionString = ConfigurationManager.ConnectionStrings["sqldb_ConnectionString"].ToString();
        
        
      SqlDataSource1.SelectCommand = sTSQL1;
        
      string sTSQL1 = "select specId,(physician_lastname+', '+physician_firstname) as doc_name,business_phone as doc_phone,specialty";
      sTSQL1 += " from tblSpecialist where specialty LIKE 'Gastroenterology%' order by physician_lastname";

      oMyODBC oDB = new oMyODBC();
      SqlDataReader dr = oDB.SqlRecordSet(sTSQL1, strConn);
      if (dr.HasRows == true)
      {
          ddlDoctors.Items.Clear();
          ddlDoctors.Items.Add(new ListItem(dr["doc_name"].ToString(), dr["specId"].ToString()));

          while (dr.Read())
          {
              ddlDoctors.Items.Add(new ListItem(dr["doc_name"].ToString(), dr["specId"].ToString()));
          }
      }
      dr.Close();
        
      //-ddlDoctors.DataSource = SqlDataSource1;
      //-ddlDoctors.DataBind();
  }
  */

    protected void btnTest_Click(object sender, EventArgs e)
    {
            //Response.Redirect("Success.aspx");
            //Response.BinaryWrite(oBytes);

        string sContentoList = "<p>Selected Country : " + ddlCountry.Text;
            sContentoList += "<br/>Marital Status: " + ddlMarital.Text;
            sContentoList += "<br/>Ethnicity: " + ddlEthnicity.Text;
            sContentoList += "<br/>Language: " + ddlLanguage.Text;
            sContentoList += "<br/>Education: " + EducationListing1.Text;
            sContentoList += "<br/>Race: " + ddlRace.Text;
            sContentoList += "<br/>Referred: " + ddlPreferred.Text;
            sContentoList += "<br/>Year: " + ddlYear.Text;
            sContentoList += "<br/>Month: " + ddlMonth.Text;
            //-sContentoList += "<br/>Doctor Id: " + ddlDoctors.Text;
            //-sContentoList += "<br/>Doctor Name: " + ddlDoctors.SelectedItem.Text;
            sContentoList += "</p>";
            lit_Content.Text = sContentoList;

            panel1.WinPanelContent = sContentoList;
            //- Message Box            
            msgCtrl.ContentMessageText = "Great you've got it";
          
            //msgCtrl.BoxMessageType = "error";
            //msgCtrl.ContentMessageText = "oops, an error has occurred";

     
    }
    protected void btnPagining_Click(object sender, EventArgs e)
    {
    }
}

Add Feedback