Hello guys,
I currently have the below code in which I am calling a WCF service and returning the result as a list item in a HTML DIV.
Because of a security issues I am not comfortable with using inner html as it doesn't automatically encode the values from the server.
Please what other way can I rewrite this code to avoid this issue?
var myRequestCount = client.GetRequests(id);
var myRequestMsgs = client.GetRequests(id).OrderByDescending(rd => rd.CreatedDate).Take(4);
lblNoOfRequests.Text = myRequestCount.Count().ToString();
if (myRequestMsgs.Count() != 0)
{
StringBuilder sb = new StringBuilder();
sb.Append("<ul style='list-style-type:disc !important'>");
foreach (var requestMsgs in myRequestMsgs)
{
sb.Append("<a href='#' onclick='return openMyRequestRadWindow(" + reque ...
Go to the complete details ...