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
Sandeep kumar
NA
58
4.6k
How To bind selected sequence order from listbox in ASP.NET
Apr 27 2021 10:53 AM
<asp:ListBox ID=
"ddlTermsAndCond"
CssClass=
"ddlTermsAndCond"
runat=
"server"
SelectionMode=
"Multiple"
AutoPostBack=
"true"
OnSelectedIndexChanged=
"ddlTermsAndCond_SelectedIndexChanged1"
></asp:ListBox>
protected
void
btnTermsAdd_Click(
object
sender, EventArgs e)
{
string
TermsNdCondID =
string
.Empty;
if
(ddlTermsAndCond.SelectedIndex != -1)
{
lblMessage.Text =
string
.Empty;
foreach
(ListItem item
in
ddlTermsAndCond.Items)
{
if
(item.Selected)
{
TermsNdCondID += item.Value +
","
;
// string testValue = item[0].Value;
}
}
TermsNdCondID = TermsNdCondID.TrimEnd(
','
);
DataTable dt = Entry.GetTermsDetailsMaster(TermsNdCondID);
grdTermsNdCondDtls.DataSource = dt;
grdTermsNdCondDtls.DataBind();
grdTermsNdCond.Columns[1].Visible =
false
;
// ddlTermsAndCond.ClearSelection();
// ddlTermsAndCond.Enabled = false;
}
else
{
lblMessage.Text =
"Please Select Terms & Condition at least One"
;
lblMessage.Style.Add(
"color"
,
"red"
);
}
}
Reply
Answers (
3
)
Run HTML file in terminal
Soft Delete Record , Display by selecting Active /Inactive by dropdown