Solved

open a popup window from a linkbutton or hyperlink inside a datagrid in vb

Posted on 2006-11-29
5
711 Views
Last Modified: 2012-05-05
i have a datagrid and i want to add a linkbutton or hyperlink to it so i can open up a popup window.

i am using vs.2003


thanks
jcook32
0
Comment
Question by:jcook32
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 13

Expert Comment

by:jeebukarthikeyan
ID: 18036947
hi,

create a template coloum in the datagrid

in the item databound event create a hyperlink text to it

on the click call a javascript

if u want i will put some code

b u d d h a
0
 
LVL 28

Accepted Solution

by:
strickdd earned 450 total points
ID: 18039769
Something like this should work:

<asp:TemplateField>
<HeaderTemplate>
    Column Header Here
</HeaderTemplate>
<ItemStyle HorizontalAlign="Left" VerticalAlign="Bottom" />
<ItemTemplate>
    <asp:Button ID="btn" runat="server" CommandArgument="<%# Bind('IDField')%>" Text="Click" CausesValidation="False" />
    </ItemTemplate>
</asp:TemplateField>

protected void grdUsers_OnRowDataBound(object sender, GridViewRowEventArgs e)
    {

        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Button btn= (Button)e.Row.FindControl("btn");
            btn.Attributes.Add("onclick", "window.open([sURL] [, sName] [, sFeatures] [, bReplace]);");
        }
    }
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
LINQ Select all records by MAX data syntax help 1 48
orderby list (from Json) 1 43
Build a string of emails from a gridview 2 30
How to set focus on a dynamic control 18 49
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question