webgrid hyperlink image button

7 replies. Last post: August 23, 2012 12:13 AM by Handy Surya
Tags :
  • New Discussion
  • New Question
  • New Product Feedback

Hi,

I want to add an image to Columns 0 then on click run javascript code.

When using a hyperlink another page opens no matter what target I use.  I only need an image and javascript to run, no hyperlink.

Can you tell me how to have an image column and run javascript on click?

   protected void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
        {
            WebGrid1.RootTable.Columns[0].ColumnType = ISNet.WebUI.WebGrid.ColumnType.HyperLink;  
          WebGrid1.RootTable.Columns[0].HyperlinkDisplayText = " <img onclick=\"msgbox3('Tools Update','ToolsAdminUpdate.aspx?id=" + e.Row.Cells[0].Text + "','500px','420px')\" style='border:0; width:35px' alt='" + "?id=" + e.Row.Cells[0].Text + "' src='Images/edit.png'/>";
          WebGrid1.RootTable.Columns[0].HyperlinkTarget = ISNet.WebUI.WebGrid.HyperlinkTarget.UseBase;
 
        }
All times are GMT -5. The time now is 10:09 PM.
Previous Next