I am new to asp.net and I need a little help.
The problem I need to set the visibility of a button based on whether or not "newflag" appears in the url. For example http://localhost:38805/result.asp?newflag
I have to use asp.net and javascript
Here is my current asp.net and JS code
asp.net
newflag = Request.Form("newflag")
If newflag = false Then
newflag = "null"
Else
newflag = "true"
End If
JS
var newflags = '<%= newflag %>';
console.log(newflags);
if (newflags === "null" ) {
document.getElementById('newflag').style.visibility = "hidden";
}
else if(newflags === "true" ){
document.getElementById('newflag').style.visibility = "visable";
}
Currently I am getting false from the console even with adding it to the url string.