Professional Web Applications Themes

Adding client-script to handle client events - ASP.NET Data Grid Control

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 ...

  1. #1

    Default Adding client-script to handle client events

    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


    Andrea Williams Guest

  2. #2

    Default Re: Adding client-script to handle client events

    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" <andreawilhotmail.IHATESpam.com> wrote in message
    news:u7K6HTNIEHA.2260TK2MSFTNGP09.phx.gbl...
    > 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
    >
    >

    Andrea Williams Guest

Similar Threads

  1. JRun fails to handle client variables in DB over 8K
    By Emblue in forum Coldfusion Server Administration
    Replies: 9
    Last Post: July 26th, 06:50 PM
  2. Flash Webcam client <-> client (not client <-> server<-> client)
    By bivald in forum Macromedia Flash Flashcom
    Replies: 0
    Last Post: April 24th, 10:33 PM
  3. Adding a Progress Bar to a Web Service Client
    By Chuck Hartman in forum ASP.NET Web Services
    Replies: 3
    Last Post: February 21st, 05:31 AM
  4. Adding a new WebMethod , what about old client?
    By Ghislain Tanguay in forum ASP.NET Web Services
    Replies: 1
    Last Post: February 17th, 05:25 PM
  5. CustomWebControl with client script
    By Lance in forum ASP.NET Building Controls
    Replies: 1
    Last Post: October 31st, 06:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139