index.cshtml
<div class="container">
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav" style="margin-left:-27px">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">PAGE1</a>
<ul class="dropdown-menu">
<li>@Html.ActionLink("TEST1", "Index", "TEST1")</li>
<li>@Html.ActionLink("TEST2", "Index", "TEST2")</li>
</ul>
</li>
<li>@Html.ActionLink("PAGE2", "Index", "PAGE2")</li>
</ul>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('ul.nav.navbar-nav').find('a[href="' + location.pathname + '"]')
.closest('li').addClass('active');
});
</script>
脚本适用于简单的li
但不适用于<a class="dropdown-toggle"
对correct script
的任何帮助?
实际上,当我点击main menu PAGE1
时,not executing script
为sub menu TEST1
,当我点击executing script
时,location.pathname
和/TEST1
为main menu as active
但是如何制作Public Sub GetData()
Dim oDB As ADODB.Connection: Set oDB = New ADODB.Connection
Dim oCM As ADODB.Command: Set oCM = New ADODB.Command
Dim oRS As ADODB.Recordset: Set oRS = New ADODB.Recordset
Dim strConn As String, strQuery As String
On Error GoTo Err:
strConn = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=TERADATA"
strQuery = "select * FROM P_ZC074_TMIS.FACT_TMX_PL_NII_TP_FX where CNT_ORG ='5872196'"
oDB.Open strConn
With oCM
.ActiveConnection = oDB
.CommandType = adCmdText
Set oRS = .Execute
End With
If Not oRS.BOF And Not oRS.EOF Then
ThisWorkbook.Worksheets("Sheet1").Range("A1").CopyFromRecordset oRS
End If
Err:
On Error Resume Next
oRS.Close
Set oRS = Nothing
oDB.Close
Set oDB = Nothing
MsgBox ("An error occurred!" & vbNewLine & "Error Number: " & Err.Number _
& vbNewLine & "Error Message: " & Err.Description), vbCritical, "Error!"
End Sub
?