到目前为止,我认为ViewComponent不能解决TagHelper的问题.有什么替代品吗?带有参数并返回HtmlString?
So far, i don't think ViewComponent solves that neither does TagHelper. Is there any replacement to this? Something that takes parameters and returns a HtmlString?
我没有发现任何有害的东西:
I don't see anything harmful with:
@helper foo(string something) { <div>Say @something</div> } var emailbody = classfilenameinAppCodefolder.foo("hello"); //store result in a variable for further processes就目前而言,我认为它是在RC之前的一个临时删除. github/aspnet/Razor/issues/281 和 github/aspnet/Mvc/issues/1130 好!最好是.我希望有人在努力.如果没有@helper,则构建大型HtmlString或模板"将是一个严重的难题.
For now i believe its a temporary delete before RC. github/aspnet/Razor/issues/281 and github/aspnet/Mvc/issues/1130 Well! it better be. I hope someone is working on it. Without @helper, building large HtmlString or 'template' would be a serious pain.
注意:部分视图似乎无法解决问题.我认为它仅呈现视图,而不会将视图返回到变量.
Note: Partial View doesn't seem to do the trick. I think it only renders views not return view to variable.
第二,App_Code文件夹发生了什么事?
Secondly, what happened to the App_Code folder?
推荐答案@{ Func<String, IHtmlContent> foo = @<div>Say @item</div>; }
更多推荐
在ASP.NET Core中替换@helper
发布评论