protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { TransitPermalink permalink = SessionManager.GetCachedObject <TransitPermalink>( "GetPermalinkBySource", SessionManager.Ticket, new TransitPermalinkQueryOptions(RequestId, "Gallery")); linkRedirect.NavigateUrl = string.Format( "Show{0}.aspx?id={1}", permalink.TargetType, permalink.TargetId); Response.StatusCode = 301; Response.RedirectLocation = linkRedirect.NavigateUrl; Response.End(); } } catch (Exception ex) { panelRedirect.Visible = false; ReportException(new Exception(string.Format( "This permalink may not exist. The following error was returned." + "<br>{0}", ex.Message))); } }
public BlogPermalinkTest() { mPermalink = new TransitPermalink(); mPermalink.SourceId = new Random().Next(); mPermalink.TargetId = new Random().Next(); mPermalink.SourceType = Guid.NewGuid().ToString(); mPermalink.TargetType = Guid.NewGuid().ToString(); }