godcomputer
asked on
how do i get data back from a function call to javascript function back to asp .net
i have a listview control and it will fire a javascript call
function HighlightRow(nListID)
{
if (document.getElementById(" lv_chk_lvi _" + nListID).checked==true)
document.getElementById("l v_row_" + nListID).style.backgroundC olor='#ccc cff';
else
document.getElementById("l v_row_" + nListID).style.backgroundC olor='#fff fff';
}
when in asp .net i have this
ListItem.CheckBoxDHTML = "onclick=javascript:Highli ghtRow('#L VI#')"
what i want to do is when i select a button. and call a function thats javascript that will go in and return the values of the checked items on the asp.net listview control.
i want to basically end up returning an array of values from a a javascript function that will tell me which IDs of the listview have been selected.
function HighlightRow(nListID)
{
if (document.getElementById("
document.getElementById("l
else
document.getElementById("l
}
when in asp .net i have this
ListItem.CheckBoxDHTML = "onclick=javascript:Highli
what i want to do is when i select a button. and call a function thats javascript that will go in and return the values of the checked items on the asp.net listview control.
i want to basically end up returning an array of values from a a javascript function that will tell me which IDs of the listview have been selected.
ASKER
the checkboxes are being created from a serverside control with a .write to the document page so for some reason i cant use findcontrol? its not finding my items.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Will the user eventually click a "submit" or "save" button that will post back to the page?
If so, you can just loop through the rows in the ListView and check if each checkbox was checked when the user clicked the submit button.
For example:
for (int i = 0; i < _myListView.Items.Count; i++)
{
if (((CheckBox)_myListView.It
//This checkbox was checked, so do something
}