title: Show Popup Message based on Event in C# SharePoint WebPart
body: <p>There is a Visual WebPart being developed in SharePoint 2010.  On load, a set of methods that get and fill information in the WebPart run in the Page_Load method.  Somewhere in this process, there needs to be a popup message box or alert box notifying the user that this particular bit of information is not available.</p>
  
  <p>The problem is doing the popup message.  A MessageBox.Show will not work in this particular situation as it is a SharePoint Visual WebPart, which is an extenstion of ASP.NET.  Adding System.Windows.Form is possible and it would make MessageBox.Show work, but only on the development machine.  It will not work for any of the clients on their browsers.  Adding the following to the ASP code is possible, but one of the objectives is to minimize user interaction.</p>
  
  <pre><code>&lt;asp:Button ID="btnCheckInfo" runat="server" Style="z-index: 101; left: 216px; position: absolute;
        top: 160px" Text="Check Information" OnClientClick="return confirm('change a record, would you like to continue ?');" /&gt;
  </code></pre>
  
  <p>Having this happen automatically instead of having the user click a button would be ideal.</p>
  
  <p>Is this at all possible?  Is it possible to add a popup message box of some kind to a SharePoint Visual WebPart that can be called/triggered within a method instead of as a click event?</p>
  
  <p>Hopefully the question is clear enough.  I'm not an experienced C#, .NET or SharePoint programmer.</p>
  
  <p>Thank you in advance for you help and advice!</p>