using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
public partial class template : System.Web.UI.Page
{
#region Introduction
private string msg; //this is the message you are going to show to your users
private TextBox [ ] holderForTxt; //holder for dynamic textboxes
private DropDownList [ ] holderForDdl;
private HtmlInputRadioButton [ ] holderForRdb;
private HtmlInputCheckBox [ ] holderForCkb;
private Label [ ] holderForAst;
DataSet ds; //dataset for metadata
DataSet pds; //parameter dataset
DataSet rds; //return set dataset
#endregion
#region Properties
//set here page properties to use with the viewstate
#endregion //Properties
protected override void OnInit ( EventArgs e )
{ //HUOMI THIS FIRST
//debug Utils.Debugger.WriteIf ( "template.aspx.cs OnInit method START " );
base.OnInit ( e );
Page.Load += new EventHandler ( Page_Load ); //this one has to be set if the page directive is AutoEventFireUp = "false"
if (this.IsPostBack == false)
{
//null here Session which are supposed to be null on first time loading the page
} //eof if (this.IsPostBack == false )
else
{
//debug Utils.Debugger.WriteIf ( "if (this.IsPostBack == true )" );
}
} //eof OnInit
protected override void CreateChildControls ( )
{
base.CreateChildControls ( );
CreateDynamicControls ( );
} //protected override void CreateChildControls ( )
protected override object SaveViewState ( )
{
return new Pair ( base.SaveViewState ( ), null );
}
protected override void LoadViewState ( object savedState )
{
base.LoadViewState ( ((Pair)savedState).First );
EnsureChildControls ( );
} //LoadViewState
protected void Page_Load ( object sender, EventArgs e )
{ //comm -- the controls should be generated at the init stage and the databinding happens here
if (this.IsPostBack == false)
{
} //only on post back
else
{
}
this.DataBind ();
} //eof Page_Load
private void CreateDynamicControls ()
{
if (Session [ "template.ClickSearchClicked" ] != null && (int)Session [ "template.ClickSeachClicked" ] == 1)
{
this.BuildDynamicControls ();
} //eof if
} //eof CreateDynamicControls
protected void ClickSearch ( object sender , EventArgs e )
{
//GO GET THE DATA FROM THE DATABASE
//PUT DATA INTO class variable and session
//ds = methodToGetDataFromDb ;
//Session [ "ds"] = ds ;
//Session [ "template.ClickSearchClicked" ] = 1;
this.BuildDynamicControls ();
} //eof ClickSearch
private void BuildDynamicControls()
{
//ds = Session [ "ds" ] ; //get the data from the Session obj
//use the ds to actually construct the controls
} //eof BuildDynamicControls
} //eof class template
Getting the Current TabItem when the Tab is not selected in WPF
-
[image: Banner]
This is a quick reminder to self on how to retrieve a TabItem from a WPF
TabControl *when the tab is not currently selected* because I ru...
1 month ago