473,395 Members | 1,790 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,395 software developers and data experts.

creating pop-up box when deleting from datagrid

Can anybody tell me what is wrong with this code? The main error I seem
to be getting is where I am creating the LinkButton called deleteButton.

public void dgLog_ItemDataBound(object sender, DataGridItemEventArgs e)
{
//First, make sure we're NOT dealing with a Header or Footer row
if (!(e.Item.ItemType == ListItemType.Header) && (!(e.Item.ItemType
== ListItemType.Footer)))
{
//Now, reference the LinkButton control that the Delete ButtonColumn
has been rendered to
LinkButton deleteButton = (LinkButton)e.Item.Cells[0].Controls[0];

//We can now add the onclick event handler
deleteButton.Attributes.Add("onClick", "javascript:return
confirm('Are you sure you want to delete DialledNum #" +
DataBinder.Eval(e.Item.DataItem,"DialledNum") + "?');");
}
}

Thanks,

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #1
0 1408

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

Similar topics

1
by: Pedro | last post by:
Hi all, a friend using Windows wanted to send mail, but he got timeout errors after editing php.ini Mail section smtp = smtp.server.com sendmail_from = friend@server.com I realized that...
4
by: Roy Smith | last post by:
In the recent "transforming a list into a string" thread, we've been discussing the fact that list.pop() is O(1), but list.pop(0) is O(n). I decided to do a little timing experiment. To be sure,...
2
by: shawn | last post by:
Does anyone know where I can find any resources for dynamically creating pop out menus using a database backend for the links?
1
by: Sunil Prasad | last post by:
I've designed an image slide show containing 10 images in an html page, by clicking any image a pop window appears containing the image description. Instead of creating 10html popup html pages...
2
by: Michael Lvings | last post by:
I'm desperate for an Access database template that will record pop music chart information. I'm new to Access and having trouble working it out. Can anyone suggest a site where I might find a...
15
by: Stig Brautaset | last post by:
Hi group, I'm playing with a little generic linked list/stack library, and have a little problem with the interface of the pop() function. If I used a struct like this it would be simple: ...
11
by: Vijay Kumar R Zanvar | last post by:
> In <pan.2004.04.22.04.06.05.969827@bar.net> "Mac" <foo@bar.net> writes: > > >Is it legal to declare errno after you've included errno.h? > > > >For example: > > > >#include<errno.h> > > >...
25
by: Nicholas Parsons | last post by:
Howdy Folks, I was just playing around in IDLE at the interactive prompt and typed in dir({}) for the fun of it. I was quite surprised to see a pop method defined there. I mean is that a...
4
by: j_depp_99 | last post by:
The program below fails on execution and I think the error is in my pop function but it all looks correct.Also could someone check my code as to why my print function is not working? I havent...
8
by: julia_beresford | last post by:
Hi I need to create the following class at runtime: public class MyCollection : CollectionBase { public void Add(MyItem item) { List.Add(item); }
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.