2013-05-29 4 views
0

Webgrid가 html을 렌더링하지 않습니다.이 HTML은 sql에서 생성됩니다. 아래 내 질문을 참조하십시오. 내가 그 중간에 갇혀있을 때 나를 도와주세요.HTML이 렌더링되지 않습니다. WEBGRID

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. 

답변

1

나는 그것을

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); 
      } 
     } 
고정
관련 문제