Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

call a javascript function in asp.net core controller.

$
0
0
<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 }

Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>