passing arguments from aspx pase to javascript

fatriz

New Member
i have a function with an argument in javascript that looks like this:\[code\]function editRow(str){var row= document.getElementById(str);var cols = row.getElementsByTagName("td");..........}\[/code\]and the function should get an id of some tr, and to replace all the text in the td's that this tr include.so, i tried to add a button in the tr that i want to change and with 'onclick' to call the function, but the problem is that the function working only without the argument, if im trying to send an argument its not working...the aspx.cs page:\[code\]......foreach (DataRow row in ds.Tables[0].Rows){(....more not important code.....)allStr +="<td><input type='button' **onclick='editRow('row"+row["Id"]+"');'** value='http://stackoverflow.com/questions/13789225/edit'><form id='TreeDelete2' action='delete.aspx' method='post' onsubmit='return IfToDelete();'><input type='image' name='sbmt' src='http://stackoverflow.com/images/X.gif'/></form></td></tr>";}......\[/code\]i marked the event with **.the id of the tr that i want to change is row1 (row["Id"]==1)so there is some other way to pass the argument from the aspx file? or i did somthing wrong?
 
Back
Top