本文整理汇总了C#中MvcContext.to方法的典型用法代码示例。如果您正苦于以下问题:C# MvcContext.to方法的具体用法?C# MvcContext.to怎么用?C# MvcContext.to使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MvcContext
的用法示例。
在下文中一共展示了MvcContext.to方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: bindListItem
public static void bindListItem( IBlock block, ContentPost post, MvcContext ctx )
{
block.Set( "post.SectionName", post.PageSection.Title );
block.Set( "post.SectionUrl", ctx.to( new SectionController().Show, post.PageSection.Id ) );
String typeIcon = BinderUtils.getTypeIcon( post );
block.Set( "post.ImgIcon", typeIcon );
String att = post.Attachments > 0 ? "<img src=\"" + strUtil.Join( sys.Path.Img, "attachment.gif" ) + "\"/>" : "";
block.Set( "post.AttachmentIcon", att );
block.Set( "post.TitleCss", post.Style );
block.Set( "post.Title", strUtil.SubString( post.GetTitle(), 50 ) );
block.Set( "post.Created", post.Created );
block.Set( "post.Hits", post.Hits );
block.Set( "post.Url", alink.ToAppData( post ) );
if (post.Creator != null) {
block.Set( "post.Submitter", string.Format( "<a href=\"{0}\" target=\"_blank\">{1}</a>", Link.ToMember( post.Creator ), post.Creator.Name ) );
}
else {
block.Set( "post.Submitter", "" );
}
}
示例2: GetSubCategories
public static String GetSubCategories( MvcContext ctx, FileCategory c )
{
int rootId = c.Id;
if (c.ParentId > 0) rootId = c.ParentId;
StringBuilder sb = new StringBuilder();
List<FileCategory> subs = FileCategory.GetByParentId( rootId );
foreach (FileCategory sub in subs) {
sb.AppendFormat( "<a href=\"{0}\">{1}</a> ", ctx.to( new CategoryController().Show, sub.Id ), sub.Name );
}
return sb.ToString();
}
示例3: getCatLink
private static String getCatLink( MvcContext ctx, FileCategory cat )
{
String catLink = string.Format( "<a href=\"{0}\">{1}</a>", ctx.to( new CategoryController().Show, cat.Id ), cat.Name );
return catLink;
}
示例4: GetFile
public static String GetFile( MvcContext ctx, FileItem f )
{
String catLocation = GetCategory( ctx, f.CategoryId );
String fileLink = string.Format( "<a href=\"{0}\">{1}</a>", ctx.to( new FileController().Show, f.Id ), f.Title );
return catLocation + " " + separator + " " + fileLink;
}