954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to open popup window by clicking hyperlink in gridview and to pass query string

i have a hyperlink called companyname in gridview .when i click it has to open popup window and provides details of that company.can someone explain how to call popup window in hyperlink

dskumar_85
Junior Poster in Training
69 posts since Mar 2008
Reputation Points: 9
Solved Threads: 1
 

in the target property of the field, set it to _blank

plazmo
Posting Whiz in Training
207 posts since Aug 2005
Reputation Points: 23
Solved Threads: 16
 

Hi... I would suggest passing the CompanyID in Session -- Session.Add("CompanyID") -- and retrieving the companyid -- Session.Item("ComanyID") from the popup.

Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GridView1.RowCommand

        If GridView1.Rows.Count - 1 > 0 Then

            If e.CommandName = "WHATEVERYOURBUTTONCOMMANDNAME" Then

 Dim CompanyID As String = GridView1.DataKeys(Convert.ToString(e.CommandArgument)).Item(0).ToString

Session.Add("CompanyID", CompanyID)

               Response.Write("<script>")
                Response.Write("window.open(YOURDETAILSWINDOW.aspx','_blank','toolbar=0,location=0,menubar=0,resizable=0,width=400,height=320')")
                Response.Write("</script>")

end if

end if
ericstenson
Posting Whiz in Training
Team Colleague
295 posts since Dec 2007
Reputation Points: 14
Solved Threads: 29
 
giri.d24
Newbie Poster
1 post since May 2008
Reputation Points: 10
Solved Threads: 0
 

Hi You can do that by using JavaScript's OpenWindow() method and set the attribute values properly so that you get what exactly you want..

ardeezstyle
Light Poster
49 posts since May 2008
Reputation Points: 13
Solved Threads: 1
 
imamul.karim
Newbie Poster
1 post since May 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You