如何调用我的HTML辅助的RenderAction? [英] How To Call The RenderAction in my Html Helper?

查看:133
本文介绍了如何调用我的HTML辅助的RenderAction?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IM扩展HtmlHelper的。但我不能把它的renderaction。

im extending the htmlhelper. but it i cannot call the renderaction of it.

 using System.Text;
 using System.Web.Mvc;
 using System.Web.Mvc.Html;
 public static class ViewHelpers
    {
        public static string Text(this HtmlHelper htmlHelper, string name, object value, bool isEditMode)
        {
           htmlHelper.RenderAction(...) //cannot be called
        }
    }

我怎么能叫的RenderAction ???

how can i call the RenderAction???

推荐答案

该解决方案是真的很容易。
添加使用Microsoft.Web.Mvc;
并调用 RenderAction 将直接写入HTML字符串来视图时

the solution was realy easy.
add using Microsoft.Web.Mvc;
and when calling the RenderAction it will write the html string directly to the view

这篇关于如何调用我的HTML辅助的RenderAction?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆