TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rubiya Rajamanickam
NA
64
3.7k
My Dropdownlist always take the 1st value of database
Apr 22 2016 3:37 AM
if (Session["User_Name"] == null)
{
Response.Redirect("Salon.aspx");
}
else
{
IEnumerator mc;
mc = Request.Cookies.AllKeys.GetEnumerator();
while (mc.MoveNext())
{
if (Request.Cookies[mc.Current.ToString()].HasKeys == true)
{
IEnumerator sc;
sc = Request.Cookies[mc.Current.ToString()].Value.GetEnumerator();
if (!Page.IsPostBack)
{
Wella.Visible = false;
Sebastian.Visible = false;
Nioxin.Visible = false;
illumina.Visible = false;
DropDownList1.AutoPostBack = true;
string Value = DropDownList1.SelectedValue;
lbUserName.Text = "WELCOME:: " + Session["User_Name"];
SqlConnection con = new SqlConnection(ConStr);
{
SqlCommand com = new SqlCommand("select User_Name,Company_Name from tblCompany where User_Name='" + Session["User_Name"] + "' ", con);
{
SqlDataAdapter da = new SqlDataAdapter(com);
DataSet ds = new DataSet();
da.Fill(ds);
DropDownList1.DataSource = ds;
DropDownList1.DataTextField = "Company_Name";
DropDownList1.DataValueField = "User_Name";
DropDownList1.DataBind();
DropDownList1.Items.Insert(0, new ListItem("---Select---", String.Empty));
DropDownList1.SelectedIndex = 0;
}
}
}
}
}
}
Reply
Answers (
4
)
How to URL rewrite in asp.net using Web.config file ?
how to get client side mac ID.