Solved

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

Posted on 2006-11-29
5
710 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…

756 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