Problem
1. You have set
Visible = "false"
for that
Label
. So, it will not render on Browser. Instead do
style = "display:none;"
.
<asp:Label ID="Label1" runat="server" Text="Label" style="display:none;"></asp:Label>
Now, it will render but will be hided. So, you can get its value.
2. You are not sending any value on function call inside the Button
onclientclick='Demand()'
. But you are reading the parameter
regid
, which will always by undefined.
As you are trying to read the Label's value, so don't pass any parameter. Directly read its value in function like below...
<script type ="text/javascript">
function Demand() {
var regid = document.getElementById('Label1').innerText;
window.open("AddM.aspx?Id=" + regid, 'Define', 'width=1000,height=600,left=0,top=0,scrollbars=yes,resizable=yes,menubar=yes');
}
</script>