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
pradeepa meiyappan
NA
3
0
How to retrieve dynamically created drop down list value ?
Mar 5 2014 1:22 PM
How to retrieve value from dynamically created dropdownlist and store it into sqlserver 2008?
In my form i had name as textbox,jobtype as dropdownlist bind from database,based on that i dynamically created dropdownlist for skills and level.
After Clicking Submit Button, how to store that value into sql database.
My Table Name:
ProfileSkill
Fields:
Name, Jobtype, skills, level
My Code for Dynamic Dropdown Creation:
void
skillbind()
{
cmd.CommandText =
"select Skill from jobtype where jobname='"
+ DDLJType.SelectedItem.Text +
"' "
;
cmd.Connection = con;
con.Open();
SqlDataReader
dr = cmd.ExecuteReader();
while
(dr.Read())
{
DropDownList
ddlskill =
new
DropDownList
();
ddlskill.Items.Add( dr.GetValue(0).ToString());
PlaceHolder1.Controls.Add(ddlskill);
ddlskill.Items.Insert(0,
"------SELECT------"
);
ddlskill.Width = 200 ;
PlaceHolder1.Controls.Add(
new
LiteralControl
(
"<br/>"
));
DropDownList
ddllevel =
new
DropDownList
();
ddllevel.Items.Add(
"Beginer"
);
ddllevel.Items.Add(
"Intermediate"
);
ddllevel.Items.Add(
"Expert"
);
PlaceHolder2.Controls.Add(ddllevel);
ddllevel.Items.Insert(0,
"-----SELECT----"
);
ddllevel.Width = 200;
PlaceHolder2.Controls.Add(
new
LiteralControl
(
"<br/>"
));
}
dr.Close();
con.Close();
}
}
Reply
Answers (
0
)
render html with css applied to it inside aspx panel
Show Exam result in aspx