Last active
December 21, 2015 00:59
-
-
Save sniffdk/6224859 to your computer and use it in GitHub Desktop.
Register a script oninit in /editcontent.aspx to allow for tab switching.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyApplication : Umbraco.Web.UmbracoApplication | |
{ | |
protected override void OnApplicationStarted(object sender, EventArgs e) | |
{ | |
umbracoPage.Init += (p, args) => | |
{ | |
var page = p as umbracoPage; | |
if (page == null) | |
return; | |
var request = page.Page.Request; | |
var path = request.Path.ToLower(); | |
if (!path.EndsWith("/editcontent.aspx")) | |
return; | |
var tab = request.QueryString["tab"]; | |
if(!string.IsNullOrEmpty(tab)) | |
{ | |
var setActiveTab = "setActiveTab('body_TabView1','body_TabView1_tab0" + tab + "',body_TabView1_tabs);"; | |
page.Page.ClientScript.RegisterClientScriptBlock(GetType(), "OpenTab", "<script> $(function () { " + setActiveTab + " })</script>"); | |
} | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment