Solved

Open browser from GridView

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Passing data between Forms 3 20
Finding the IIS version 5 21
ASP.NET Content Page 3 27
Get month and date in a format 4 31
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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.

856 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