Solved

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

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

706 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

16 Experts available now in Live!

Get 1:1 Help Now