| |

VerySource

 Forgot password?
 Register
Search
View: 870|Reply: 6

When the image button is clicked, the page is not refreshed, only the client script is executed.

[Copy link]

4

Threads

8

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-1-18 21:40:01
| Show all posts |Read mode
If the problem. Solve to 30
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-7-31 19:15:01
| Show all posts
Add return: false to the imagebutton

Such as:
<imagebutton ...........; return false;>
Reply

Use magic Report

1

Threads

60

Posts

37.00

Credits

Newbie

Rank: 1

Credits
37.00

 China

Post time: 2020-7-31 20:15:02
| Show all posts
if(!ispostback)
{
  Imagebutton1.Attributes.Add("onclick","return a()");
}
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-7-31 20:45:01
| Show all posts
this.ImageButton1.Attributes.Add("onclick","Script;return false");
Reply

Use magic Report

0

Threads

26

Posts

20.00

Credits

Newbie

Rank: 1

Credits
20.00

 China

Post time: 2020-7-31 22:30:01
| Show all posts
Add the client-side event of your picture button in Page_Load:
Imagebutton1.Attributes.Add("onclick","return btnclick()");

function btnclick()
{
    ...
    return false;
}
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-8-1 00:00:01
| Show all posts
shenmue024positive solution
Reply

Use magic Report

1

Threads

18

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-8-1 00:15:01
| Show all posts
It’s better to put a picture on the client and add a click event
Or put it in the <a></a> tag.
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