參考外部DLL我有一個MVC 4應用程序,在這裏我想打電話給我的外部DLL(.NET項目也一樣),這將返回我的數據集。儘管我有參考,但我無法在我的項目中找到它。該DLL項目名稱是PScope.Optimizer。它給我的錯誤 - 0x800a1391 - JavaScript的運行時錯誤: 'PScope在' 未定義在MVC 4 Razor視圖
這是從DLL的代碼示例:
Public Class Main
Public Sub Main(connString As String, tenantID As Int16)
Connection_String = connString
Tenant_ID = tenantID
End Sub
Public Function MyFunc() As Integer
Return 0
End Function
末級
這是代碼MVC:
@using PScope.Optimizer;
<!DOCTYPE html>
<html>
<head runat="server">
<meta name="viewport" content="width=device-width" />
<script " type="text/javascript">
function OnButtonClick(s, e) {
var main1 = new PScope.Optimizer.Main();
}
</script>
</head>
<body>
<div>
@Html.DevExpress().Button(settings =>
{
settings.Name = "Button";
settings.Text = "Run Optimiser";
settings.ToolTip = "This may take a while. Please be patient";
settings.ClientSideEvents.Click = "function (s, e) { OnButtonClick(s, e); }";
//settings.UseSubmitBehavior = true;
}).GetHtml()
</div>
</body>
</html>
嗨,伯納德,我剛開始的時候並沒有清楚的說明這應該如何工作。現在我更瞭解MVC。謝謝! :) –