Solved

Open browser from GridView

Posted on 2011-09-23
4
229 Views
Last Modified: 2012-05-12
I'm trying to open a browser from a GridView and I'm having trouble figuring out how to do it.

Within my Grid I have a Template field.  With the field I have a hyperlink with an onClick to open the browser.  Within that OnClick I need to input a unique ID so when the pop-up window open it loads the proper content.

Can someone show me how to do this correctly?  Thanks!
<Template> 
    <a href='javascript:void(0);' onclick='MM_openBrWindow('View-Meeting.aspx?ScheduleID="<%#Container.DataItem("id").ToString()%>"','','scrollbars=yes,resizable=yes,width=900,height=630')'>View</a>
</Template>

Open in new window

0
Comment
Question by:cdemott33
  • 3
4 Comments
 
LVL 39

Accepted Solution

by:
Kyle Abrahams earned 500 total points
ID: 36589240
Try Eval?

<Template>
    <a href='javascript:void(0);' onclick='MM_openBrWindow('View-Meeting.aspx?ScheduleID="<%# Eval("id").ToString()%>"','','scrollbars=yes,resizable=yes,width=900,height=630')'>View</a>
</Template>
0
 

Author Comment

by:cdemott33
ID: 36589363
Hi Ged325.  I'm getting the value using the <%#Container.DataItem("id").ToString()%>.  My problem is the onClick event itself.  It doesn't fire.  
0
 

Assisted Solution

by:cdemott33
cdemott33 earned 0 total points
ID: 36589402
Hi Ged325 - I figure it out.  It had to do with the quotes I was using to encapsulate the data.  Thanks for your help.

Corrected code below.
<a href="javascript:void(0);" onclick="MM_openBrWindow('View-Meeting.aspx?ScheduleID=<%#Container.DataItem("id").ToString()%>','','scrollbars=yes,resizable=yes,width=900,height=630')">View</a>

Open in new window

0
 

Author Closing Comment

by:cdemott33
ID: 36715403
Thanks!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

16 Experts available now in Live!

Get 1:1 Help Now