how to display messagebox when i am clicking add image and at the same time the image is changed to cancel image

hi to all

 i have  aproblem  i am having a image called addnewuser when i am clicking that addnewuser i should get a message box saying that "are you sure u want to add new user " at the same time the image is change to  cancel

when i click  that cancel  image i  should  get a confirmation messagbox "are you sure u want to  cancel" how can i tried  to write but when ia m writing this i am  getting the same messagebox what i am writting for addnewuser so please kindly  help me  even i am  sending my javascript in which  the inner text of that is automatically  converted from, addnewuser image to  cancel image and text also  so  tell how cani  write this



 this is aspx html code for that image

<a class="textcopy" id="btnadd" href="" runat="server" detailhref="Userdetails.aspx"><img onmouseover="this.src='../images/icon_refresh.gif" alt="Refresh" height="23" border="0" onmouseover="this.src='../images/icon_refresh_hover.gif'" onmouseout="this.src='../images/icon_refresh.gif'" />

page_load i wrtte this code

 btnAdd.Attributes.Add("onclick", "return confirm('Are you sure ?'),ShowGridDetail(this, 'locationId'," +  userLocation.LocationId + ", 250, '" + Global.GetRootUrl + "');window.event.returnValue=false;");

javascript for that method  

ShowGridDetail(editButton, idName, id, height, rootUrl)


// hide the message if it is showing.


// hide if editing a different record or closing the existing

if (clickedButton != null)


if ( !=





// save button

clickedButton = editButton;

// insert a new row in the table for the child info

if (editingId == 0)


var oRow = GetParentObject(editButton, "TR");

var RowIndex = RowObjectToIndex(oRow)

var oTable = GetParentObject(editButton, "TABLE");

var ColumnCount = oRow.cells.length;

// need to add the row

newRow = oTable.insertRow(RowIndex+1);

var NewCell = newRow.insertCell(0);

NewCell.setAttribute("colSpan", ColumnCount.toString());

var iframeSrc = "";if (editButton.detailhref.indexOf("?") > -1)


iframeSrc = editButton.detailhref + "&" + idName + "=" + id;




iframeSrc = editButton.detailhref + "?" + idName + "=" + id;


// idName may be either id or parentId

CellContent =

"<table cellpadding='0' cellspacing='0' width='100%'>"+

"<tr><td><iframe src='" + iframeSrc + "' frameborder='0' width='100%' height='" + height + "' scrolling='no'></iframe></td></tr>"+


NewCell.innerHTML = CellContent;

// change the button to be cancel

if (clickedButton.children.length == 0)


clickButtonPreviousText = clickedButton.innerText;

clickedButton.innerText = "<img border='0' src='" + rootUrl + "images/icon_app_cancel.gif' alt='Cancel' onmouseover=this.src='" + rootUrl + "images/icon_app_cancel_hover.gif' onmouseout=this.src='" + rootUrl + "images/icon_app_cancel.gif' >";




// if clicked button has an image inside an anchor,

// remove the image and replace with word cancel.

clickButtonPreviousText = clickedButton.innerHTML;

clickedButton.innerHTML = "<img border='0' src='" + rootUrl + "images/icon_app_cancel.gif' alt='Cancel' onmouseover=this.src='" + rootUrl + "images/icon_app_cancel_hover.gif' onmouseout=this.src='" + rootUrl + "images/icon_app_cancel.gif' >";


editingId = id;





// reset teh click button to null when the cancel is clicked.

clickedButton = null;




8/17/2007 6:46:13 PM 91979 articles. 4 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 44

I'm not sure if this is what you are looking for, but have you considered using the ImageButton control?  That way the only javascript you would have to use is in generating the dialog script.  The following link may be helpful:


Hope that helps,


8/17/2007 8:48:02 PM

Similar Artilces:

display image in a image image button
hi   i have to display an image in image button while uploading mycode Image1.ImageUrl = Upload.PostedFile.FileName; is not working thanks Hi You need to save the PostedFile to the disk on the server and then assign it to ImageUrl. Take a look at the following links for more infoprmation on how to do this. Nassabehwww.professionalcsharp.comDon't forget to click "Mark as Answer" on the post that helped you. That way ...

image and image
// create an image object, using the filename we just retrieved System.Drawing.Image image = System.Drawing.Image.FromFile(Server.MapPath(file)); // create the actual thumbnail imageSystem.Drawing.Image thumbnailImage = image.GetThumbnailImage(64, 64, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), IntPtr.Zero);   now my question is how to display this image in my image1 control in (version 1.1) the below line of code is not working.  Image1.ImageUrl=thumbnailImage.ToString();Mark As Answer If my reply helped you. Hi, you can save t...

Image in image
Hi, I have a project where clients viewing my website can buy t-shirts. They can choose from a number of t-shirt colors and shapes which are their plain colour. They can also choose a number of prints to be placed on the t-shirt. These will be graphics stored in a database. My problem is on how I can displaty the t-shirt with the graphics or logo they chose on te t-shirt. It would be something like drawing text on an image but instead drawing an existing image on the base image. Any Ideas? (I am using visual studio 2005 and vb.NET)   RegardsMerovingian you 1. You can create a...

Imaging, but not imaging
We multicasted to 43 machines. Updated the image on the master. Multicasted the updated image to 36 machines. (the other 7 wouldn't join the session for some unknown reason). I visually verified that all 36 were imaging. One of the 8 which didn't rename appears to not even have been imaged. The problems with the previous image were still there. It's as though the machine didn't image even though I saw it take part in the session and the temp bar going across the screen. What the heck's going on here? AlaN As a try, what happens if you boot either to PXE ...

Image on Image
I am trying to display a page that has image of a map on it. The user can then place other images of red thumbtacks on the image at different locations. Then when these thumb tacks are clicked on, they open a folder of pics related to the area. I saw a method in the imageButton class that returns the (x,y) of the location where the user clicked. I thought I could use this information to place another, smaller image button, on that area. My problem is that i can't seem to get the bottom imageButton to be transparent so I can see the smaller one. Am i on the right track with this. Any advi...

Display image from image
Let me explain more. I have a Gridview, that displays an image.  Then i have a detailsview displaying an image from the selected value in the gridview.  Simple.  When i click on one of the images from the gridview, it displays the correct image in the detailsview.  Basically, i have two images in each row of the table in the database.The only way this works is if i have "autogenerateselectbutton=true" set.  I do not want the select link next to my image.  I want to be able to pick on the image in the GridView, and have it show the correct image in...

cannot get "display original image" in menu when right click on image
Name: jim rinaudo Email: Product: Firefox Summary: cannot get "display original image" in menu when right click on image Comments: I use netscape accelerator at max accel and need to show the original image. IE has the menu item, foxfire does not. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051107 Firefox/1.5 ...

Changing the image of an image button on clicking
I'm having a problem in changing an imagebutton's image once it has been clicked, using javascript. My code is as follows: WebPage.aspx.cs: private void Page_Load(object sender, System.EventArgs e) { .... btnConfirm1.Attributes.Add("onclick", "button_click();"); } WebPage.aspx: <HTML> <SCRIPT LANGUAGE="JavaScript"> function button_click() { document.getElementById('btnConfirm1').src = '/images/activity_bar.gif'; document.getElementById('btnEditAgain1').style.d...

Displaying image from database(image datatype) to image control
Hie all...I'm a newbie at I m currently using 2.0.I m having a problem with displaying images on my web form. Have tried looking thru all codes but i can't find a step by step tutorial for doing so. I understand that in 1.1, the detailsview can automatically be linked to the image field and display the image. But this is not possible now. So, i have decided to just display the image in an image control.from my understanding, 1. retrieve image from database and convert it to temporary image file in a file path. 2. use the image control's imageurl to point to the file....

Save Image Path into Database, Retrieve Image Path by Particular Image ID and Display Image through Gridview
Hi All, Currently, I have a file upload control in my aspx page to allow user to upload images. When the user clicks the SAVE button, the image will be saved in a particular folder named 'PMap' that located within the website. What I am trying to do here is to direct all uploaded images into a common image folder (in this case 'PMap') and then, retrieve the images and displayed it through a Gridview according to its respective image id. I have managed to store all uploaded images into a common image folder, PMap. However, I hope advice can be given on my following pro...

Displaying images in a DW (Getting image dimensions)
PB9.0 Hi all. Can some one help me with the following please: - I want to display an image in a dw. The user types the path and name of the file to be displayed in a text box. I then need to display this in the image object in the DW (this I can do), the problem is the image is being distorted based on the sixe of the image object. How do I get the dimensions of the actual image (could be a bmp, gif or jpg file) so I can set the image object size just prior to loading ? Thanks You could purchase a 3rd party DLL that has functionality to read the file's dimensions. A chea...

Getting images from db and displaying in WebControls.Image
So I have the following code which is getting my image, but unfortantly all that is displayed is a 'x' where the Image controls is placed.  In the main aspx.cs page:1 //get the image in bytes from the database 2 byte[] imageInBytes = image.LoadImage(Convert.ToInt32(dr.ItemArray[3])); 3 4 //place in memory stream 5 System.IO.MemoryStream memoryStream = new MemoryStream(imageInBytes, 0, ...

Treeview with images. Add on click behavior to images
hello,  Ive got a treeview that ive added onclick behavior to the text of, is there a way to apply this behavior to the images of the treeview or at least disable the option to switch pages via the image?    werD, MCSD VB.Net Hi, Are you using the ImageUrl property of the MenuItem? Like following example:           <asp:menuitem navigateurl="Home.aspx"             text="Home"            imageurl="Images\Home.g...

How to get large image when clicked on Thumbnail image
Hi, I am working on Repeater control which has image button within it. I want to fire image button click event to display the image in a large view. Can anyone help me   Best Regards, Rajesh Hi,check this Mehedi HasanMark as answer if the post meets your requirement! Hi Rajest, what about this idea <asp:HyperLink ID="ImageButton1" NavigateUrl='<%# Da...

Web resources about - how to display messagebox when i am clicking add image and at the same time the image is changed to cancel image -

File:Messagebox info.svg - Wikipedia, the free encyclopedia
This file contains additional information, probably added from the digital camera or scanner used to create or digitize it.If the file has been ...

Cydia Tweak: MessageBox Puts Facebook Chat Heads Anywhere In iOS
I think it’s safe to say that some iOS users felt a little left out when Facebook announced that system wide Chat Heads would only be available ...

b3ll/MessageBox · GitHub
MessageBox - Message Box

How to get Chat Heads on iOS right now with MessageBox
Normally speaking, mainstream outlets like The Verge don't run posts on topics like jailbreaking or jailbreak tweaks, but one in a while they ...

Adam Bell (@b3ll) on Twitter
Sign in Sign up You are on Twitter Mobile because you are using an old version of Internet Explorer. Learn more here Adam Bell @ b3ll Canada ...

网通传奇版本七星宝箱脚本 [@MAIN] #IF equal M99 6 #SAY 嘿嘿,祝贺你消灭了五个卧龙守将.您可以直接开启宝藏哦!\ 宝藏分为四个等级:檀木宝藏.紫铜宝藏.白银宝藏.赤金宝藏\ 不过是随机给你开启.如果开启到赤金宝藏.那你的运气真好!\ 开完 ...

Customer Support Frequently Asked Questions (FAQ)
DDClient DDE client ActiveX control component for Visual Basic from RHA (Minisystems) Ltd.

Microsoft to release first patches of 2007 next week
Next week, Microsoft will release its first eight security bulletins of 2007. Because Microsoft does not disclose details about the patches, ...

Has programming lost its way?
The average end user has no idea what goes into developing software. All they see is whether the software works or not, whether it looks good ...

UCOSP 2013 Wrap Up and Looking Ahead
Photo by Mike Baird used under Creative Commons This past fall the BlackBerry WebWorks community worked with the UCOSP program again, which engages ...

Resources last updated: 12/22/2015 8:27:18 AM