我需要在点击视图中的按钮时打开一个新的弹出窗口.新窗口应重定向到特定控制器中的特定操作方法.我还需要提供新弹出窗口大小的属性.我一直在尝试以下代码:
<input type="button" name = "ClickMe" Value="ClickMe" onclick= "javascript:window.open('/Home/Create/','Customer Search',height='window.screen.height - 100', width='200',left='window.screen.width - 250' ,top='10',status='no',toobar='no',resizable='yes',scrollbars='yes')"/>
Run Code Online (Sandbox Code Playgroud)
点击按钮,没有任何反应.我得到以下Javascript错误:
行:19个
字符:1个
错误:参数无效.
代码:0
当我检查HTML渲染的ViewSource时,我发现该行是渲染按钮的那一行.我在IE 7中使用Windows Vista.我正在使用VS 2010中的Razor Engine处理MVC 3
我试图在视图中显示文本文件的内容.到目前为止,我已经能够为控制器获取以下代码:
public ActionResult ShowFile()
{
string filepath = Server.MapPath("\\some unc path\\TextFile1.txt");
var stream = new StreamReader(filepath);
return File(stream.ReadToEnd(), "text/plain");
}
Run Code Online (Sandbox Code Playgroud)
我不知道如何继续这个观点.
好心提醒.