Results 1 to 4 of 4

Thread: GridView ButtonField to a New Window

  1. #1

    Thread Starter
    Hyperactive Member ARPRINCE's Avatar
    Join Date
    Mar 2003
    Location
    Pinoy in NJ
    Posts
    381

    GridView ButtonField to a New Window

    I'm currently using a RESPONSE.REDIRECT but I want to open to a new window using VB.NET. Any tips on doing this? TIA
    Code:
        Protected Sub gridREPORTS_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gridREPORTS.RowCommand
            If e.CommandName = "View" Then
                Dim row As GridViewRow = gridREPORTS.Rows(Convert.ToInt32(e.CommandArgument))
                Session("Reports") = row.Cells(0).Text
                Response.Redirect("DisplayReport.aspx")
            End If
        End Sub

  2. #2
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,168

    Re: GridView ButtonField to a New Window


  3. #3

    Thread Starter
    Hyperactive Member ARPRINCE's Avatar
    Join Date
    Mar 2003
    Location
    Pinoy in NJ
    Posts
    381

    Re: GridView ButtonField to a New Window

    Quote Originally Posted by benmartin101 View Post
    Thanks - I'll look into it.

  4. #4
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: GridView ButtonField to a New Window

    Quote Originally Posted by benmartin101 View Post
    This is the approach that I have used in the past as well.

    Depending on the layout of your code, and "what" you are doing during the postback to causes the redirect to another window, you might want to think about offloading this work on the client, and using something like jQuery/JavaScript to open the new window.

    Gary

    P.S. If your question has been answered, can you remember to mark your thread as resolved?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width