All pastes #625205 Raw Edit

MuteThis

public text v1 · immutable
·published 2007-07-18 20:29 UTC
rendered paste body
public partial class _Default : System.Web.UI.Page 
{
	// where LastTab is defined as
	// <asp:HiddenField ID="LastTab" runat="server" />
	int Tab;
	bool TabChanged = false;

	protected void Page_Init(object sender, EventArgs e)
	{
		// you might need to do Request.Form["LastTab"]
		if (Page.IsPostBack == false ||
			int.TryParse(LastTab.Value, Tab) == false)
		{
			// default tab
			Tab = 0;
		}

		LoadTabControls(Tab);
	}

	protected void Page_Load(object sender, EventArgs e)
	{

	}

	protected void Page_PreRender(object sender, EventArgs e)
	{
		if (TabChanged == true)
		{
			//ph1.Controls.Clear();
			LoadTabControls(Tab);
		}

		LastTab.Value = Tab.ToString();
	}

	protected void Rad_TabChanged(object sender, EventArgs e)
	{
		// Tab = e.NewTab
		TabChanged = true;
	}

	protected void LoadTabControls()
	{
		// dynamically load the controls for a tab here
		// using the Tab field
	}
}