<script type="text/javascript"> function ShowErrorPopup(c) { $('#CallBackDiv').append(c); }</script>
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="6000"> <h3>@ViewData["Message"]</h3></div>
<div id="CallBackDiv"></div>
Now I want to Call my javascript function ShowErrorPopup when event is fired.
public IActionResult Index() { Wrapper wrapper = new Wrapper(); wrapper.Handler += Handler; string str = wrapper.GetResult(44); ViewData["Message"] = str; return View(); }
private void Handler(object sender, string s)
{
// what i should do here to display my text in div tag.
//please note that the this notification may not come in regular intervals
}