Adding client-script to handle client events

A

Andrea Williams

My code is in a search box pop-up that is opened by a parent page. From the
search box, I need to be able to add code to a hyperlink in my datagrid (for
each row) that will call a client-side script that accepts the ID (primary
ID) and changes something in window.opener. I can add the javascript call
like so:

System.Web.UI.WebControls.HyperLinkColumn hypAddToSubmission = new
HyperLinkColumn();

hypAddToSubmission.DataNavigateUrlField = "ID");

hypAddToSubmission.Text = "Add";

hypAddToSubmission.NavigateUrl = "javascript:addAuthor(this);";

this.dgdUsers.Columns.Add(hypAddToSubmission);


Problem is, it doesn't get me the ID to utilize in the client script. I
don't want my ID to be visible to the user, but I need to be able to get the
ID so that I can pass it back to the parent page.

Is there a way to tell the data grid to add the ID into my NavigateUrl?

OR is there a way to add an <input type="hidden"> to a column to be utilized
by the clients-side script?

Any other ideas??

Thanks in advance!
Andrea
 
A

Andrea Williams

I found the answer... I guess I should have waited a bit longer to post...

should anyone need to know besides me, look up "DataNavigateUrlFormatString"

That worked quite nicely!

Andrea
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top