title: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation
body: <p>I encounter this error when I want to read a .xlsx excel file on my remote server but strangely not on my local machine. I've tried changing my codes from <strong>MessageBox.Show(mymessage)</strong> to<br>
  <strong>ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + mymessage+ "');", true);</strong></p>
  
  <p>Then I realised that even if I comment out all the display messages msgbox/alert, I'd still face the same error. </p>
  
  <blockquote>
    <p><strong>Source Error:</strong> An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  </p>
    
    <p><strong>Stack Trace</strong>
    [InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.]
       System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, Boolean showHelp) +2661826
       System.Windows.Forms.MessageBox.Show(String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton) +25
       NetWorkInformationSystem.classes.ReadExcelFile.GetDataFromExcelPatchRecordRead(String filename) in C:\Documents and Settings\yeohs\Desktop\NetWorkInformationSystem\NetWorkInformationSystem\classes\ReadExcelFile.cs:62
       NetWorkInformationSystem.PatchRecords.ConfirmBtn_Click(Object sender, EventArgs e) in C:\Documents and Settings\yeohs\Desktop\NetWorkInformationSystem\NetWorkInformationSystem\forms\PatchRecords.aspx.cs:121
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565</p>
  </blockquote>
  
  <pre><code>listofTableTable = ReadExcelFile.GetDataFromExcelPatchRecordRead(filename);
  listofDataSet = ReadListOfDataFromExcelPatchRecord(listofTableTable);
  
      if (listofDataSet.Count &gt;= 1)
      {
      //insert according by filename
      int deletecount = GICdatabase.InsertRecords(listofDataSet);
  }
  </code></pre>
  
  <p><strong>Read Records</strong></p>
  
  <pre><code>    foreach (DataRow dr in listofTableTable.Rows)
  {
  string a= dr["a"].ToString().ToUpper().Trim();
  string b= dr["b"].ToString().ToUpper().Trim();
  string c= dr["c"].ToString().ToUpper().Trim();
  string d= dr["d"].ToString().ToUpper().Trim();
  string e= dr["e"].ToString().Trim();
  string f= dr["f"].ToString().ToUpper().Trim();
  string g= dr["g"].ToString().ToLower().Trim();
  string h= dr["h"].ToString().ToLower().Trim();
  string i= dr["i"].ToString().ToLower().Trim();
  string j= dr["j"].ToString().ToLower().Trim();
  DateTime datestamp =DateTime.Now.ToLocalTime();
  }
  </code></pre>
  
  <p>**</p>
  
  <blockquote>
    <p>HEY PROS!! ANY GREAT SOLUTION TO DISPLAY OPTION MESSAGE BOX ON SERVER
    TO PROVIDE?  e.g OK,CANCEL? YES,NO?</p>
  </blockquote>
  
  <p>**</p>