输出页面显示为mvc中的inspect元素格式 [英] Output page show like inspect element format in mvc
本文介绍了输出页面显示为mvc中的inspect元素格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
输出页面显示像检查元素格式如
嗨:< input id =Text1type = Lost And Found />
但它应该显示为
嗨:失物招领
我的控制器是< br $>
Output page show like inspect element format like
Hi:<input id="Text1" type= Lost And Found />
but it should be show like
Hi:Lost And Found
my controller is
public ActionResult Preview(ListingModel model, FormCollection form)
{
return View("Preview",model);
}
我的观点是
and my view is
@using KebhariBlog.Models.Listing;
@model ListingModel
@using KebhariBlogBL.BL;
嗨:< input id =Text1type=@Model.Title /> ;
推荐答案
请尝试如下。
如果是文本框
Please try is as below.
If it's a Text box
Hi: <input type="text" name="Text1" id="Text1" value=@Model.Title />
如果是标签
If it's Label
Hi: <label for="Text1">@Model.Title</label>
这篇关于输出页面显示为mvc中的inspect元素格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文