Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Picture Button

Reply
Thread Tools

Picture Button

 
 
Jason
Guest
Posts: n/a
 
      11-10-2003
Hi

I know this is probably simple, but i am running around stuck.

All i want is a picture as a button in one of my columns on the datagrid
control. when clicked, all that is done is a javascript "window.open()". How
do i do this?

Thanks
Jason


 
Reply With Quote
 
 
 
 
Alvin Bruney
Guest
Posts: n/a
 
      11-10-2003

if(e.Item.ItemType == ListItemType.Footer)
{
//build and add a label
Panel lb = new Panel();
Panel.BackImageUrl = "blah.gif";

e.item.controls[3].Controls.Add(tb);
tb = null;

//embed javascript into the control

e.Item.Cells[3].Attributes.Add("oncontextmenu","window.open('url. aspx');retu
rn false;
}

Here is an overview of the process. Put this code in an event handler such
as the itemdatabound. Build out a control which can take a picture as a
background. A panel will do nicely here. Add it to the cell being bound.
Embed the required javascript in with the control. In this case, right
clicking will fire of the javascript.
This is off the top of my head so it isn't guaranteed to compile but it
should provide the leg work to get things moving.

regards
--


-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"Jason" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> I know this is probably simple, but i am running around stuck.
>
> All i want is a picture as a button in one of my columns on the datagrid
> control. when clicked, all that is done is a javascript "window.open()".

How
> do i do this?
>
> Thanks
> Jason
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(June, 19th) Picture of the Picture Daniel Rocha Digital Photography 5 06-25-2006 06:17 PM
Problem with picture on SD card - can't delete bad picture Harlen Ng Digital Photography 8 11-11-2005 08:47 PM
Printing file number and picture number with picture Ace Digital Photography 2 09-17-2005 09:15 AM
Need opinions - good picture - bad picture utseay@aol.com Digital Photography 22 03-17-2005 08:01 AM
Help taking a picture of a glossy picture (Q-60 profiling) Fanta Digital Photography 3 08-31-2003 09:27 PM



Advertisments