open popup window from datagrid

Posted on 2005-04-07
Last Modified: 2008-03-03
using (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", "'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?

Question by:vbnewbie01
    LVL 44

    Accepted Solution

    Hi vbnewbie01,


         myImageButton.Attributes.Add("onclick", "'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
    LVL 1

    Author Comment

    nice.  strong work, tim.  thanks.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now