本文整理汇总了C#中MvcContext.GetLink方法的典型用法代码示例。如果您正苦于以下问题:C# MvcContext.GetLink方法的具体用法?C# MvcContext.GetLink怎么用?C# MvcContext.GetLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MvcContext
的用法示例。
在下文中一共展示了MvcContext.GetLink方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetViewById
public String GetViewById( int topicId, String typeFullName, MvcContext ctx )
{
User viewer = ctx.viewer.obj as User;
PollBase poll = getByTopic( topicId );
int boardId = getBoard( topicId );
String lnkVote = ctx.GetLink().To( new wojilu.Web.Controller.Forum.Users.PollController().Vote, poll.Id ) + "?boardId=" + boardId;
String lnkVoter = ctx.GetLink().To( new wojilu.Web.Controller.Forum.Users.PollController().Voter, poll.Id ) + "?boardId=" + boardId;
return new PollViewFactory( viewer, poll, lnkVote, lnkVoter ) .GetPollView().GetBody( false );
}
示例2: GetViewById
public String GetViewById( int pollId, String typeFullName, MvcContext ctx )
{
User viewer = ctx.viewer.obj as User;
int sectionId = (int)ctx.GetItem( "sectionId" );
PollBase poll = getByTopic( pollId );
if (poll == null) throw new NullReferenceException( lang.get( "exPollNotFound" ) );
String lnkVote = ctx.GetLink().To( new wojilu.Web.Controller.Content.Section.PollController().Vote, poll.Id ) + "?sectionId=" + sectionId;
String lnkVoter = ctx.GetLink().To( new wojilu.Web.Controller.Content.Section.PollController().Voter, poll.Id ) + "?sectionId=" + sectionId;
return new PollViewFactory( viewer, poll, lnkVote, lnkVoter ) .GetPollView().GetBody( false );
}
示例3: getFavoriteLink
public static String getFavoriteLink( MvcContext ctx, IShareData data, String name, String dataLink )
{
String queryParam = "?dataType=" + data.GetType().FullName + "&name=" + ctx.web.UrlDecode( name )
+ "&dataLink=" + dataLink;
return ctx.GetLink().To( new Common.ShareController().Add, data.Id ) + queryParam;
}
示例4: waitingApprovingCmd
private static String waitingApprovingCmd( MvcContext ctx, int targetId )
{
String cmd = "<span>" + lang.get( "inApproveFriend" ) + "...</span>";
String delpic = string.Format( "<img src=\"{0}\" />", strUtil.Join( sys.Path.Img, "delete.gif" ) );
String cancelLink = ctx.GetLink().T2( new FriendController().CancelAddFriend, targetId );
String str = "<span class=\"left5 deleteCmd\" style=\"cursor:pointer\" title=\"{0}\" href=\"{1}\">{2}</span>";
cmd += string.Format( str, lang.get( "canelFriend" ), cancelLink, delpic );
return cmd;
}
示例5: friendAndFollowCmd
private static String friendAndFollowCmd( MvcContext ctx, int targetId )
{
String cmd = "<a href=\"" + ctx.GetLink().T2( new FriendController().AddFriend, targetId ) + "\" class=\"frmBox cmd\" xwidth=\"500\" title=\"" + lang.get( "addAsFriend" ) + "\"><span>" + lang.get( "addAsFriend" ) + "</span></a>";
if (ctx.viewer.IsFollowing( targetId )) {
cmd += "<a href='" + ctx.GetLink().T2( new FriendController().DeleteFollow, targetId ) + "' class=\"deleteCmd cmd left10\"><span>" + lang.get( "cancelFollow" ) + "</span></a>";
}
else {
cmd += "<a href='" + ctx.GetLink().T2( new FriendController().AddFollow, targetId ) + "' class=\"frmBox cmd left10\" title=\"" + lang.get( "followcmd" ) + "\"><span>" + lang.get( "followcmd" ) + "</span></a>";
}
return cmd;
}
示例6: deleteFriendCmd
private static String deleteFriendCmd( MvcContext ctx, int targetId )
{
return "<a href='" + ctx.GetLink().T2( new FriendController().DeleteFriend, targetId ) + "' class=\"deleteCmd cmd\"><span>" + lang.get( "canelFriend" ) + "</span></a>";
}
示例7: appendApp
private static void appendApp( StringBuilder sb, MvcContext ctx )
{
if (ctx.owner.obj.GetType() == typeof( Group )) {
}
else {
sb.Append( "<span style=\"\" class=\"menuMore\" list=\"locationBoards\">" );
sb.AppendFormat( "<a href=\"{0}\" id=\"locationHome\">{1} <img src=\"{2}down.gif\" /></a>", ctx.GetLink().To( new ForumController().Index ), ((AppContext)ctx.app).UserApp.Name, sys.Path.Img );
addLocationMenu( sb, ctx );
sb.Append( "</span>" );
sb.Append( " " );
sb.Append( separator );
sb.Append( " " );
}
}
示例8: Fill
public static Post Fill( PhotoPost post, MvcContext ctx, IPhotoPostService postService )
{
Post p = new Post();
p.Title = post.Title;
p.Description = post.Description;
p.ImgUrl = post.ImgUrl;
p.ImgMediumUrl = post.ImgMediumUrl;
p.ImgThumbUrl = post.ImgThumbUrl;
p.Creator = post.Creator.Name;
p.Created = post.Created.ToShortDateString();
p.Hits = post.Hits;
if (post.PhotoAlbum == null || post.PhotoAlbum.Id == 0)
p.Album = alang( ctx, "defaultAlbum" );
else
p.Album = post.PhotoAlbum.Name;
p.AlbumLink = ctx.GetLink().To( new PhotoController().Album, post.PhotoAlbum.Id );
String lnk = string.Format( " | <a href=\"{0}\">{1}《{2}》</a> ", p.AlbumLink, alang( ctx, "returnAlbum" ), p.Album );
p.AlbumAndLink = lnk;// strUtil.HasText( p.Album ) ? lnk : "";
p.Tags = post.Tag.List.Count > 0 ? "tag:" + post.Tag.HtmlString : "";
String prevnext = getPreNextHtml( ctx, post, postService );
String nextLink = getNextLink( ctx, post, postService );
p.PrevNext = prevnext;
p.NextLink = nextLink;
return p;
}