Skip to content

Instantly share code, notes, and snippets.

@origamirobot
Created February 4, 2013 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save origamirobot/4709277 to your computer and use it in GitHub Desktop.
Save origamirobot/4709277 to your computer and use it in GitHub Desktop.
// CHECK THE TARGET PAGE FOR A NonRobotRedirector SUBLAYOUT
Control nonRobotRedirector = LayoutManager.GetLayout(I, typeof(NonRobotRedirector));
// CHECK TO SEE IF THE TARGET FOR THE BUTTON ON THIS BLOCK IS LINKING TO A PAGE THAT CONTAINS A NonRobotRedirector
if (nonRobotRedirector != null)
{
// TARGET PAGE HAS A NonRobotRedirector CONTROL ON IT. RENDER LINK AS OnClick JAVASCRIPT PUSHDOWN.
BreadcrumbList list = BreadcrumbManager.BuildBreadcrumbFromItem(I);
if (list.HasNavItem)
{
ActionButton.NavigateUrl = "#";
string id = ActionButton.ClientID;
String script = "hj$('#" + id + "').onClick(function(e){ hj$.preventDefault(e); oreida.SiteNav.load('" + list.Trail + "'); }); ";
ScriptManager.RegisterClientScriptBlock(this, typeof(BaseContentBlock), "setOnClickHandler" + this.ID, script, true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment