Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

932 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now