I modified following line:
<asp:button id="Button1" runat="server" text="save" onclientclick="return validate();" xmlns:asp="#unknown" />
i have deleted onclick="Button1_Click" and For testing purpose I dragged formvalidation.js file just below the div tag. Your validate() in formvalidation.js file is calling but since ID is getting change when page render. Now you need to check your JavaScript code.
<asp:Button ID="Button1" runat="server" Text="save" OnClientClick="return validate();" /></td></tr>
<tr></tr></table></div>
<script src="Scripts/formvalidation.js"></script>
Here is your modified js code:
function validate() {
var UserName = document.getElementById('MainContent_TextBox1').value;
var City = document.getElementById('MainContent_TextBox2').value;
var Designation = document.getElementById('MainContent_TextBox3').value;
if (UserName == "") {
alert("Enter UserName");
return false;
}
if (City == "") {
alert("Enter City");
return false;
}
if (Designation == "") {
alert("Enter Designation");
return false;
}
}