本文整理汇总了C#中IExecutionContext.Transfer方法的典型用法代码示例。如果您正苦于以下问题:C# IExecutionContext.Transfer方法的具体用法?C# IExecutionContext.Transfer怎么用?C# IExecutionContext.Transfer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IExecutionContext
的用法示例。
在下文中一共展示了IExecutionContext.Transfer方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoProcessRequest
/// <summary>
/// Controller implementation. User signout is performed by calling Authenticate with null as the
/// user.
/// </summary>
/// <param name="context">The context.</param>
public override void DoProcessRequest(IExecutionContext context)
{
FormsAuth.SignOut();
context.Authenticate(null);
context.Transfer("home/index");
}
示例2: DoProcessRequest
/// <summary>
/// Controller implementation
/// </summary>
/// <param name="context">The context.</param>
public override void DoProcessRequest(IExecutionContext context)
{
if (!ValidateLogon())
return;
context.Authenticate(FormsAuth.SignIn(username, rememberMe));
context.Transfer("/home/index");
}
示例3: DoProcessRequest
public override void DoProcessRequest(IExecutionContext context)
{
if (!String.IsNullOrEmpty(published))
SetPublishState();
else
UpdatePosting();
context.Transfer("/posting/manage");
}
示例4: DoProcessRequest
public override void DoProcessRequest(IExecutionContext context)
{
if (!String.IsNullOrEmpty(published))
{
SetPublishState();
context.Transfer("/posting/resume/preview/byname/" + posting.ShortName);
}
else
UpdatePosting();
}
示例5: DoProcessRequest
public override void DoProcessRequest(IExecutionContext context)
{
ContentType def = ContentTypeHelper.Instance.Parse(defaultContentType);
// if preferences have been reset elsewhere, we need to stay on this page.
if (def == null || preferenceReset)
return;
// otherwise, we have a default content type, so we redirect to the search page for it
context.Transfer("/postings/" + (def.Equals(ContentType.Resume) ? "resume" : "ad"));
}
示例6: DoProcessRequest
public override void DoProcessRequest(IExecutionContext context)
{
// if preferences have been reset elsewhere, we need to stay on this page.
if (String.IsNullOrEmpty(defaultContentType) || preferenceReset)
return;
ContentType def = ContentTypeUtility.FromString(defaultContentType);
// otherwise, we have a default content type, so we redirect to the search page for it
context.Transfer("/postings/" + ContentTypeUtility.AsString(def));
}
示例7: DoProcessRequest
public override void DoProcessRequest(IExecutionContext context)
{
UserProfile profile = UserDataAccess.Instance.LoadUser(username);
if (profile == null || !profile.Authenticate(password))
{
ReportError(null, "The user name or password is incorrect");
return;
}
else
// this is the key line. this sets the profile as the
// current user, and marks the session as authenticated
context.Authenticate(profile);
ContentType userContentType = UserTypeUtility.AsContentType(profile.UserType);
if (ContentTypeUtility.FromString(defaultContentType) != userContentType)
defaultContentType = ContentTypeUtility.AsString(userContentType);
if (String.IsNullOrEmpty(originalRequest))
context.Transfer("/default");
else
context.Transfer(HttpUtility.UrlDecode(originalRequest));
}
示例8: DoProcessRequest
public override void DoProcessRequest(IExecutionContext context)
{
if (!ValidateRegistration())
return;
MembershipCreateStatus createStatus = MembershipService.CreateUser(username, password, email);
if (createStatus == MembershipCreateStatus.Success)
{
FormsAuth.SignIn(username, false);
context.Transfer("/home/index");
}
else
ReportError(null, ErrorCodeToString(createStatus));
}
示例9: DoProcessRequest
public override void DoProcessRequest(IExecutionContext context)
{
userProfile profile = UserHelper.Instance.LoadUser(username);
if (profile == null || !profile.Authenticate(password))
{
ReportError(null, "The user name or password is incorrect");
return;
}
else
// this is the key line. this sets the profile as the
// current user, and marks the session as authenticated
context.Authenticate(profile);
if (ContentTypeHelper.Instance.Parse(defaultContentType) != profile.UserType.ContentType)
defaultContentType = ContentTypeHelper.Instance.GetSimpleName(profile.UserType.ContentType);
// hack. we didn't create a table to store the roles, so now
// we're faking them through here
if (profile.UserType.Equals(UserType.Company)) {
var node = profile.role.AppendNode();
node.Name = "company";
}
if (String.IsNullOrEmpty(originalRequest))
context.Transfer("/default");
else
context.Transfer(HttpUtility.UrlDecode(originalRequest));
}
示例10: DoProcessRequest
public override void DoProcessRequest(IExecutionContext context)
{
if (posting == null)
context.Transfer("get /posting/resume/byname");
}