[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 285
  • Last Modified:

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

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
MedtronicVascSR
Asked:
MedtronicVascSR
1 Solution
 
Mohit VijayCommented:
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
 
MedtronicVascSRAuthor Commented:
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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now