Solved

Open browser from GridView

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

831 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