Solved

Pass GridView Contents Via A Click Event To A Popup Window...

Posted on 2010-09-10
2
278 Views
Last Modified: 2012-05-10
Hi,
I've tried a fews ways to make this work, but have had no luck. Is it possible to use the showModalDialog() to open a new aspx page and pass it the values from a Gridview that resides on the parent page? I tried my hand with the dialogArguments Property bit I wasn't able to nail down the correct syntax to read the values to pass along. Any thoughts on how to accomplish this?

One idea of many that looked promising:
    <script language="javascript" type="text/javascript">
            var ThisText = MainContent_gvwEmployeeCart.rows[1].cells[1].Column1;
            window.showModalDialog("ICertifyDocumentTraining.aspx", ThisText, "dialogHeight:300px; dialogLeft:200px;");
    </script>

Cheers,
Ty
0
Comment
Question by:MedtronicVascSR
2 Comments
 
LVL 8

Accepted Solution

by:
Mohit Vijay earned 250 total points
ID: 33652092
put alert like below

var ThisText = MainContent_gvwEmployeeCart.rows[1].cells[1].Column1;
alert(ThisText);

and check if you are getting value or not.

I think correct syntax will be

var ThisText = MainContent_gvwEmployeeCart.rows[1].cells[1].innerHTML;

I hope you know how you will get this value on other page.
0
 

Author Closing Comment

by:MedtronicVascSR
ID: 33652231
Thanks VjSoft. That accomplishes the task, though it does require careful handling since passing the  tag that comes back from innerHTML value constitutes a potential scripting attack when the pop up window displays.

I'm sure there is a more elegant/efficient way to pass the contents whole, but this will work for what I need to do.

Cheers,
Ty
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
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.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

813 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

17 Experts available now in Live!

Get 1:1 Help Now