1

这是我第一次接触 .net,来自 PHP 的东西看起来很熟悉,但不知道该怎么做。

代码:

If [your condition here]
    Your code here
Else
    Your code Here
End If

对于上面的代码,我想做这样的事情:

    if current page = default.aspx then include 
    <%=HttpHelper.ExecutePage("/UserControls/somefile.aspx")%>

Else if it isn't then don't show it. 

我怎样才能在.net中做到这一点?

4

1 回答 1

1

类似的东西

  Dim CurrentPath As String = Request.Url.AbsolutePath
  Dim TargetPath As String = VirtualPathUtility.ToAbsolute("~/default.aspx")

  If CurrentPath.ToLower = TargetPath.ToLower Then
            Server.Execute("~/UserControls/somefile.aspx")
  End If
于 2013-08-27T23:43:29.053 回答