User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 423,231 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,936 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 3351 | Replies: 4
Reply
Join Date: Mar 2008
Posts: 55
Reputation: dskumar_85 is an unknown quantity at this point 
Rep Power: 1
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

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Location: Ohio
Posts: 204
Reputation: plazmo is an unknown quantity at this point 
Rep Power: 4
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

  #2  
Apr 2nd, 2008
in the target property of the field, set it to _blank
Reply With Quote  
Join Date: Dec 2007
Posts: 287
Reputation: ericstenson is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 28
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

  #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.

   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

Last edited by ericstenson : May 5th, 2008 at 5:11 pm. Reason: forgot end if
--
"Dummy."
Reply With Quote  
Join Date: May 2008
Posts: 1
Reputation: giri.d24 is an unknown quantity at this point 
Rep Power: 0
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

  #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  
Join Date: May 2008
Posts: 47
Reputation: ardeezstyle is an unknown quantity at this point 
Rep Power: 1
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

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 9:17 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC