array(2) { ["docs"]=> array(10) { [0]=> array(10) { ["id"]=> string(3) "428" ["text"]=> string(77) "Visual Studio 2017 单独启动MSDN帮助(Microsoft Help Viewer)的方法" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(8) "DonetRen" ["tagsname"]=> string(55) "Visual Studio 2017|MSDN帮助|C#程序|.NET|Help Viewer" ["tagsid"]=> string(23) "[401,402,403,"300",404]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511400964" ["_id"]=> string(3) "428" } [1]=> array(10) { ["id"]=> string(3) "427" ["text"]=> string(42) "npm -v;报错 cannot find module "wrapp"" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(4) "zzty" ["tagsname"]=> string(50) "node.js|npm|cannot find module "wrapp“|node" ["tagsid"]=> string(19) "[398,"239",399,400]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511400760" ["_id"]=> string(3) "427" } [2]=> array(10) { ["id"]=> string(3) "426" ["text"]=> string(54) "说说css中pt、px、em、rem都扮演了什么角色" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(12) "zhengqiaoyin" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511400640" ["_id"]=> string(3) "426" } [3]=> array(10) { ["id"]=> string(3) "425" ["text"]=> string(83) "深入学习JS执行--创建执行上下文(变量对象,作用域链,this)" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(7) "Ry-yuan" ["tagsname"]=> string(33) "Javascript|Javascript执行过程" ["tagsid"]=> string(13) "["169","191"]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511399901" ["_id"]=> string(3) "425" } [4]=> array(10) { ["id"]=> string(3) "424" ["text"]=> string(30) "C# 排序技术研究与对比" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(9) "vveiliang" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(8) ".Net Dev" ["catesid"]=> string(5) "[199]" ["createtime"]=> string(10) "1511399150" ["_id"]=> string(3) "424" } [5]=> array(10) { ["id"]=> string(3) "423" ["text"]=> string(72) "【算法】小白的算法笔记:快速排序算法的编码和优化" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(9) "penghuwan" ["tagsname"]=> string(6) "算法" ["tagsid"]=> string(7) "["344"]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511398109" ["_id"]=> string(3) "423" } [6]=> array(10) { ["id"]=> string(3) "422" ["text"]=> string(64) "JavaScript数据可视化编程学习(二)Flotr2,雷达图" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(7) "chengxs" ["tagsname"]=> string(28) "数据可视化|前端学习" ["tagsid"]=> string(9) "[396,397]" ["catesname"]=> string(18) "前端基本知识" ["catesid"]=> string(5) "[198]" ["createtime"]=> string(10) "1511397800" ["_id"]=> string(3) "422" } [7]=> array(10) { ["id"]=> string(3) "421" ["text"]=> string(36) "C#表达式目录树(Expression)" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(4) "wwym" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(4) ".NET" ["catesid"]=> string(7) "["119"]" ["createtime"]=> string(10) "1511397474" ["_id"]=> string(3) "421" } [8]=> array(10) { ["id"]=> string(3) "420" ["text"]=> string(47) "数据结构 队列_队列实例:事件处理" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(7) "idreamo" ["tagsname"]=> string(40) "C语言|数据结构|队列|事件处理" ["tagsid"]=> string(23) "["246","247","248",395]" ["catesname"]=> string(12) "数据结构" ["catesid"]=> string(7) "["133"]" ["createtime"]=> string(10) "1511397279" ["_id"]=> string(3) "420" } [9]=> array(10) { ["id"]=> string(3) "419" ["text"]=> string(47) "久等了,博客园官方Android客户端发布" ["intro"]=> string(288) "目录 ECharts 异步加载 ECharts 数据可视化在过去几年中取得了巨大进展。开发人员对可视化产品的期望不再是简单的图表创建工具,而是在交互、性能、数据处理等方面有更高的要求。 chart.setOption({ color: [ " ["username"]=> string(3) "cmt" ["tagsname"]=> string(0) "" ["tagsid"]=> string(2) "[]" ["catesname"]=> string(0) "" ["catesid"]=> string(2) "[]" ["createtime"]=> string(10) "1511396549" ["_id"]=> string(3) "419" } } ["count"]=> int(200) } 222 ASP.NET Razor 视图引擎编程参考 ASP.NET Razor 视图引擎编程参考 - 爱码网
 

转载请注明出处:http://surfsky.cnblogs.com

Rasor 视图引擎
    http://msdn.microsoft.com/zh-cn/library/ff849693.aspx
    http://www.microsoft.com/downloads/en/details.aspx?FamilyID=b7937c34-3b53-47b7-ae17-5a72fa700472&displaylang=en
    http://aspnet.codeplex.com/wikipage?title=WebPages&referringTitle=Home

    优点:“干练简单”

    可以用它来做MVC视图引擎,也可以直接用它来编写传统类似php式的网站,非常轻便。


语法识别
    嵌入变量
        <h3>Hello @name, the year is @DateTime.Now.Year </h3>
        <a href="/products/details/@productId">the product</a>
    表达式(括号)
        <p>Your message : @("Number is: " + number) </p>
    代码块(花括弧)
        @{
          int number = 1;
          string message = "Number is " + number;
        }
        @{ var myQuote = @"The person said: ""Hello, today is Monday."""; }
    <text>标签
        if (i > 0) { 
          <text>;</text> 
        }
    智能区别@
        <p>mail scottgu@microsoft.com telling : @Date.Now.</p>
        可以显式地打@@来用另外一个”@”字符进行转义
    
判断
    @if(products.Count == 0){
      <p>Sorry - no products in this category </p>
    }else{
      <p>We have a products for you!</p>
    }
    @if (DateTime.Now.Year == 2010){
      <span>
        the date: @DateTime.Now
      </span>
    }
    
循环
    <ul >$@p.Price) </li>
      }
    </ul>

模板
    <!DOCTYPE html>
    <html>
      <body>
        <div>@RenderSection("menu", optional:true)</div>
        <div>@RenderBody()</div>
        <div>@RenderSection("footer", optional:true)</div>
      </body>
    </html>
    -----------------------------
    @{LayoutPage = "sitelayout.cshtml";}
    <p>current datetime: @DateTime.Now</p>
    @section menu{
      <ul , format:@<span>$@item.Price</span>)
      )
    )

函数
    @using  System.Text;      
    @functions  {
      public  static  IHtmlString  Repeat(int  times,  Func<int,  object>  template)  {      
        StringBuilder  builder  =  new  StringBuilder();      
        for(int  i  =  0;  i  <  times;  i++)  {
          builder.Append(template(i));
        }
        return  new  HtmlString(builder.ToString());
      }      
    }
    @Repeat(10, @<li>List Item</li>);
    @Repeat(10, @<li>List Item #@item</li>);

类型转换
    var myStringNum = "539";
    var myStringBool = "True";
    var myStringFloat = "41.432895";
    var myStringDec = "10317.425";
    var myDateString = "12/27/2010";
    -------------------------------
    if(myStringNum.IsInt()==true)
    var myIntNumber = myStringNum.AsInt();
    var myVar = myStringBool.AsBool();
    var myFloatNum = myStringFloat.AsFloat();
    var myDecNum = myStringDec.AsDecimal();
    var newDate = myDateString.AsDateTime();


文件
    访问cshtml文件均无需加扩展名。如:~/Gallery/Index
    下划线开始的cshtml文件不能单独运行(一般是做为模板文件、公共控件)
    几个特殊文件
        _init.cshtml
          @{
            // Set the layout page for the whole site
            LayoutPage = "_Master.cshtml";
          }
        _start.cshtml
          @{
            WebSecurity.InitializeDatabaseConnection("PhotoGallery", "UserProfiles", "UserId", "Email", true);
          }
        
  
--------------------------------
-- more
--------------------------------
@Inherits System.Web.Mvc.WebViewPage
    View.Title = "Home Page";
    LayoutPage = "~/Views/Shared/_layout.cshtml";
    View.Message

Login
    check
        if (WebSecurity.IsAuthenticated){
          欢迎您,<b>@WebSecurity.CurrentUserName</b>!
          @Html.ActionLink("注销", "LogOff", "Account")
        }
        else{
          @Html.ActionLink("登录", "LogOn", "Account")
        }
        @if (WebSecurity.IsAuthenticated) {
            <span>Welcome <b><a href="@Href("~/Account/ChangePassword")">@WebSecurity.CurrentUserName</a></b>!
            [ <a href="@Href("~/Account/Logout")">Logout</a> ]</span>
        } else {
            <span>[ <a href="@Href("~/Account/Login")">Login</a> | <a href="@Href("~/Account/Register")">Register</a> ]</span>
        }
    login
        // Attempt to login to the Security object using provided creds
        if (WebSecurity.Login(username, password, rememberMe)) {
            Response.Redirect("~/");
        }
    logout
        WebSecurity.Logout();
    regist
        WebSecurity.CreateAccount(email, password, requireEmailConfirmation)
        WebSecurity.ConfirmAccount(confirmationToken)
        WebSecurity.GetUserId(email)
        WebSecurity.GeneratePasswordResetToken(email)
    password
        WebSecurity.ResetPassword(passwordResetToken, newPassword)
        WebSecurity.ChangePassword(WebSecurity.CurrentUserName, currentPassword, newPassword)
            
Template
    @RenderPage("/Shared/_Header.cshtml")
    @RenderPage("/Shared/_Footer.cshtml")
    @RenderBody()
    @RenderSection("fffff")

microsoft sql server compact edition
    var db = Database.OpenFile("database.sdf");
    var sql = "select * from table1";
    var data = db.Query(sql);
    Database.Execute(sql)
    
fileupload
    @FileUpload.GetHtml(
      initialNumberOfFiles: 1,
      allowMoreFilesToBeAdded: false,
      includeFormTag: true,
      uploadText: "Upload"
      )

Image
    WebImage.Resize();
    WebImage.FlipVertical();
            .FlipHorizontal();
            .FlipLeft();
            .FlipRight();
    WebImage.AddTextWatermark();
    WebImage.AddImageWatermark();

Video
    @Video.Flash(
        path: "testFlash.swf",
        width: "400",
        height: "600",
        play: true,
        loop: true;
        menu: false,
        bgColor: "red",
        quality: "medium",
        scale: "exactfit",
        windowMode: "transparent"
        );
    @Video.MediaPlayer()
    @Video.Silverlight()

Toolkit(Microsoft.WebPages.Helpers.Toolkit.dll)
    Twitter
        @Twitter.Profile("haacked")
    Facebook
    Gravator
    Recaptcha
        
Form Postback
    <form action="" method="post">
        <p>
          <label for="text1">First Number:</label>
          <input type="text" name="text1" />
        </p>
        <p>
          <label for="text2">Second Number:</label>
          <input type="text" name="text2" />
        </p>
        <p><input type="submit" value="Add" /></p>
    </form>
    <p>@totalMessage</p>
    @{
        var totalMessage = "";
        if(IsPost) {
            var num1 = Request["text1"];
            var num2 = Request["text2"];
            var total = num1.AsInt() + num2.AsInt();
            totalMessage = "Total = " + total;
        }
    }

mail
    Mail.Send(
      to: email, 
      subject: "Please reset your password", 
      body: "Use this password reset token to reset your password. The token is: " + resetToken + @". Visit <a href=""" + resetUrl + @""">" + resetUrl + "</a> to reset your password."
    );
    Mail.SmtpServer.IsEmpty()
        
--------------------------------
-- 可用的 MVC 辅助函数和辅助类
--------------------------------
@Inherits System.Web.Mvc.WebViewPage
@Inherits System.Web.Mvc.WebViewPage<IList<RasorSample.Models.Category>>
@model LIst<Product>

@PageData["Title"]       用于页面内数据共享,如masterpage和contentpage共享
@Href("~/Site.css")      获取url
@WebSecurity             封装了用户安全相关函数
@UrlData[0]              应该等效于Request["..."]
@Html.PageLink("View", (string)similarTags[i].TagName, (string)similarTags[i].TagName)
<a href="@HrefAttribute("View", tag.TagName)">

转载请注明出处:http://surfsky.cnblogs.com 

转载请注明出处:http://surfsky.cnblogs.com

Rasor 视图引擎
    http://msdn.microsoft.com/zh-cn/library/ff849693.aspx
    http://www.microsoft.com/downloads/en/details.aspx?FamilyID=b7937c34-3b53-47b7-ae17-5a72fa700472&displaylang=en
    http://aspnet.codeplex.com/wikipage?title=WebPages&referringTitle=Home

    优点:“干练简单”

    可以用它来做MVC视图引擎,也可以直接用它来编写传统类似php式的网站,非常轻便。


语法识别
    嵌入变量
        <h3>Hello @name, the year is @DateTime.Now.Year </h3>
        <a href="/products/details/@productId">the product</a>
    表达式(括号)
        <p>Your message : @("Number is: " + number) </p>
    代码块(花括弧)
        @{
          int number = 1;
          string message = "Number is " + number;
        }
        @{ var myQuote = @"The person said: ""Hello, today is Monday."""; }
    <text>标签
        if (i > 0) { 
          <text>;</text> 
        }
    智能区别@
        <p>mail scottgu@microsoft.com telling : @Date.Now.</p>
        可以显式地打@@来用另外一个”@”字符进行转义
    
判断
    @if(products.Count == 0){
      <p>Sorry - no products in this category </p>
    }else{
      <p>We have a products for you!</p>
    }
    @if (DateTime.Now.Year == 2010){
      <span>
        the date: @DateTime.Now
      </span>
    }
    
循环
    <ul >$@p.Price) </li>
      }
    </ul>

模板
    <!DOCTYPE html>
    <html>
      <body>
        <div>@RenderSection("menu", optional:true)</div>
        <div>@RenderBody()</div>
        <div>@RenderSection("footer", optional:true)</div>
      </body>
    </html>
    -----------------------------
    @{LayoutPage = "sitelayout.cshtml";}
    <p>current datetime: @DateTime.Now</p>
    @section menu{
      <ul , format:@<span>$@item.Price</span>)
      )
    )

函数
    @using  System.Text;      
    @functions  {
      public  static  IHtmlString  Repeat(int  times,  Func<int,  object>  template)  {      
        StringBuilder  builder  =  new  StringBuilder();      
        for(int  i  =  0;  i  <  times;  i++)  {
          builder.Append(template(i));
        }
        return  new  HtmlString(builder.ToString());
      }      
    }
    @Repeat(10, @<li>List Item</li>);
    @Repeat(10, @<li>List Item #@item</li>);

类型转换
    var myStringNum = "539";
    var myStringBool = "True";
    var myStringFloat = "41.432895";
    var myStringDec = "10317.425";
    var myDateString = "12/27/2010";
    -------------------------------
    if(myStringNum.IsInt()==true)
    var myIntNumber = myStringNum.AsInt();
    var myVar = myStringBool.AsBool();
    var myFloatNum = myStringFloat.AsFloat();
    var myDecNum = myStringDec.AsDecimal();
    var newDate = myDateString.AsDateTime();


文件
    访问cshtml文件均无需加扩展名。如:~/Gallery/Index
    下划线开始的cshtml文件不能单独运行(一般是做为模板文件、公共控件)
    几个特殊文件
        _init.cshtml
          @{
            // Set the layout page for the whole site
            LayoutPage = "_Master.cshtml";
          }
        _start.cshtml
          @{
            WebSecurity.InitializeDatabaseConnection("PhotoGallery", "UserProfiles", "UserId", "Email", true);
          }
        
  
--------------------------------
-- more
--------------------------------
@Inherits System.Web.Mvc.WebViewPage
    View.Title = "Home Page";
    LayoutPage = "~/Views/Shared/_layout.cshtml";
    View.Message

Login
    check
        if (WebSecurity.IsAuthenticated){
          欢迎您,<b>@WebSecurity.CurrentUserName</b>!
          @Html.ActionLink("注销", "LogOff", "Account")
        }
        else{
          @Html.ActionLink("登录", "LogOn", "Account")
        }
        @if (WebSecurity.IsAuthenticated) {
            <span>Welcome <b><a href="@Href("~/Account/ChangePassword")">@WebSecurity.CurrentUserName</a></b>!
            [ <a href="@Href("~/Account/Logout")">Logout</a> ]</span>
        } else {
            <span>[ <a href="@Href("~/Account/Login")">Login</a> | <a href="@Href("~/Account/Register")">Register</a> ]</span>
        }
    login
        // Attempt to login to the Security object using provided creds
        if (WebSecurity.Login(username, password, rememberMe)) {
            Response.Redirect("~/");
        }
    logout
        WebSecurity.Logout();
    regist
        WebSecurity.CreateAccount(email, password, requireEmailConfirmation)
        WebSecurity.ConfirmAccount(confirmationToken)
        WebSecurity.GetUserId(email)
        WebSecurity.GeneratePasswordResetToken(email)
    password
        WebSecurity.ResetPassword(passwordResetToken, newPassword)
        WebSecurity.ChangePassword(WebSecurity.CurrentUserName, currentPassword, newPassword)
            
Template
    @RenderPage("/Shared/_Header.cshtml")
    @RenderPage("/Shared/_Footer.cshtml")
    @RenderBody()
    @RenderSection("fffff")

microsoft sql server compact edition
    var db = Database.OpenFile("database.sdf");
    var sql = "select * from table1";
    var data = db.Query(sql);
    Database.Execute(sql)
    
fileupload
    @FileUpload.GetHtml(
      initialNumberOfFiles: 1,
      allowMoreFilesToBeAdded: false,
      includeFormTag: true,
      uploadText: "Upload"
      )

Image
    WebImage.Resize();
    WebImage.FlipVertical();
            .FlipHorizontal();
            .FlipLeft();
            .FlipRight();
    WebImage.AddTextWatermark();
    WebImage.AddImageWatermark();

Video
    @Video.Flash(
        path: "testFlash.swf",
        width: "400",
        height: "600",
        play: true,
        loop: true;
        menu: false,
        bgColor: "red",
        quality: "medium",
        scale: "exactfit",
        windowMode: "transparent"
        );
    @Video.MediaPlayer()
    @Video.Silverlight()

Toolkit(Microsoft.WebPages.Helpers.Toolkit.dll)
    Twitter
        @Twitter.Profile("haacked")
    Facebook
    Gravator
    Recaptcha
        
Form Postback
    <form action="" method="post">
        <p>
          <label for="text1">First Number:</label>
          <input type="text" name="text1" />
        </p>
        <p>
          <label for="text2">Second Number:</label>
          <input type="text" name="text2" />
        </p>
        <p><input type="submit" value="Add" /></p>
    </form>
    <p>@totalMessage</p>
    @{
        var totalMessage = "";
        if(IsPost) {
            var num1 = Request["text1"];
            var num2 = Request["text2"];
            var total = num1.AsInt() + num2.AsInt();
            totalMessage = "Total = " + total;
        }
    }

mail
    Mail.Send(
      to: email, 
      subject: "Please reset your password", 
      body: "Use this password reset token to reset your password. The token is: " + resetToken + @". Visit <a href=""" + resetUrl + @""">" + resetUrl + "</a> to reset your password."
    );
    Mail.SmtpServer.IsEmpty()
        
--------------------------------
-- 可用的 MVC 辅助函数和辅助类
--------------------------------
@Inherits System.Web.Mvc.WebViewPage
@Inherits System.Web.Mvc.WebViewPage<IList<RasorSample.Models.Category>>
@model LIst<Product>

@PageData["Title"]       用于页面内数据共享,如masterpage和contentpage共享
@Href("~/Site.css")      获取url
@WebSecurity             封装了用户安全相关函数
@UrlData[0]              应该等效于Request["..."]
@Html.PageLink("View", (string)similarTags[i].TagName, (string)similarTags[i].TagName)
<a href="@HrefAttribute("View", tag.TagName)">

相关文章:

  • 2018-09-11
  • 2019-03-11
  • 2018-08-22
  • 2018-09-30
  • 2018-05-03
  • 2018-03-12
  • 2019-05-18
  • 2019-06-17
猜你喜欢
  • 2020-02-27
  • 2018-03-23
  • 2019-03-14
  • 2018-03-16
  • 2018-04-10
  • 2018-04-04
  • 2019-06-23
  • 2019-12-12
相关资源
相似解决方案