Hi,
Eventhough you place some controls in Panels, you can directly refer from
your code behind with, their name. There should not be a problem.
I hope you to have a similar code as follows....
using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Sess ionState;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
namespace TestApp
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Pane l Panel1;
protected System.Web.UI.W ebControls.Pane l Panel2;
protected System.Web.UI.W ebControls.Pane l Panel3;
protected System.Web.UI.W ebControls.Pane l Panel4;
protected System.Web.UI.W ebControls.Drop DownList ddl1;
protected System.Web.UI.W ebControls.Drop DownList ddl2;
protected System.Web.UI.W ebControls.Drop DownList ddl4;
protected System.Web.UI.W ebControls.Drop DownList ddl3;
protected System.Web.UI.W ebControls.Butt on Button2;
protected System.Web.UI.W ebControls.Butt on Button3;
protected System.Web.UI.W ebControls.Butt on Button4;
protected System.Web.UI.W ebControls.Butt on Button1;
private void Page_Load(objec t sender, System.EventArg s e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeCompo nent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.Button1.Cl ick += new System.EventHan dler(this.Butto n1_Click);
this.Button2.Cl ick += new System.EventHan dler(this.Butto n2_Click);
this.Button3.Cl ick += new System.EventHan dler(this.Butto n3_Click);
this.Button4.Cl ick += new System.EventHan dler(this.Butto n4_Click);
this.Load += new System.EventHan dler(this.Page_ Load);
}
#endregion
private void Button1_Click(o bject sender, System.EventArg s e)
{
Response.Write( " - ");
Response.Write( ddl1.SelectedVa lue.ToString()) ;
}
private void Button2_Click(o bject sender, System.EventArg s e)
{
Response.Write( " - ");
Response.Write( ddl2.SelectedVa lue.ToString()) ;
}
private void Button3_Click(o bject sender, System.EventArg s e)
{
Response.Write( " - ");
Response.Write( ddl3.SelectedVa lue.ToString()) ;
}
private void Button4_Click(o bject sender, System.EventArg s e)
{
Response.Write( " - ");
Response.Write( ddl4.SelectedVa lue.ToString()) ;
}
}
}
Cheers,
Jerome. M
"Andy Sutorius" wrote:
Hi,
I have 4 panels, each panel has a dropdown and a "next" button. I would like
to get the selected value of the dropdown after the next button is clicked.
I thought I could use the following (ddlChooseEmail .SelectedValue) to grab
the value but it does not work. Is there something special about panels that
I need to do in order to get the selected value of the dropdown?
Thanks,
Andy