在母版页中如何获当前运行的是哪个子页?也就是说如何获得当前content控件中的页面.
谢谢!

解决方案 »

  1.   

    我的意思是这样的,我想在SystemMasterPage.master.cs文件中实现
    if(当前页==子页1)
    { 在母版页中显示("子页1");}
    else
    { 在母版页中显示("其它页");}反正我就是想在不同的子页中改变母版页的内容,不知道可以实现不?
    谢谢.
      

  2.   

    用javascript
     switch(document.location.href)   
           {
                      case    "http://.....aspx":      
                             .......
                             break;      
                      case    "http://....aspx":      
                             .....
                             break;   
            }
      

  3.   

    MASTER页有个LABEL,ID= lblContentName
    实现的方法有2种:
    1)统一在MASTER页实现:
     Sub setLblContentNameText()
            Dim strRawUrl As String = LCase(Request.RawUrl.ToString)
            If InStr(strRawUrl, "/en/office/ohome") = 1 Then
                lblContentName.Text = "Office Home"
            ElseIf InStr(strRawUrl, "/en/office/otrade") = 1 Then
                lblContentName.Text = "Manager Trade Leads"
            End If
        End Sub
    2)在Content页实现,较麻烦:
    MASTER要有个属性
     Public Property pptLblContentNameText() As String
            Get
                Return lblContentName.Text
            End Get
            Set(ByVal value As String)
                lblContentName.Text = value
            End Set
        End Property
    Content页要添加:
    <%@ MasterType VirtualPath ="~/cn/admin/Admin.master"  %> (在aspx页头,virtualpath为MASTER页的途径)
    在Content页的page_load里:
    master.pptLblContentNameText="xxxxxxx"就可以了.