| |

VerySource

 Forgot password?
 Register
Search
View: 627|Reply: 3

Masters come to help >>>>>>>

[Copy link]

4

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-1-7 01:50:01
| Show all posts |Read mode
In datagrid
Sub DataGrid1_ItemDataBound (sender As Object, e As DataGridItemEventArgs)
 dim itemtype as listitemtype
 itemtype = e.item.itemtype
  if itemtype = listitemtype.item or itemtype = listitemtype.alternatingitem then

    dim button as imagebutton
    button = ctype (e.Item.FindControl ("ImageButton4"), imagebutton)
    '' '' '
    button.attributes.add ("onclick", "return confirm ('que ren shan chu?');")
 
  end if
End Sub
Can pop up
I want to
   button.attributes.add ("onclick", "return confirm ('que ren shan chu?');")
Replaced with
button.attributes.add ("onclick", "window.open ('aa.aspx? id ='&e.item.cells (0) .text&'')")
Why not?

Also I put
dim itemtype as listitemtype
 itemtype = e.item.itemtype
  if itemtype = listitemtype.item or itemtype = listitemtype.alternatingitem then

    dim button as imagebutton
    button = ctype (e.Item.FindControl ("ImageButton4"), imagebutton)
    '' '' '
    button.attributes.add ("onclick", "return confirm ('que ren shan chu?');")
 
  end if
The code is placed in the datagrid1_itemcommand event.
How to solve this problem?
Reply

Use magic Report

0

Threads

43

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 China

Post time: 2020-1-7 13:48:01
| Show all posts
Select Case e.Item.ItemType
            Case ListItemType.Item, ListItemType.AlternatingItem
                Dim links As Button
                links = e.Item.FindControl ("delete")
                links.Attributes.Add ("onclick", "return confirm ('Are you sure you want to delete?');")
        End Select
Reply

Use magic Report

0

Threads

43

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 China

Post time: 2020-1-7 13:54:02
| Show all posts
window.open must have parameters
Reply

Use magic Report

0

Threads

9

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-1-7 15:36:01
| Show all posts
Upstairs is upstairs!
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