Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Open browser from GridView

Posted on 2011-09-23
4
Medium Priority
?
246 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 40

Accepted Solution

by:
Kyle Abrahams earned 2000 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

Technology Partners: 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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net 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…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

715 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