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
User77
NA
52
27.4k
Select different Text of Dropdown if all items value is same
Oct 28 2016 12:50 AM
Hi in my web application, i have Dropdown control is
<asp:DropDownList ID="ddlTypes" runat="server" Width="156px">
<asp:ListItem Text="----Select----" Value="0"></asp:ListItem>
<asp:ListItem Text="Adjustments" Value="1"></asp:ListItem>
<asp:ListItem Text="Charges" Value="2"></asp:ListItem>
<asp:ListItem Text="Payments" Value="1"></asp:ListItem>
<asp:ListItem Text="Write Off" Value="1"></asp:ListItem>
</asp:DropDownList>
For my requirement i take some items are same values but when i select the selected different item in dropdown the text shows "Adjustments" only
if (ddlTypes.SelectedItem.Text.ToString() == "Adjustments")
{
//some conditions
}
else if (ddlTypes.SelectedItem.Text.ToString() == "Payments")
{
//some conditions
}
else if (ddlTypes.SelectedItem.Text.ToString() == "Write Off")
{
//some conditions
}
here the text is shows only "Adjustments" not showing when i selected different text. Can anyone please tell me how can i select different with items have same values.
Thank you
Reply
Answers (
5
)
entity frame work
How do I get the selected item to be shown?