我想向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>
谢谢指教 @{
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>
http://www.cnblogs.com/insus/articles/2036271.html
razer视图里边,好像没有这个
<input type="hidden" value="@ViewData["AlbumId"]" />
查看源码如下
<input type="hidden" value="12" />后边js怎么去调用?
<script type="text/javascript"> function OpenSelectInfo(albumId) {
var width = 1000; //模态窗口的宽度
var height = 500; //模态窗口的高度
var url = "/Admin/Libindex/0/?aid=@ViewData["AlbumId"]" ; //模态窗口的url地址
window.showModalDialog(url, null, 'dialogWidth=' + width + 'px;dialogHeight=' + height + 'px;help:no;status:no;center=yes;');
}
</script>
右键,查看源码如下。 在Google Chrome中可以正常执行,但是在ie中,我点击分页,会在母窗体中新增一个标签页,打开分页;并且模态页的分页不会变化这是怎么回事?
<script type="text/javascript"> function OpenSelectInfo(albumId) {
var width = 1000; //模态窗口的宽度
var height = 500; //模态窗口的高度
var url = "/Admin/Libindex/0/page1?aid=12" ; //模态窗口的url地址
window.showModalDialog(url, null, 'dialogWidth=' + width + 'px;dialogHeight=' + height + 'px;help:no;status:no;center=yes;');
}
</script>