首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >HTML未在WEBGRID上呈现

HTML未在WEBGRID上呈现
EN

Stack Overflow用户
提问于 2013-05-30 05:31:33
回答 1查看 220关注 0票数 0

Webgrid没有呈现html,这是来自于我的sql。请看我下面的问题。我被卡住了,请帮帮我。

代码语言:javascript
复制
SELECT DISTINCT r.ReportName AS [Report Name] ,r.ReportDesc AS [Report Desc]
,<a href="user/details/12" class="aPopup">View Extra details</a> AS [Report Extra   
Details] FROM r.Reports and basically i am displaying this data directly on Webgrid.

The webgrid is dynamic and i am not specifying any columns name on it.

When i render my webgrid it shows the data as <a href="user/details/12"     
class="aPopup">View Extra details</a> in the column, instead i want to display it 
like "View Extra Details" with the hyperlink / link. Please help me how can i do this ?

Once it display the column with "View Extra details" i can have a jquery to open the     
popup, but the deal here how can i avoid displaying <a href="user/details/12"    
class="aPopup">View Extra details</a> in the column.

Looks like its not rendering the html on Webgrid, i tried Html.Raw but it was of no use.

Please let me know how to solve this issue.
EN

回答 1

Stack Overflow用户

发布于 2013-05-30 11:14:11

我已经修好了

代码语言:javascript
复制
foreach (KeyValuePair<string, object> keyValuePair in eachFlowRow)
        {
            if (keyValuePair.Key.Contains("Report Extra Details"))
            {
                var newEntry = new KeyValuePair<string, object>(keyValuePair.Key, @Html.Raw("<a href='Home/Index' class='aPopup'>Vijay</a>"));
                row.Add(newEntry);
            }
            else
            {
                row.Add(keyValuePair);
            }
        }
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16824207

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档