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
Rocky Rocky
NA
317
151.1k
How to show the selected value from drop down from one page
Feb 28 2014 5:16 AM
Hi Friends,
i m creating one web application my requirements are
1)country: Default label
2)States : COMBO BOX
(when i choose the value from the box the page ll be redirect)
for example:
country : INDIA
states : list show "TN,PONDI"
when i choose pondi ll redirect into "pondi.aspx"
but my drop down box was not show the selected value(i.e combo box again showed --- select--- but i need selected "PONDI" in combo after page redirect)
my codes for combobox:
Select Country:
<asp:TextBox ID="TextBox1" runat="server" Text="India" Height="17px" Width="82px"></asp:TextBox><br /> <br />
Select State: <asp:DropDownList ID="ddlstate" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlstate_SelectedIndexChanged">
<asp:ListItem Text="Select" Value="0">--select--</asp:ListItem>
<asp:ListItem Text="Pondicherry" Value="1">Pondicherry</asp:ListItem>
<asp:ListItem Text="TamilNadu" Value="2">Tamil Nadu</asp:ListItem>
</asp:DropDownList>
in c#:
protected void ddlstate_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlstate.SelectedItem.Text == "Pondicherry")
{
Server.Transfer("Pondi.aspx?ddlstateonnextpage" + AB);
}
else if (ddlstate.SelectedItem.Text == "Tamil Nadu")
{
Server.Transfer("TN.aspx?ddlstateonnextpage" + AB);
}
}
}
how to make code?
thanks & Regards
rocky
Reply
Answers (
1
)
insert data into database when user enters data within dgv
twitter.cs