Hey Guys,
I am trying to call codebehind onclick event from my markup from Firefox works find in IE. I hv created an image button and onClientClick I m calling a javascript function after checking some fields it should call onClick event in code behind but unfortunately its not, Please help.

<asp:ImageButton ID="SubmitChanges" runat="server" ImageUrl="../images/btn_images/btn_large_submitchanges_ng.gif" OnClientClick="return DoEdits();" />

html
function DoEdits(){
//check fields
return true;
}
cde behind
Public Sub SubmitChanges_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles SubmitChanges.Click
' code to process.
End Sub

Recommended Answers

All 3 Replies

You need to verify your javascript code if it is working correctly?

I think you are not setting the return type for JS function DoEdits().

Thanks for reply Faisal,
But I have tried removing DOedits function. It never hits submit event, and do edit is a javascript function how can I set a return type?

Thx

You should ask this question over in the .net forum....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.