adsense

Wednesday, October 28, 2020

Remove all table rows except first

You can use jQery to easily remove rows from a given table.

//using jQuery find

$(function() {
   $("#tableId").find("tr:gt(0)").remove();
});
//using empty
$(function() {
  $("#tableId > tbody").empty();
});
The second method is more efficient than the first approach.
Regards,
Samitha

Saturday, October 17, 2020

.Net get plain text from HTML

There can be situations where you want to get plain text from HTML content.  We can use Regex and HttpUtility.HtmlDecode as the easiest way to get plain text shown below.

String plainText =HttpUtility.HtmlDecode( Regex.Replace(HtmlString, "<(.|\n)*?>", "") );


Cheers,

Samitha

Thursday, October 1, 2020

Role does not have permission for this action in QNA Maker

 When you are working with Azure QNA Maker you might get the message "role does not have permission for this action in QNA Maker"

Once you have finished creating  QNA,  the entire page (not the  Refresh Button on the QnAMaker.ai/Create page)  needs to be refreshed and the above message will be disappeared.


Cheers

Samitha