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

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2008
Posts: 57
Reputation: dskumar_85 is an unknown quantity at this point 
Solved Threads: 1
dskumar_85 dskumar_85 is offline Offline
Junior Poster in Training

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

 
0
  #1
Apr 2nd, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 206
Reputation: plazmo is an unknown quantity at this point 
Solved Threads: 16
plazmo's Avatar
plazmo plazmo is offline Offline
Posting Whiz in Training

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

 
0
  #2
Apr 2nd, 2008
in the target property of the field, set it to _blank
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 291
Reputation: ericstenson is an unknown quantity at this point 
Solved Threads: 29
Team Colleague
ericstenson's Avatar
ericstenson ericstenson is offline Offline
Posting Whiz in Training

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

 
0
  #3
May 5th, 2008
Hi... I would suggest passing the CompanyID in Session -- Session.Add("CompanyID") -- and retrieving the companyid -- Session.Item("ComanyID") from the popup.

  1.  
  2. Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GridView1.RowCommand
  3.  
  4. If GridView1.Rows.Count - 1 > 0 Then
  5.  
  6. If e.CommandName = "WHATEVERYOURBUTTONCOMMANDNAME" Then
  7.  
  8. Dim CompanyID As String = GridView1.DataKeys(Convert.ToString(e.CommandArgument)).Item(0).ToString
  9.  
  10. Session.Add("CompanyID", CompanyID)
  11.  
  12. Response.Write("<script>")
  13. Response.Write("window.open(YOURDETAILSWINDOW.aspx','_blank','toolbar=0,location=0,menubar=0,resizable=0,width=400,height=320')")
  14. Response.Write("</script>")
  15.  
  16. end if
  17.  
  18. end if
Last edited by ericstenson; May 5th, 2008 at 6:11 pm. Reason: forgot end if
--
"Dummy."
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 1
Reputation: giri.d24 is an unknown quantity at this point 
Solved Threads: 0
giri.d24 giri.d24 is offline Offline
Newbie Poster

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

 
0
  #4
May 6th, 2008
<asp:TemplateField HeaderText="Header">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
<ItemTemplate>

<a onclick="javascript:window.open('PricePage.aspx?id=<%#DataBinder.Eval(Container.DataItem,"Columnname")%>&show=<%#DataBinder.Eval(Container.DataItem,"Columnname")%>');" href="#" id="a6" ><%#DataBinder.Eval(Container.DataItem, "Columnname")%></a>


</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Header">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
<ItemTemplate>

<a onclick="javascript:window.open('PricePage.aspx?id=<%#DataBinder.Eval(Container.DataItem,"Columnname")%>&show=<%#DataBinder.Eval(Container.DataItem,"Columnname")%>');" href="#" id="a11" ><%#DataBinder.Eval(Container.DataItem, "Columnname")%></a>

</ItemTemplate>
</asp:TemplateField>
hi u can use this code and pass query string
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 48
Reputation: ardeezstyle is an unknown quantity at this point 
Solved Threads: 1
ardeezstyle ardeezstyle is offline Offline
Light Poster

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

 
0
  #5
May 6th, 2008
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..
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC