title: How to display an alert message from .cshtml view - asp.net mvc
body: <p>I have two action result one sending a string and another loading the view </p>
  
  <pre><code>public ActionResult getTheString()
  {
     string message = //doing some thing ;
    myModel myModel = new myModel();
    myModel.property1 = message ;
  
      return loadView(myModel);
  }
  
  public ActionResult loadView(myModel model)
  
  {
     return view (model);
  }
  </code></pre>
  
  <h2>loadView.cshtml</h2>
  
  <pre><code>@model project.Models.myModel 
  @{
    if(Model.property1 !=" ")
       {what to do to show it as alert }
  }
  </code></pre>
  
  <p>Here I am getting the prperty like <code>model.property1</code> if it has some thing show the alert with that string and then load, if message does not contain anything then simply load.</p>
  
  <p>Not permitted to use <code>TempData</code> , <code>ViewBag</code> , <code>ViewData</code>.</p>
  
  <p>Not permitted to use Script tag in view  . it has to be in a seperate js file</p>