开发者

Please find the error in below written code for asp + JavaScript

<script type=text/javascript>
function abc()
{
   return confirm('Are u sure');
}
</script>


<asp: Button id="btnSubmit" runat="server" onClick="btnSubmit_Click" onClientClick="abc" Text="Submit/>

When I click the button the message box appears 开发者_JAVA百科if I hit the cancel Button still the function for onClick is called instead it should not. But if I write JavaScript code directly in the tag it works properly.


onClientClick="return abc()"

the return is the essential bit.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜