I have a javascript function that is called on button click event. The problem is that the identifier will not access the control unless i provide the complete path location which resides inside a Listview control.
Path location.ListView1_ctrl5_Label1 Also,the client identifier is not recognised? '<%= Label1.ClientID %>'
function validateUser(sender, args) {
var pr = document.getElementById('Label1').innerText;
var valid = true;

Deepak TewatiaRank #142 · 16K reputationPosted Dec 17, 2022, 2:53 PM EST
Hi peter,
you can use the findControl method of the ListView control to find the Label1 control. Here is an example of how you can do this:
function validateUser(sender, args) { // Find the ListView control var listView = document.getElementById(''); // Find the Label1 control inside the ListView using the findControl method var label = listView.findControl('Label1'); var pr = label.innerText; var valid = true; // ... }