c# - Unable to put my GridView into my javascript variable -


OK, it's so disappointing now that I have a GridView with 9 columns, I have 3 of them shown and I Create a separate table that shows the second when I click on the line to put my Javascript function in my new row in a new table when I click it ... except that it does not work!

  & lt; Script type = "text / javascript" & gt; Var table = $ ('& lt; Table & gt; & lt; / table & gt;'); Var Grid = document.getElementById ('& lt;% = BillabilityView.ID% & gt;'); // Here is the GridView inputting I $ (Document) .ready (function () {$ (". Tbl tr: has (td)"). CSS ({background: "ffffff"}. Click (function () {Var row = $ ('& lt; (& gt; & lt; / tr & gt;) AddClass (' bar '). Text (grid. Lights [$ (this). Index ()]); // Here it is saying that 'unable to get the value of the rows of properties' table .append (line); $ ('# please'); attachment (table);});}); & lt; / script & Gt;   

This is not putting a gridview in my word! Even when I just grid I do not understand these rows lengths. I am looking at other code samples and they do that and they say that it works fine. I'm 100% sure that this My GridView is to choose what's happening?

Edit: Here's the asp.net side:

  & asp: GridView id = "Billionality Weave" backendor = "White" run = "server" automatically generated column = "false" cssClass = "tbl"> gt; gt; & lt; column & gt; & lt; ap: baldfel E Detafild = "username" Hadertekst = "User Name" / & gt; & Lt; ASP: Baldfield Datafield = "User ID" HeaderText = "User ID" /> & Lt; ASP: Baldfield Datafield = "HRSTLB" Headtext = "Billable Hours" / & gt; & Lt; ASP: Baldfield Datafield = "HRSTLNB" Headtext = "NonBillable Hours" /> & Lt; ASP: Baldfield Datafield = "HRSTL" Headtext = "Total Hours" /> & Lt; ASP: Baldfield Datafield = "HRSXP" Headtext = "Expected Hours" /> & Lt; ASP: Boundfield Datafield = "Bailibility" Headtext = "Biliability" /> & Lt; / Column & gt; & Lt; / ASP: GridView & gt; & Lt; Div id = "please" & gt; & Lt; / Div & gt;   

Oak we will kick it in C # also

  BillabilityView.DataSource = dataList.retBillability (); BillabilityView.DataBind (); Biliability Weave Rowdatabad + = New GridView Event Handler (BailabiltyView_RadataBound); Zero BillabilityView_RowDataBound (Object Sender, GridViewRowEventArgs E) {if (e.Row.RowType == DataControlRowType.Header) {E.R.back Collar = Color.FromName ("# ebebeb"); } //e.Row.AttributesOnceClick "] = ClientScript.GetPostBackClientHyperLink // (this.BillibilityView," $ choose + e.Row.RowIndex); }    

Please change the lines below

  Var grid = document.getElementById ('& lt;% = BillabilityView.ID% & gt;'); $ (Document) .ready (function () {  

this way

  $ (document) .ready (function () {var grid = $ (" #BillabilityView ");   

PS: For continuation please replace document.getElementById Use jquery to get ElementById

Comments