2011-11-01 203 views
1

我有以下代碼:使用C#parseInt函數

<div class="rep_td0">@(parseInt(d.RowKey.substr(2, 2)) + "." + parseInt(d.RowKey.substr(4, 2)))</div> 

得到一個錯誤說:

Compiler Error Message: CS0103: The name 'parseInt' does not exist in the current context 

我認爲這會工作,但不明白爲什麼我得到錯誤信息。有誰知道我可能做錯了什麼?

+0

也許你在C#代碼中混合使用java-script'parseInt'方法 - 在C#代碼中嘗試'int.Parse'! – VinayC

回答

4

難道你不能做int.Parse(d.RowKey.substr(2, 2))