0
我正在使用Sitecore,我必須在頁面集合中顯示第一頁。這裏是我的代碼到目前爲止:Server.Transfer頁面
private Item currItem = Sitecore.Context.Item;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (currItem.HasChildren || currItem.TemplateID == new Sitecore.Data.ID("45D58815-A301-4393-9BA0-30A00C9BB993"))
{
var getFirstChild = (from Item item in currItem.GetChildren()
select item).First();
if (getFirstChild.TemplateID == new Sitecore.Data.ID("45D58815-A301-4393-9BA0-30A00C9BB993") && getFirstChild != null)
{
//Server.Transfer(getFirstChild.Paths.Path);
}
else
{
//Load Generic Page!
}
}
else
{
//Load Generic Page!!!
}
}
}
試過了,沒有工作。你能告訴我代碼嗎?謝謝! – 2012-08-01 20:51:12
好的,您可以發佈您使用上述代碼的方法的所有代碼嗎?當我看到你的代碼時,會看看我能否進一步提供幫助。我需要知道你的代碼是否在Page_Load()或類似的東西中。 – 2012-08-01 20:52:59
請參閱我的編輯。我的頁面中有標籤,每個標籤本身就是另一個.aspx頁面。當我加載家庭時,我得到第一個選項卡,我需要將我的頁面路由到該頁面。 – 2012-08-01 21:00:30