title: Asp.net error using Visual Basic Input Box
body: <p>I have used a Visual Basic Reference in C# to Add a Location to a Table.
  This works Locally but after Publishing it to the Hosting Site it produces this Error:
  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.</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>        string addlocation = Microsoft.VisualBasic.Interaction.InputBox("Enter New Location", "Location", "", 600, 400);
          if (addlocation == "" || addlocation == null)
          {
              Microsoft.VisualBasic.Interaction.MsgBox("Enter a Valid Name!", 0);
              return;
          }
          using (var connection3 = new SqlConnection(ConfigurationManager.ConnectionStrings["con"].ConnectionString))
          {
              connection.Open();
              SqlCommand comm = new SqlCommand("SELECT COUNT(*) FROM Locations WHERE Locations = '" + addlocation + "'", connection);
              Int32 count = Convert.ToInt32(comm.ExecuteScalar());
  
              if (count == 0)
              using (var cmd1 = new SqlCommand("INSERT INTO Locations(Locations) VALUES('" + addlocation + "');", connection3))
              {
                  connection3.Open();
                  cmd1.ExecuteNonQuery();
  
                  connection3.Close();
                  Page.Response.Redirect(Page.Request.Url.ToString(), true);
                  connection3.Close();
              }
              else
              {
                  Microsoft.VisualBasic.Interaction.MsgBox("Location Already Exists!", 0);
              }
              connection.Close();
          }
  </code></pre>