How to use ASP.NET to trigger a popup dialog and update the back url from the dialog?

How to use ASP.NET to trigger a popup dialog and update the back url from the dialog?

I have an ASP.NET webform in C# below.  I can use the popup dialog to show the client-side validation message.  But how to call the popup dialog to show the server-side validation message from the C# code?  Also how to change the back target of the popup dialog to "page2" instead of "page1" from the C# code in a multiple page file?

<div data-role="page" id="page1">
  <div data-role="header">
    <h1>header 1</h1>
  </div>
  <div data-role="main" class="ui-content">
    <form name="content" method="post" id="content" runat="server">

      <label for="email">Email:</label>
      <asp:RequiredFieldValidator ID="RequiredFieldValidatoremail" runat="server" ControlToValidate="email" ErrorMessage="Required" Display="Dynamic"></asp:RequiredFieldValidator>
      <asp:RegularExpressionValidator ID="RegularExpressionValidatoremail" runat="server" ControlToValidate="email" Display="Dynamic" ErrorMessage="Email Error" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator></span>
      <input name="email" id="email" placeholder="Email" maxlength="40" runat="server">

      <a href="#CheckDialog" onClick="check_form();" id="GoDialog" data-rel="popup" data-position-to="window" data-transition="fade" data-role="button" data-icon="check" data-iconpos="right">Submit</a>
    
      <div data-role="popup" id="CheckDialog">
        <div data-role="header">
          <h1>Client Validation</h1>
        </div>
        <div data-role="main" id="content" class="ui-content"> </div>
        <div data-role="footer">
          <h4>Footer</h4>
        </div>
      </div>
    
    </form>

    </div>
  <div data-role="footer">
    <h4>Footer</h4>
  </div>

<div data-role="page" id="page2">
  <div data-role="header">
    <h1>header 1</h1>
  </div>
  <div data-role="main" class="ui-content">
    Page 2 Content
  </div>
  <div data-role="footer">
    <h4>Footer</h4>
  </div>
</div>