To work around this problem, implement data that assigns functionality in a method in the codebehind
file instead of in the .aspx file. To do this, follow these steps:
- Start Microsoft Visual Studio .NET.
- Create a new ASP.NET Web Application
project in the following location:
http://localhost/TestApp
By default, WebForm1.aspx is created. - Drag a
HyperLink ASP.NET
server control to WebForm1.aspx.
- In Design view, right-click WebForm1.aspx,
and then click View Code.
- Change the code of the Page_Load event as follows:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
HyperLink1.NavigateUrl = Request.ApplicationPath & "/WebForm2.aspx"
End Sub