This is a migrated thread and some comments may be shown as answers.

create breadcrumb navigation for ascx control using panel bar

0 Answers 93 Views
Panelbar (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
saroja
Top achievements
Rank 1
saroja asked on 27 Aug 2009, 07:19 AM

hai! I have use below code for ascx control page navigation depending upon ascx page name using panel bar...I need breadcrumb for ascx page navigation..can anyone findout some samples...


public
string TrackedUserControl

 

{

 

get { return ViewState["TrackedUserControl"] as string; }

 

 

set { ViewState["TrackedUserControl"] = value; }

 

}

 

protected void Page_Load(object sender, EventArgs e)

 

{

 

if (!IsPostingFromMenu() && IsPostBack)

 

ReloadContent();

}

 

protected void PanelNavigation_PanelNavigationItemClick(object sender, RadPanelBarEventArgs e)

 

{

 

LoadContent(e.Item.Value);

 

}

 

 

private void LoadContent(string menuItemName)

 

{

 

string ucUrl = menuItemName + ".ascx";

 

 

UserControl uc = null;

 

 

try

 

{

uc =

this.LoadControl(ucUrl) as UserControl;

 

 

if (uc != null)

 

{

ContentPlaceholder.Controls.Add(uc);

TrackedUserControl = ucUrl;

}

}

 

catch (Exception ex)

 

{

 

string msg = ex.Message;

 

}

}

 

private void ReloadContent()

 

{

 

UserControl uc = null;

 

 

try

 

{

uc =

this.LoadControl(TrackedUserControl) as UserControl;

 

}

 

catch

 

{

}

 

if (uc != null)

 

ContentPlaceholder.Controls.Add(uc);

}

 

private bool IsPostingFromMenu()

 

{

 

string ctlPostingBack = ScriptManager.GetCurrent(this).AsyncPostBackSourceElementID;

 

 

Control c = this.FindControl(ctlPostingBack);

 

 

if (c == null)

 

 

return false;

 

 

return (c.ID == "PanelNavigation");

 

}


thx

Tags
Panelbar (obsolete as of Q2 2010)
Asked by
saroja
Top achievements
Rank 1
Share this question
or