I just want to ask how to fix this code so that the second page is redirecting to the entered in the TextBox. Here's my code in the second page.
This code is located at the .aspx page
<body>
<form id="form1" runat="server">
<div>
<script type ="text/javascript">
var gotoURL = document.getElementById('<%=siteURL2%>').value;
window.location.href = 'http://www.' & gotoURL;
</script>
</div>
</form>
</body>
While this one is located at the .aspx.vb.
Protected siteURL As String = PreviousPage.currenctCity()
Protected Property siteURL2 As String
Get
Return siteURL
End Get
Set(value As String)
siteURL = value
End Set
End Property
I'm getting the error: **Object reference not set to an instance of an object.**
at This Line: **Protected siteURL As String = PreviousPage.currenctCity()**
I have this code at the second page so that I can call the declared variable at the First page to the Second One.
Code: **<%@ PreviousPageType VirtualPath="~/Default.aspx" %>**