473,387 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

GridView triggering javascript

Hello,

I need a column in a GridView to trigger a javascript function ( to play an
MP3 file).

I am catching the RowCreated event from the GridView.
I then add my javascript code like this:

protected void OnRowCreated(object sender, GridViewRowEventArgs e) {
if(e.Row.RowType == DataControlRowType.DataRow) {

e.Row.Cells[6].Attributes.Add("oncommand","javascript:alert('foo ')");

}

}

The alert window is never seen ( the Cells[6] is an ItemTemplate containing
a button.)

How can I add javascript code dyncamically to a column in a GridView?

Thanks,

bruce


Jan 22 '08 #1
0 1012

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Steve Schroeder | last post by:
For some reason I cannot get the OnSelectedIndexChanged event to fire for a listbox I have on a page. I'm able to populate the listbox with data from a stored procedure, but cannot trigger the...
2
by: Kamen | last post by:
Hello there, I try to define the properties font-size and font-bold of the pager of a gridview using the pagerstyle, but the settings are not appleyd at run time. What could be the reason for...
6
by: CSharpguy | last post by:
In my gridview I have 2 -3 template fields which are hyperlinks. I allow the user to print this grid. When the grid prints it also prints the links, how can I take the user to a print preview page...
1
by: jmdolinger | last post by:
Hi all, I'm a newbie to Atlas (and recently ASP.NET) after coming from a long Java background, also have done quite a bit with an Ajax.NET/ASP.NET 1.1 project, but it was basically all...
1
by: ist | last post by:
Hi, I am trying to create a Session-Wide, Disconnected, Updatable DataTable (or DataSet) object and use it through an ASP.NET GridView. The scenario is this: 1. When the page is first loaded,...
1
by: John Devlon | last post by:
Hi, I've created a small webpage, containing a Treeview and a Gridiview. The treeview is populated with all folders and subfolders of a directory. so far, so good. When clicking on a node in...
1
Frinavale
by: Frinavale | last post by:
I'm working on an ASP.NET application using VB.NET for server side code. I have a GridView listing a bunch of stuff. Above the GridView I have a checkbox named "ChkBx_SelectAll". If this...
4
by: Peter | last post by:
I want to call a JavaScript on PageIndexChanged event, how do I do that? Thank You Peter
1
by: Mel | last post by:
I have a GridView that is bound to a DataTable. I decided to allow the user to change the column data right in the ItemTemplate. Then user won't need to click Edit to change the values and then...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.