troubleshooting Question

how to pass the "this" object from C# to a Java Script function.

Avatar of brgdotnet
brgdotnetFlag for United States of America asked on
2 Comments1 Solution130 ViewsLast Modified:
In my markup, If I pass the "this" pointer to my java script function, I am able to access the controls in my GridView control. See below code (Existing Code). What I really need to do though is to not pass the "this" object through but through C#. So how is the "this" pointer accessed through C#? considering I will pass it to a Java script function from C#? I know how to pass variables from C# to java script, but I just don't know how to access the "this" object.

Existing code :
<asp:button ID = "btnConfirmAll" Text="Confirm" runat="server" OnClientClick="processFunc(this); return false;" />

function processFunc(objRef)
  var row = objRef.parentNode.parentNode;
  var GridView = row.parentNode;
  var inputList = GridView.getElementsByTagName("input");

  for( var i = 0; i < inputList.length; i++)


Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros