RegisterClientScriptBlock - Javascript

G

Guest

Hi All

If user selects OK on the confirmation message box, if OK code block does not get executed at all in my asp.net application?Its in the code behind. This code is inside CheckedChanged event of check box. I see the confirmation message but only the respective action does not get executed

runat="server" and AutoPostBack="True" property is set for the check box

Please let me know where is the problem

Dim scriptString As String = "<script language=""""JavaScript""""> function DoTestClick() {
scriptString += "var answer = confirm('Are you sure you want to delete?');
scriptString += "if (answer) ProcessClick(); else return false;}
scriptString += "</script>

If (Not IsClientScriptBlockRegistered("Test_ClientScript")) The
Page.RegisterClientScriptBlock("Test_ClientScript", scriptString
End I

Thanks in advanc
Chan
 
C

Cor

Hi Chan,

I can not get the problem, but I think that the solution is that you have a
look at the attributes from the controls. There you can set something as

mycontrol.attributes("onclick")="Myjavascript"

I hope this helps?

Cor
If user selects OK on the confirmation message box, if OK code block does
not get executed at all in my asp.net application?Its in the code behind.
This code is inside CheckedChanged event of check box. I see the
confirmation message but only the respective action does not get executed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top