Solved

Open browser from GridView

Posted on 2011-09-23
4
240 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 40

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 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