Skip to content

Instantly share code, notes, and snippets.

@origamirobot
Last active December 12, 2015 03:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save origamirobot/4707872 to your computer and use it in GitHub Desktop.
Save origamirobot/4707872 to your computer and use it in GitHub Desktop.
C#
protected override void OnPreRenderComplete(EventArgs e)
{
// LOOK FOR A SESSION VARIABLE CALLED "trail"
if (Session["BreadcrumbTrailThatWillClickNavigation"] != null)
{
// SESSION CONTAINS THE VARIABLE. EXPAND MENU TO SHOW THAT TRAIL
String script = "hj$(document).ready(function () { oreida.SiteNav.load('" + Session["BreadcrumbTrailThatWillClickNavigation"] + "'); });";
//ScriptPlaceholderBottom.Controls.Add(src);
HtmlGenericControl htmlScript = new HtmlGenericControl("script");
htmlScript.Attributes.Add("type", "text/javascript");
htmlScript.InnerHtml = string.Format("\n{0}\n", script);
ScriptPlaceholderBottom.Parent.Controls.Add(htmlScript);
// REMOVE UN NEEDED SESSION VARIABLE
Session.Remove("BreadcrumbTrailThatWillClickNavigation");
}
base.OnPreRenderComplete(e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment