razor

重学ASP.NET Core 中的标记帮助程序

∥☆過路亽.° 提交于 2020-07-27 11:43:52
标记帮助程序是什么 标记帮助程序使服务器端代码可以在 Razor 文件中参与创建和呈现 HTML 元素。 例如,内置的 ImageTagHelper 可以将版本号追加到图片名称。 每当图片发生变化时,服务器都会为图像生成一个新的唯一版本号,因此客户端总能获得当前图像(而不是过时的缓存图像)。 作者:依乐祝 原文链接: https://www.cnblogs.com/yilezhu/p/13197922.html 标记帮助程序的作用域是如何控制的 标记帮助程序作用域由 @addTagHelper 、 @removeTagHelper 和“!”选择退出字符等联合控制。下面就一一的进行相关的介绍吧。 使用 @addTagHelper 添加标记帮助程序 @addTagHelper 指令让视图可以使用标记帮助程序。 在这种情况下,视图文件是_pages/ ViewImports ,默认情况下,它由_pages_文件夹和子文件夹中的所有文件继承,这使得标记帮助程序可用。 这里公开标记帮助程序有两种方式,如下所示: 第一种:使用通配符语法(" * ")指定指定程序集( AspNetCore )中的所有标记帮助程序都可用于_Views_目录及其子目录中的每个视图文件。 @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 第二种

EPLAN API 入门系列- 开篇

依然范特西╮ 提交于 2020-07-27 11:03:36
EPLAN作为一个电气行业的软件,因为它的专业性,国际化等诸多特点,更因为它引领着整个电气行业设计的标准,已经越来越开始被国内先进的自动化行业所认知并接受。 EPLAN API在网上的资料很少,而且API Help也不公开,所以在很大程序上限制了国内EPLAN的推广及应用,当然这跟德国总部对国内的推广策略有关。 有人说在国内开源的东西没有出路,其实我以为,不开源的东西同样没有出路,从搏亦的角度而言,这是一个正向搏亦,因为软件产品之所以是一个产品,在于得到用户的认可与参与,才能够逐步的被大众所接受; 从OS系统开始:Linux、Android(当然Android是一种以Linux为基础的开放源代码OS)、Microsoft(微软宣布将ASP.NET MVC 4,ASP.NET Web API,ASP.NET Web Pages V2(Razor)全部开源)开源; 数据库方面:MySQL 5、PostgreSQL、MaxDB、NoSQL的开源都取得了长足的改进; 以及GOOGLE、SINA、BAIDU API的开放、目前比较流行的RESTFUL、WEB API的设计模式都给用户带来全新的体验与热情; 废话不多说了,开篇上传几张图片,给大家展示一下EPLAN API可以做哪些事情: 1、各种报表的导出(任何格式、任何项目中的数据的导出) 2、支持ERP/PDM

How to send model object in Html.RenderAction (MVC3)

那年仲夏 提交于 2020-07-27 05:46:03
问题 I'm using MVC3 razor, and I'm trying to pass an object to a partial view, and it's not working. This works fine without sending the object model to the partial view: Html.RenderAction("Index", "ViewName"); Trying this doesn't sent the model object, i'm getting nulls instead (the object has data, and the view expects it):' Html.RenderAction("Index", "ViewName", objectModel); Is this even possible using RenderAction? Thanks! Edit: I found the error, there was an error with the controller's

How to send model object in Html.RenderAction (MVC3)

﹥>﹥吖頭↗ 提交于 2020-07-27 05:44:12
问题 I'm using MVC3 razor, and I'm trying to pass an object to a partial view, and it's not working. This works fine without sending the object model to the partial view: Html.RenderAction("Index", "ViewName"); Trying this doesn't sent the model object, i'm getting nulls instead (the object has data, and the view expects it):' Html.RenderAction("Index", "ViewName", objectModel); Is this even possible using RenderAction? Thanks! Edit: I found the error, there was an error with the controller's

[Asp.Net Core] Blazor Server Side 扩展用途

扶醉桌前 提交于 2020-07-26 01:17:09
前言 大概3个星期之前立项, 要做一个 CEF+Blazor+WinForms 三合一到同一个进程的客户端模板. 这个东西在五一的时候做出了原型, 然后慢慢修正, 在5天之前就上传到github了. 地址 : https://github.com/BlazorPlus/BlazorCefApp 但是一直在忙各种东西, 没有时间写博客. 情况 情况是这么一个情况 , 这个东西能运行, 够用. 也写了7个例子. 离当初的目标还有一些距离. 需要更多的时间去填坑. CEF方面, 是按需包装, 没有用到的功能是没处理的. 不过按照原先设想, 大部分人都不会有去定制这个CEF的需要. 测试 看这篇博文的网友, 如果不想从github下载编译, 从 http://opensource.spotify.com/ 另行下载 CEF 的资源包, 可以直接在微云上下载 已经编译好的版本 : https://share.weiyun.com/oibpnIro 项目模板 如图, 这是一个标准的 Blazor server side 工程. 有 Program.cs , 有 Startup.cs , 有 Shared/Pages, 有 wwwroot 其中引用的包是 CefLibCore , 源代码在 https://github.com/BlazorPlus/CefLite ,

.NET进行客户端Web开发又一利器

百般思念 提交于 2020-07-23 19:05:43
你好,我是Dotnet9,继上篇介绍 Bootstrap风格的BlazorUI组件库 后,今天我来介绍另一款Blazor UI组件库:一套基于 Ant Design 和 Blazor 的企业级组件库。 本文导航: 一、关于Ant Design Blazor 二、Ant Design Blazor的社区贡献 2.1 项目关注度 2.2 Ant Design官方认可 2.3 微软官方认可 三、Ant Design Blazor UI库介绍 四、Ant Design Blazor后续计划 五、Ant Design Blazor技术交流 一、关于Ant Design Blazor 项目名称: Ant Design Blazor 项目作者: James Yeung(社区发起者,目前项目参与度高,有较多贡献者) 开源许可协议: MIT 项目地址: https://github.com/ant-design-blazor/ant-design-blazor ✨ 特性 🌈 提炼自企业级中后台产品的交互语言和视觉风格。 📦 开箱即用的高质量 Blazor 组件,可在多种托管方式共享。 💕 支持基于 WebAssembly 的客户端和基于 SignalR 的服务端 UI 事件交互。 🎨 支持渐进式 Web 应用(PWA) 🛡 使用 C# 构建,多范式静态语言带来高效的开发体验。 ⚙️ 基于 .NET

How to escape an html tag in Razor

眉间皱痕 提交于 2020-07-20 20:31:40
问题 In a View in ASP.NET MVC , I need to type following line of text: "< h t m l > This is how you escape an HTML tag in Razor < / h t m l >" Please remove spaces from < h t m l > to consider it a proper html tag. How do I accomplish it? All answers are welcome. 回答1: Try this. @{ var myHtmlString = new HtmlString("<html> This is how you escape an HTML tag in Razor </html>");} @Html.Encode(myHtmlString) Prints Another Simple Way is : @Html.Encode(Html.Raw("<html> This is how you escape an HTML tag

How to escape an html tag in Razor

别来无恙 提交于 2020-07-20 20:24:39
问题 In a View in ASP.NET MVC , I need to type following line of text: "< h t m l > This is how you escape an HTML tag in Razor < / h t m l >" Please remove spaces from < h t m l > to consider it a proper html tag. How do I accomplish it? All answers are welcome. 回答1: Try this. @{ var myHtmlString = new HtmlString("<html> This is how you escape an HTML tag in Razor </html>");} @Html.Encode(myHtmlString) Prints Another Simple Way is : @Html.Encode(Html.Raw("<html> This is how you escape an HTML tag

How to escape an html tag in Razor

不问归期 提交于 2020-07-20 20:24:08
问题 In a View in ASP.NET MVC , I need to type following line of text: "< h t m l > This is how you escape an HTML tag in Razor < / h t m l >" Please remove spaces from < h t m l > to consider it a proper html tag. How do I accomplish it? All answers are welcome. 回答1: Try this. @{ var myHtmlString = new HtmlString("<html> This is how you escape an HTML tag in Razor </html>");} @Html.Encode(myHtmlString) Prints Another Simple Way is : @Html.Encode(Html.Raw("<html> This is how you escape an HTML tag

Return several checkbox values of Html.CheckBoxFor to the controller

梦想与她 提交于 2020-07-18 07:53:08
问题 I have a view where the user should select several listed items by checkboxes, which should then be worked within the controller. However, I am not getting the values passed to the POST method of the controller; the List comes in null when debugging. While searching for answers, I was not able to find one matching with C# and the Html.CheckboxFor for multiple values. I feel that this may be just a minor thing to fix, but I cannot figure it out for several days now. Here is my model: public