I have a page written in asp.net, in which i am calling javascript alert message and it is not showing up, if i clear cache memory of browser then the alert message is showing up. Can any body tell the reason and solution.
Use onClientClick
like this
<asp:Button ID="btnSubmit" OnClick="btnSubmit_click()" OnClientClick="return check()"
runat="server"/>
<script type="text/javascript">
function check() {
if (confirm('Are you sure you want to submit ?')) {
// do further form validation here..
return true;
}
else {
return false;
}
}
</script>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.