向js里边传参数
我想向onclick="OpenSelectInfo(tempAid)"传递参数,但是下边这么写不行,该怎么写?
谢谢指教
@{
var tempAid = ViewData["AlbumId"];
<input type="button" id="addbtn" runat="server" value="添加文档(A)" style="width: 80px;" onclick="OpenSelectInfo(tempAid)" />
<text> </text>
}
<script type="text/javascript">
function OpenSelectInfo(albumId) {
var width = 1000; //模态窗口的宽度
var height = 500; //模态窗口的高度
var url = "/Admin/Libindex/0?aid=" + albumId; //模态窗口的url地址
window.showModalDialog(url, null, 'dialogWidth=' + width + 'px;dialogHeight=' + height + 'px;help:no;status:no;center=yes;');
}
</script>