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
Ekrem Tapan
NA
967
81.7k
not firing dropdownlist without autopostback
May 19 2016 3:20 AM
hello everyone
i want to firing my dropdownlist without autopostback, this is possible,
below my code
<asp:UpdatePanel ID=
"UpdatePanel1"
runat=
"server"
>
<ContentTemplate>
<asp:DropDownList ID=
"ddlIndustry"
runat=
"server"
OnSelectedIndexChanged=
"ddlIndustry_SelectedIndexChanged"
></asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID=
"ddlIndustry"
EventName=
"SelectedIndexChanged"
/>
</Triggers>
</asp:UpdatePanel>
protected
void
ddlIndustry_SelectedIndexChanged(
object
sender, EventArgs e)
{
StringBuilder builder =
new
StringBuilder();
string
sqlQueryOcc =
"select SALARY_INDS_OCCNAME.INDUS_CAT_VAL,SALARY_INDS_OCCNAME.INDUS_CAT_NAME,SALARY_INDS_OCCNAME.INDUS_CAT_CODE from SALARY_INDS_OCCNAME "
;
sqlQueryOcc +=
" inner join SALARY_INDS"
;
sqlQueryOcc +=
" on SALARY_INDS_OCCNAME.INDUS_CODE = SALARY_iNDS.INDUS_CODE "
;
sqlQueryOcc +=
" where SALARY_INDS.INDUS_CODE = '"
+ ddlIndustry.SelectedValue +
"'"
;
using
(SqlCommand cmd =
new
SqlCommand(sqlQueryOcc))
{
cmd.CommandType = CommandType.Text;
cmd.Connection = conn;
conn.Open();
SqlDataAdapter da =
new
SqlDataAdapter(cmd);
DataTable dt =
new
DataTable();
da.Fill(dt);
foreach
(DataRow row
in
dt.Rows)
{
builder.AppendFormat(
"<li><span><input type='checkbox' name='sel_items[]' value='{0}' /></span>{1}</li>"
, row[
"INDUS_CAT_CODE"
].ToString(), row[
"INDUS_CAT_NAME"
].ToString());
}
conn.Close();
}
this
.occList.Text = builder.ToString();
}
Reply
Answers (
1
)
Error in publishing web App
getting data between two dates