📄 linkredirector.cs
字号:
namespace ASPNET.StarterKit.Communities.Links {
using System;
using System.Web.UI.WebControls;
//*********************************************************************
//
// LinkRedirector Class
//
// This class redirects the user to the URL represented by a link
// and records the redirection through the GetLinkUrl call.
//
//*********************************************************************
public class LinkRedirector : WebControl {
//*********************************************************************
//
// OnLoad Method
//
// Calls the GetLinkUrl method to get the Link URL from the LINK ID
// and redirects the user to the target of the link.
//
//*********************************************************************
protected override void OnLoad(EventArgs e) {
int contentPageID = Int32.Parse(Context.Request.QueryString["id"]);
string linkUrl = LinksUtility.GetLinkUrl(contentPageID);
Context.Response.Redirect(linkUrl);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -