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.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace TestApp
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Panel Panel1;
protected System.Web.UI.WebControls.Panel Panel2;
protected System.Web.UI.WebControls.Panel Panel3;
protected System.Web.UI.WebControls.Panel Panel4;
protected System.Web.UI.WebControls.DropDownList ddl1;
protected System.Web.UI.WebControls.DropDownList ddl2;
protected System.Web.UI.WebControls.DropDownList ddl4;
protected System.Web.UI.WebControls.DropDownList ddl3;
protected System.Web.UI.WebControls.Button Button2;
protected System.Web.UI.WebControls.Button Button3;
protected System.Web.UI.WebControls.Button Button4;
protected System.Web.UI.WebControls.Button Button1;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Button2.Click += new System.EventHandler(this.Button2_Click);
this.Button3.Click += new System.EventHandler(this.Button3_Click);
this.Button4.Click += new System.EventHandler(this.Button4_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Write(" - ");
Response.Write(ddl1.SelectedValue.ToString());
}
private void Button2_Click(object sender, System.EventArgs e)
{
Response.Write(" - ");
Response.Write(ddl2.SelectedValue.ToString());
}
private void Button3_Click(object sender, System.EventArgs e)
{
Response.Write(" - ");
Response.Write(ddl3.SelectedValue.ToString());
}
private void Button4_Click(object sender, System.EventArgs e)
{
Response.Write(" - ");
Response.Write(ddl4.SelectedValue.ToString());
}
}
}
Cheers,
Jerome. M