How to place the link button with in dropdown list??
I want to place the link button with in drop down??can any one tell me how to do??
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Abhishek KumarRank #510 · 4.8K reputationPosted Apr 7, 2015, 2:45 AM EDT
Try this
<asp:dropdownlist id="DropDownList1" runat="server" autopostback="True" onselectedindexchanged="DropDownList1_SelectedIndexChanged">
<asp:listitem value="Test1.aspx">Test1asp:listitem>
<asp:listitem value="Test2.aspx">Test2asp:listitem>
<asp:listitem value="Test3.aspx">Test3asp:listitem>
asp:dropdownlist>
Code Behind:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
Response.Redirect(DropDownList1.SelectedValue);
}
Hope thsi will help.
Abhishek
Usha Raj145 reputationPosted Apr 7, 2015, 3:05 AM EDT
for (int i = 0; i < GridView1.Rows.Count; i++)
{
DropDownList name = (DropDownList)GridView1.Rows[i].FindControl("ddlaction");
string str = name.ID;
//GridView1.Rows[i].Attributes.Add("onmouseover", "this.className='highlight'");
if ( name.SelectedValue=="1")
{
Response.Redirect("JobApplyingPage.aspx");
}
Here If I want to redirect the page means before I should get the id of particular row(by clicking I should get the id),,for getting the id ,we should mention command Argument right?? but this is possible only with link button
if (name.SelectedValue == "2")
{
// code
}
}
So can any one tell me how to solve this??