client side validation with javascript
<input type="text" id="txtInputTB1"/> ensure your form has the following set for it's onsubmit event:<form onsubmit="validateInputs();"> now, define that function in javascript: function validateInputs()
{
     //get a reference to that textbox:
     var txtInput = document.getElementById("txtInputTB1");
     //check its value
     if(txtInput.value == "")
     {
          //do something if it is empty
          alert("Please enter a value for the text input.");
          return false;
     }
     return true;
}

解决方案 »

  1.   

    <script type="text/javascript">
    <!--
    var g_isPostBack = false;window.onbeforeunload = function ()
    {
     if( g_isPostBack == true )
      return; // Let the page unload if ( window.event )
      window.event.returnValue = 'You will lose any unsaved changes!'; // IE
     else
      return 'You will lose any unsaved changes!'; // FX
    }
    // -->
    </script>private void Page_Load(object sender, System.EventArgs e)
    {
     RegisterOnSubmitStatement("OnSubmitScript", "g_isPostBack = true;"); 
    }
      

  2.   

    Create proportional table