Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Adding client-script to handle client events

Reply
Thread Tools

Adding client-script to handle client events

 
 
Andrea Williams
Guest
Posts: n/a
 
      04-12-2004
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


 
Reply With Quote
 
 
 
 
Andrea Williams
Guest
Posts: n/a
 
      04-12-2004
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



"Andrea Williams" <> wrote in message
news:...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamically adding controls with events (but events are not firing) SevDer ASP .Net 2 11-13-2007 06:33 AM
Events Events Events Please Help Chris ASP .Net Web Controls 0 08-30-2005 08:21 PM
adding events to a client side control in asp.net code Brian Henry ASP .Net 3 08-02-2004 05:46 PM
File Handle Reading Blues: Rereading a File Handle for Input Dietrich Perl 1 07-22-2004 10:02 AM
Using client-side javascript to handle events on an TabStrip or Multipage - Can it be done? Blair Taylor ASP .Net Web Controls 1 08-07-2003 03:58 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57