Re: Execute Javascript From Buttons Inside Datagrid
From: Jon (Jon_at_discussions.microsoft.com)
Date: 07/30/04
- Next message: J. Kingsley: "Re: Executing a VB Script file from VB.net"
- Previous message: Supra: "Re: .Net Trial"
- In reply to: Shiva: "Re: Execute Javascript From Buttons Inside Datagrid"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 30 Jul 2004 06:13:02 -0700
Yeah, thats what I was originally hoping for, BUT....
'attributes is not a member of System.Web.UI.WebControls.ButtonColumn'
so you cant do it that way. Unless theres a reference or property I might be missing??
--
Any info will be very appreciated!
Jon
"Shiva" wrote:
> Hi,
> You can use the Attributes collection of the dynamic button as in:
>
> objbc.Attributes.Add("onClick", "window.open('http://www.google.com',
> 'googleWin');")
>
> "Jon" <Jon@discussions.microsoft.com> wrote in message
> news:8505E2E2-C195-4D2D-96AF-53D5B531CFA6@microsoft.com...
> Hello,
> I have a datagrid and the data in it is dynamically created at runtime...
>
> For iCounter = 0 To dataset.Tables(0).Columns.Count - 1
> Dim objbc As New BoundColumn()
>
> With objbc
> .DataField =
> dsAllPastReplies.Tables(0).Columns(iCounter).ColumnName
> .HeaderText =
> dsAllPastReplies.Tables(0).Columns(iCounter).ColumnName
> If .DataField =
> dsAllPastReplies.Tables(0).Columns("ReplyID").ColumnName Then
> .Visible = False
> End If
> End With
>
> With datagrid1
> .Columns.Add(objbc)
> .DataSource = dsAllPastReplies.Tables(0)
> .DataBind()
> End With
> Next
> dsAllPastReplies.Clear()
>
> I can add a column of buttons at design time, but how can I fire off some
> javascript when a button is clicked? I would ultimately like to have a user
> click one of the buttons and data in the corresponding row for a given
> column would come up in a popup window. I have the javascript to do the
> popup, but I cant figure out how to call it from the dynamically created
> buttons.
> --
> Any info will be very appreciated!
>
> Jon
>
>
>
- Next message: J. Kingsley: "Re: Executing a VB Script file from VB.net"
- Previous message: Supra: "Re: .Net Trial"
- In reply to: Shiva: "Re: Execute Javascript From Buttons Inside Datagrid"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|