Home Replacement for @helper in ASP.NET 5 / asp.net mvc 6
Reply: 0

Replacement for @helper in ASP.NET 5 / asp.net mvc 6

user1552 Published in April 22, 2018, 4:53 am

I'm a huge fan of advancement and changes. It is clear to me that the ASP.NET MVC team have killed one of the most valuable feature of webpages (@helper) irrespective of what anybody thinks. If you must remove something, please replace it with something same in functionality and usage. 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.

No Nuget Package anywhere?

Some people call this a good improvement. I completely and strongly defer to that opinion.

I dont 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

What on earth would make you delete such a valuable feature? What on earth can you replace that with?

For now i believe its a temporary delete before RC. https://github.com/aspnet/Razor/issues/281 and https://github.com/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 doesnt seem to do the trick. I think it only renders views not return view to variable

Secondly, what happened to the App_Code folder?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.374001 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO