| |

VerySource

 Forgot password?
 Register
Search
View: 1122|Reply: 2

Please help look at this question

[Copy link]

2

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-17 02:00:01
| Show all posts |Read mode
Ask everyone a question:
OnClientClick = abc () runat = "server" OnClick = "Button1_Click"

abc () is a script function, the return is FALSE; why does it go to the background when the button is clicked (that is, the OnClick event is also executed), the background will not be executed on other machines, only the one I use in the company The machine will also execute to the background. I do n’t know if I have to set it up, please master it, thank you!
Reply

Use magic Report

0

Threads

8

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-1-22 14:36:01
| Show all posts
I have a method you can try. If you use abc () as the input for the client, you can write it in Form1_onsubmit (). I tested it successfully.
function Form1_onsubmit () {
if (2> 1) {
window.alert ("test hehe");
return false;
}
}
    Private Sub Button1_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Response.Write ("a Test")
    End Sub

Haven't you tried writing like this, it seems to me that your writing is wrong? Can a Button be both Server and Client? Can you put the complete code out and see! I have been through a lot of ASP, I have not studied C # Web, I have been doing C # WinForm
Reply

Use magic Report

0

Threads

3

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-9-1 20:00:01
| Show all posts
If your abc returns false and still executes, there may be a javascipt error in your page, so abc is not executed at all

So you can use onClientCilck="return false;" to debug step by step
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list