All, i am using this code for dynamically populate data from database into accordian pane. it works fine.
My doubt is - i am showing details(abstract) in accordian pane content and also i created one hyperlink inside pane content.if user clicks hyperlink it goes to another page ,In next page i want to extract email from
projectdetails table based on accordion content (abstract) selected by user. have to take email from table based on abstract selected by user in accordian pane content.
SqlConnection con = new SqlConnection("Data Source=YT_CC2-PC\\YAKSHNA;Integrated Security=TRUE;Initial Catalog=todaysdiscover");
SqlCommand cmd = new SqlCommand("select title, abstract,domain from projectdetails", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
protected void contact_Click(object sender, EventArgs e)
{ //here how can i get abstarct from previous page(accordion pane content)
//how can i use
string adminmail = null;
SqlConnection con = new SqlConnection(strConnection);
con.Open();
SqlCommand cmd = new SqlCommand("select email from projectdetails where abstract=@abstract", con);
cmd.Parameters.AddWithValue("@abstract", abst);
SqlDataReader dr = null;
dr = cmd.ExecuteReader();
dr.Read();
if (dr.HasRows)
{
if (dr != null)
{
adminmail = dr["email"].ToString();
dr.Close();
con.Close();
}
}
try
{
MailMessage EmailMsg = new MailMessage();
EmailMsg.From = new MailAddress("baskerganesan@gmail.com","Basker");
EmailMsg.To.Add(adminmail);
EmailMsg.Subject = "Todays Discover:Person Wants Your Project";
EmailMsg.Body = "<html><body>Please find person contact details with this mail<br/><br/><b>"+
"<br/>First Name" +fname.Text+
"<br/>Last Name" +lname.Text+
"<br/>Name of Organisation" +noor.Text+
"<br/>EmailID" +emailid.Text+
"<br/>Country"+country.Text+
"<br/>State"+state.Text+
"<br/>City"+city.Text+
"</b><br/><br/>" +
"--<br/>With Regards," +
"<br/>Todays Discover Support Team" +
"<br/>www.*******.com" +
"<br/>Tel : +91*********" +
"<br/>Fax : +91*********" + "</body></html>";
Note: I do not know what is length of abstract field. If it too long string then passing it through querystring may not work. In that case i suggest you retrieve ID from projectdetails e.g.
id, select title, abstract, domain from projectdetails (id can be any field name that is unique or primary key column).
Then above code line will be: link.NavigateUrl = "Default.aspx?id=" + dr["id"].ToString();
And then on secong page get email by that id value e.g. select email from projectdetails where id = @id
i want to display data dynamically from database into accordion pane.it works fine(if i use without three dropdown). but here i used three dropdown(one based on item selected on another one). based on item selected on this three dropdown ,data should display
in accordion pane. but it is not displaying in accordion pane.
please have a look and reply me
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
public partial class display : System.Web.UI.Page
{
private String strConnection = "Data Source=YT_CC2-PC\\YAKSHNA;Initial Catalog=todaysdiscover;Integrated Security=True";
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
//third based on second
protected void progsec_SelectedIndexChanged(object sender, EventArgs e)
{
//it will check whether user is employee or not,if he select employee other label in third will be hide except related to employee in second drop
if (progsec.SelectedValue == "13")
{
qualification.Visible = false;
qual.Visible = false;
}
else if (progsec.SelectedValue == "14")
{
qualification.Visible = false;
qual.Visible = false;
}
else if (progsec.SelectedValue == "15")
{
qualification.Visible = false;
qual.Visible = false;
}
else if (progsec.SelectedValue == "16")
{
qualification.Visible = false;
qual.Visible = false;
}
else
{
qualification.Visible = true;
qual.Visible = true;
int degreeid = Convert.ToInt32(progsec.SelectedValue);
SqlConnection con = new SqlConnection(strConnection);
con.Open();
SqlCommand cmd = new SqlCommand("select * from qualificationtb where degreeid=" + degreeid, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
qualification.DataSource = ds;
qualification.DataTextField = "qualificationname";
qualification.DataValueField = "qualificationid";
qualification.DataBind();
qualification.Items.Insert(0, new ListItem("--Select--", "0"));
}
} protected void PopulateAcrDynamically()
{
string str = stream.SelectedItem.ToString();
string prgsec = progsec.SelectedItem.ToString();
string qua = qualification.SelectedItem.ToString();
SqlConnection con = new SqlConnection("Data Source=YT_CC2-PC\\YAKSHNA;Integrated Security=TRUE;Initial Catalog=todaysdiscover"); SqlCommand cmd = new SqlCommand("SELECT title, abstract,domain FROM projectdetails WHERE stream=@stream AND programsector=@programsector AND qualification=@qualification", con);
cmd.Parameters.AddWithValue("@stream", str);
cmd.Parameters.AddWithValue("@programsector", prgsec);
cmd.Parameters.AddWithValue("@qualification", qua);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
baskerganesa...
Member
253 Points
367 Posts
how to use accordion pane
May 02, 2012 06:31 AM|LINK
All, i am using this code for dynamically populate data from database into accordian pane. it works fine.
My doubt is - i am showing details(abstract) in accordian pane content and also i created one hyperlink inside pane content.if user clicks hyperlink it goes to another page ,In next page i want to extract email from projectdetails table based on accordion content (abstract) selected by user. have to take email from table based on abstract selected by user in accordian pane content.
aspx.page
<asp:Accordion ID="acrDynamic" runat="server" SelectedIndex="0"
HeaderCssClass="headerAccordion" ContentCssClass="contentAccordion" style="z-index: 1; left: 10px; top: 105px; position: absolute; height: 175px; width: 300px">
</asp:Accordion>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
page 1.
private void PopulateAcrDynamically()
{
SqlConnection con = new SqlConnection("Data Source=YT_CC2-PC\\YAKSHNA;Integrated Security=TRUE;Initial Catalog=todaysdiscover");
SqlCommand cmd = new SqlCommand("select title, abstract,domain from projectdetails", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count != 0)
{
Label lbTitle;
Label lbContent;
Label lbdomain;
HyperLink link;
AjaxControlToolkit.AccordionPane pn;
int i = 0;
// This is just to use for assigning pane an id
foreach (DataRow dr in ds.Tables[0].Rows)
{
lbTitle = new Label();
lbContent = new Label();
lbdomain = new Label();
link = new HyperLink();
lbTitle.Text = "Project Title-" + dr["title"].ToString();
lbdomain.Text = " " + " " + " " + " " + " " + " " + " " + "Project Domain-" + dr["domain"].ToString();
lbContent.Text = dr["abstract"].ToString();
link.Text = "\n" + "Contact Author?";
link.NavigateUrl = "Default.aspx";
pn = new AjaxControlToolkit.AccordionPane();
pn.ID = "Pane" + i;
pn.HeaderContainer.Controls.Add(lbTitle);
pn.HeaderContainer.Controls.Add(lbdomain);
pn.ContentContainer.Controls.Add(lbContent);
pn.ContentContainer.Controls.Add(link);
acrDynamic.Panes.Add(pn);
++i;
}
}
}
page 2.
protected void contact_Click(object sender, EventArgs e)
{
//here how can i get abstarct from previous page(accordion pane content)
//how can i use
string adminmail = null;
SqlConnection con = new SqlConnection(strConnection);
con.Open();
SqlCommand cmd = new SqlCommand("select email from projectdetails where abstract=@abstract", con);
cmd.Parameters.AddWithValue("@abstract", abst);
SqlDataReader dr = null;
dr = cmd.ExecuteReader();
dr.Read();
if (dr.HasRows)
{
if (dr != null)
{
adminmail = dr["email"].ToString();
dr.Close();
con.Close();
}
}
try
{
MailMessage EmailMsg = new MailMessage();
EmailMsg.From = new MailAddress("baskerganesan@gmail.com","Basker");
EmailMsg.To.Add(adminmail);
EmailMsg.Subject = "Todays Discover:Person Wants Your Project";
EmailMsg.Body = "<html><body>Please find person contact details with this mail<br/><br/><b>"+
"<br/>First Name" +fname.Text+
"<br/>Last Name" +lname.Text+
"<br/>Name of Organisation" +noor.Text+
"<br/>EmailID" +emailid.Text+
"<br/>Country"+country.Text+
"<br/>State"+state.Text+
"<br/>City"+city.Text+
"</b><br/><br/>" +
"--<br/>With Regards," +
"<br/>Todays Discover Support Team" +
"<br/>www.*******.com" +
"<br/>Tel : +91*********" +
"<br/>Fax : +91*********" + "</body></html>";
EmailMsg.IsBodyHtml = true;
EmailMsg.Priority = MailPriority.High;
SmtpClient MailClient = new SmtpClient();
MailClient.Host = "smtp.gmail.com";
MailClient.Port = 587;
MailClient.Credentials = new System.Net.NetworkCredential("baskerganesan@gmail.com", "mailpassword");
MailClient.EnableSsl = true;
MailClient.Send(EmailMsg);
Label1.Text = "Please check your mail";
}
catch (Exception ex)
{
throw ex;
}
}
}
niksv
Contributor
5925 Points
1115 Posts
Re: how to use accordion pane
May 02, 2012 11:07 AM|LINK
link.NavigateUrl = "Default.aspx?abs=" + dr["abstract"].ToString();
Note: I do not know what is length of abstract field. If it too long string then passing it through querystring may not work. In that case i suggest you retrieve ID from projectdetails e.g. id, select title, abstract, domain from projectdetails (id can be any field name that is unique or primary key column).
Then above code line will be: link.NavigateUrl = "Default.aspx?id=" + dr["id"].ToString();
And then on secong page get email by that id value e.g. select email from projectdetails where id = @id
I hope you know how to work with querystring.
baskerganesa...
Member
253 Points
367 Posts
Re: how to use accordion pane
May 02, 2012 11:12 AM|LINK
Thanks for you reply
The length will be long.It may be lead to one or two or more .it is depend upon user.
now only going to start what you said
if i have doubt i will ask you
baskerganesa...
Member
253 Points
367 Posts
Re: how to use accordion pane
May 02, 2012 11:50 AM|LINK
if i use that id in where condition . "it shows the id does not exist in the current context"
please reply me
baskerganesa...
Member
253 Points
367 Posts
PLEASE GIVE RESPOND TO MY THREAD
May 03, 2012 07:48 AM|LINK
All,
i want to display data dynamically from database into accordion pane.it works fine(if i use without three dropdown). but here i used three dropdown(one based on item selected on another one). based on item selected on this three dropdown ,data should display in accordion pane. but it is not displaying in accordion pane.
please have a look and reply me
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
public partial class display : System.Web.UI.Page
{
private String strConnection = "Data Source=YT_CC2-PC\\YAKSHNA;Initial Catalog=todaysdiscover;Integrated Security=True";
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Binddropdown();
}
PopulateAcrDynamically();
}
protected void Binddropdown()
{
//conenction path for database
SqlConnection con = new SqlConnection(strConnection);
con.Open();
SqlCommand cmd = new SqlCommand("select * from streamtb", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
stream.DataSource = ds;
stream.DataTextField = "streamname";
stream.DataValueField = "streamid";
stream.DataBind();
stream.Items.Insert(0, new ListItem("--Select--", "0"));
progsec.Items.Insert(0, new ListItem("--Select--", "0"));
qualification.Items.Insert(0, new ListItem("--Select--", "0"));
}
/// <summary>
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
//second dropdrown based on first
protected void stream_SelectedIndexChanged(object sender, EventArgs e)
{
int streamid = Convert.ToInt32(stream.SelectedValue);
SqlConnection con = new SqlConnection(strConnection);
con.Open();
SqlCommand cmd = new SqlCommand("select * from degreetb where streamid=" + streamid, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
progsec.DataSource = ds;
progsec.DataTextField = "degreename";
progsec.DataValueField = "degreeid";
progsec.DataBind();
progsec.Items.Insert(0, new ListItem("--Select--", "0"));
if (progsec.SelectedValue == "4")
{
qualification.Visible = false;
qual.Visible = false;
}
}
/// <summary>
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
//third based on second
protected void progsec_SelectedIndexChanged(object sender, EventArgs e)
{
//it will check whether user is employee or not,if he select employee other label in third will be hide except related to employee in second drop
if (progsec.SelectedValue == "13")
{
qualification.Visible = false;
qual.Visible = false;
}
else if (progsec.SelectedValue == "14")
{
qualification.Visible = false;
qual.Visible = false;
}
else if (progsec.SelectedValue == "15")
{
qualification.Visible = false;
qual.Visible = false;
}
else if (progsec.SelectedValue == "16")
{
qualification.Visible = false;
qual.Visible = false;
}
else
{
qualification.Visible = true;
qual.Visible = true;
int degreeid = Convert.ToInt32(progsec.SelectedValue);
SqlConnection con = new SqlConnection(strConnection);
con.Open();
SqlCommand cmd = new SqlCommand("select * from qualificationtb where degreeid=" + degreeid, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
qualification.DataSource = ds;
qualification.DataTextField = "qualificationname";
qualification.DataValueField = "qualificationid";
qualification.DataBind();
qualification.Items.Insert(0, new ListItem("--Select--", "0"));
}
}
protected void PopulateAcrDynamically()
{
string str = stream.SelectedItem.ToString();
string prgsec = progsec.SelectedItem.ToString();
string qua = qualification.SelectedItem.ToString();
SqlConnection con = new SqlConnection("Data Source=YT_CC2-PC\\YAKSHNA;Integrated Security=TRUE;Initial Catalog=todaysdiscover");
SqlCommand cmd = new SqlCommand("SELECT title, abstract,domain FROM projectdetails WHERE stream=@stream AND programsector=@programsector AND qualification=@qualification", con);
cmd.Parameters.AddWithValue("@stream", str);
cmd.Parameters.AddWithValue("@programsector", prgsec);
cmd.Parameters.AddWithValue("@qualification", qua);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count != 0)
{
Label lbTitle;
Label lbContent;
Label lbdomain;
HyperLink link;
AjaxControlToolkit.AccordionPane pn;
int i = 0;
// This is just to use for assigning pane an id
foreach (DataRow dr in ds.Tables[0].Rows)
{
lbTitle = new Label();
lbContent = new Label();
lbdomain = new Label();
link = new HyperLink();
lbTitle.Text = "Project Title-" + dr["title"].ToString();
lbdomain.Text = " " + " " + " " + " " + " " + " " + " " + "Project Domain-" + dr["domain"].ToString();
lbContent.Text = dr["abstract"].ToString();
link.Text = "\n" + "Contact Author?";
link.NavigateUrl = "contact1.aspx?id=" + dr["title"].ToString();
pn = new AjaxControlToolkit.AccordionPane();
pn.ID = "Pane" + i;
pn.HeaderContainer.Controls.Add(lbTitle);
pn.HeaderContainer.Controls.Add(lbdomain);
pn.ContentContainer.Controls.Add(lbContent);
pn.ContentContainer.Controls.Add(link);
acrDynamic.Panes.Add(pn);
++i;
}
}
}
}
kedarrkulkar...
All-Star
34545 Points
5554 Posts
Re: PLEASE GIVE RESPOND TO MY THREAD
May 03, 2012 08:46 AM|LINK
did u debug the code? place breakpoint in function PopulateAcrDynamically()
and check what is selected value is returned from all threee dropdowns... it might be that the one of dropdown returing --Select-- as selecteditem
progsec.SelectedItem.ToString();
and hence, the sql query is failing to return expected result
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
parthiban566
Member
68 Points
25 Posts
Re: PLEASE GIVE RESPOND TO MY THREAD
May 03, 2012 08:51 AM|LINK
I have send u my cooding,, accourding to ur scenario ..
PLZ check it
source... code....
<div></div> <div>private String strConnection = "Data Source=XZCBJ017550;Initial Catalog=MySamplesDB;Integrated Security=True"; <div>protected void Page_Load(object sender, EventArgs e)</div> <div>{</div> <div>if(!IsPostBack)</div> <div>{</div> <div>BindContrydropdown();</div> <div>}</div> <div></div> <div>}</div> <div>/// <summary></div> <div>/// Bind COuntrydropdown</div> <div>/// </summary></div> <div>protected void BindContrydropdown()</div> <div>{</div> <div>//conenction path for database</div> <div>SqlConnection con = new SqlConnection(strConnection);</div> <div>con.Open();</div> <div>SqlCommand cmd = new SqlCommand("select * from CountryTable", con);</div> <div>SqlDataAdapter da = new SqlDataAdapter(cmd);</div> <div>DataSet ds = new DataSet();</div> <div>da.Fill(ds);</div> <div>con.Close();</div> <div>ddlCountry.DataSource = ds;</div> <div>ddlCountry.DataTextField = "CountryName";</div> <div>ddlCountry.DataValueField = "CountryID";</div> <div>ddlCountry.DataBind();</div> <div>ddlCountry.Items.Insert(0, new ListItem("--Select--", "0"));</div> <div>ddlState.Items.Insert(0, new ListItem("--Select--", "0"));</div> <div>ddlRegion.Items.Insert(0, new ListItem("--Select--", "0"));</div> <div></div> <div>}</div> <div>/// <summary></div> <div>/// Bind State Dropdown Based on CountryID</div> <div>/// </summary></div> <div>/// <param name="sender"></param></div> <div>/// <param name="e"></param></div> <div>protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e)</div> <div>{</div> <div>int CountryID = Convert.ToInt32(ddlCountry.SelectedValue);</div> <div>SqlConnection con = new SqlConnection(strConnection);</div> <div>con.Open();</div> <div>SqlCommand cmd = new SqlCommand("select * from StateTable where CountryID="+CountryID, con);</div> <div>SqlDataAdapter da = new SqlDataAdapter(cmd);</div> <div>DataSet ds = new DataSet();</div> <div>da.Fill(ds);</div> <div>con.Close();</div> <div>ddlState.DataSource = ds;</div> <div>ddlState.DataTextField = "StateName";</div> <div>ddlState.DataValueField = "StateID";</div> <div>ddlState.DataBind();</div> <div>ddlState.Items.Insert(0, new ListItem("--Select--", "0"));</div> <div>if(ddlState.SelectedValue=="0")</div> <div>{</div> <div>ddlRegion.Items.Clear();</div> <div>ddlRegion.Items.Insert(0, new ListItem("--Select--", "0"));</div> <div>}</div> <div></div> <div>}</div> <div>/// <summary></div> <div>/// Bind Region dropdown based on Re</div> <div>/// </summary></div> <div>/// <param name="sender"></param></div> <div>/// <param name="e"></param></div> <div>protected void ddlState_SelectedIndexChanged(object sender, EventArgs e)</div> <div>{</div> <div>int StateID = Convert.ToInt32(ddlState.SelectedValue);</div> <div>SqlConnection con = new SqlConnection(strConnection);</div> <div>con.Open();</div> <div>SqlCommand cmd = new SqlCommand("select * from RegionTable where StateID=" + StateID, con);</div> <div>SqlDataAdapter da = new SqlDataAdapter(cmd);</div> <div>DataSet ds = new DataSet();</div> <div>da.Fill(ds);</div> <div>con.Close();</div> <div>ddlRegion.DataSource = ds;</div> <div>ddlRegion.DataTextField = "RegionName";</div> <div>ddlRegion.DataValueField = "RegionID";</div> <div>ddlRegion.DataBind();</div> <div>ddlRegion.Items.Insert(0, new ListItem("--Select--", "0"));</div> <div>}</div> </div>parthiban566
Member
68 Points
25 Posts
Re: PLEASE GIVE RESPOND TO MY THREAD
May 03, 2012 08:56 AM|LINK
I have attached my cooding , accourding to ur scenario....
<div></div> <div>code....</div> <div></div> <div>private String strConnection = "Data Source=XZCBJ017550;Initial Catalog=MySamplesDB;Integrated Security=True"; <div>protected void Page_Load(object sender, EventArgs e)</div> <div>{</div> <div>if(!IsPostBack)</div> <div>{</div> <div>BindContrydropdown();</div> <div>}</div> <div></div> <div>}</div> <div>/// <summary></div> <div>/// Bind COuntrydropdown</div> <div>/// </summary></div> <div>protected void BindContrydropdown()</div> <div>{</div> <div>//conenction path for database</div> <div>SqlConnection con = new SqlConnection(strConnection);</div> <div>con.Open();</div> <div>SqlCommand cmd = new SqlCommand("select * from CountryTable", con);</div> <div>SqlDataAdapter da = new SqlDataAdapter(cmd);</div> <div>DataSet ds = new DataSet();</div> <div>da.Fill(ds);</div> <div>con.Close();</div> <div>ddlCountry.DataSource = ds;</div> <div>ddlCountry.DataTextField = "CountryName";</div> <div>ddlCountry.DataValueField = "CountryID";</div> <div>ddlCountry.DataBind();</div> <div>ddlCountry.Items.Insert(0, new ListItem("--Select--", "0"));</div> <div>ddlState.Items.Insert(0, new ListItem("--Select--", "0"));</div> <div>ddlRegion.Items.Insert(0, new ListItem("--Select--", "0"));</div> <div></div> <div>}</div> <div>/// <summary></div> <div>/// Bind State Dropdown Based on CountryID</div> <div>/// </summary></div> <div>/// <param name="sender"></param></div> <div>/// <param name="e"></param></div> <div>protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e)</div> <div>{</div> <div>int CountryID = Convert.ToInt32(ddlCountry.SelectedValue);</div> <div>SqlConnection con = new SqlConnection(strConnection);</div> <div>con.Open();</div> <div>SqlCommand cmd = new SqlCommand("select * from StateTable where CountryID="+CountryID, con);</div> <div>SqlDataAdapter da = new SqlDataAdapter(cmd);</div> <div>DataSet ds = new DataSet();</div> <div>da.Fill(ds);</div> <div>con.Close();</div> <div>ddlState.DataSource = ds;</div> <div>ddlState.DataTextField = "StateName";</div> <div>ddlState.DataValueField = "StateID";</div> <div>ddlState.DataBind();</div> <div>ddlState.Items.Insert(0, new ListItem("--Select--", "0"));</div> <div>if(ddlState.SelectedValue=="0")</div> <div>{</div> <div>ddlRegion.Items.Clear();</div> <div>ddlRegion.Items.Insert(0, new ListItem("--Select--", "0"));</div> <div>}</div> <div></div> <div>}</div> <div>/// <summary></div> <div>/// Bind Region dropdown based on Re</div> <div>/// </summary></div> <div>/// <param name="sender"></param></div> <div>/// <param name="e"></param></div> <div>protected void ddlState_SelectedIndexChanged(object sender, EventArgs e)</div> <div>{</div> <div>int StateID = Convert.ToInt32(ddlState.SelectedValue);</div> <div>SqlConnection con = new SqlConnection(strConnection);</div> <div>con.Open();</div> <div>SqlCommand cmd = new SqlCommand("select * from RegionTable where StateID=" + StateID, con);</div> <div>SqlDataAdapter da = new SqlDataAdapter(cmd);</div> <div>DataSet ds = new DataSet();</div> <div>da.Fill(ds);</div> <div>con.Close();</div> <div>ddlRegion.DataSource = ds;</div> <div>ddlRegion.DataTextField = "RegionName";</div> <div>ddlRegion.DataValueField = "RegionID";</div> <div>ddlRegion.DataBind();</div> <div>ddlRegion.Items.Insert(0, new ListItem("--Select--", "0"));</div> <div>}</div> </div>sriramabi
Contributor
4351 Points
1277 Posts
Re: PLEASE GIVE RESPOND TO MY THREAD
May 03, 2012 09:05 AM|LINK
Hai
http://www.aspdotnet-suresh.com/2011/01/introduction-here-i-will-explain-how-to.html
http://www.dotnetspider.com/resources/39350-Cascading-DropDownList.aspx
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/CascadingDropDown/CascadingDropDown.aspx
thank u
baskerganesa...
Member
253 Points
367 Posts
Re: PLEASE GIVE RESPOND TO MY THREAD
May 03, 2012 09:14 AM|LINK
drop down is working fine,
problem is the selected item in drop down is not showing in accordion pane
the code which you mentioned for dropdown is same for me also. i used that code only