• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 324
  • Last Modified:

open popup window from datagrid

using asp.net (vb), i'm trying to open a popup window from my datagrid's imagebuttons without my page posting back, but for some reason, the page is still posting back ...


Sub dgProject_ItemDataBound(sender as Object, e as DataGridItemEventArgs)
   
Select Case e.Item.ItemType
     Case ListItemType.Item, ListItemType.AlternatingItem, ListItemType.EditItem
     Dim myImageButton As ImageButton
     myImageButton = e.Item.FindControl("ibProjectThumbnail")
     myImageButton.Attributes.Add("onclick", "window.open('login.aspx',null,'height=250, width=250,status= no, resizable= no, scrollbars=no, toolbar=no,location=no,menubar=no ');")
end select

End Sub


can someone suggest what's going wrong?

thanks.
0
vbnewbie01
Asked:
vbnewbie01
1 Solution
 
TimCotteeCommented:
Hi vbnewbie01,

Try

     myImageButton.Attributes.Add("onclick", "window.open('login.aspx',null,'height=250, width=250,status= no, resizable= no, scrollbars=no, toolbar=no,location=no,menubar=no ');return false;")

The return false should prevent the postback.

Tim Cottee
0
 
vbnewbie01Author Commented:
nice.  strong work, tim.  thanks.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now