参数值为iframe src [英] parameter value to iframe src
问题描述
我有一个视图,在视图中我正在调用一个aspx页面来加载报表查看器。我想将url的参数传递给iframe内的aspx页面。
浏览器网址为localhost / Contract / ContractReport / 12233
我想将12233作为../../ContractReport.aspx?12233传递给iframe来源
请给我建议
简单地调用这样的页面
< iframe src = / ContractReport.aspx?12233 > < / iframe >
-------------更新后的答案
在这样的控制器中设置你的URL
< span class =code-keyword> public ActionResult Index()
{
ViewBag.myURL = / abc.aspx? + querystring; // 在此处设置动态网址
返回查看();
}
然后在你的视图中,
< iframe id = iframe src = @ Url.Content(ViewBag.myURL) style = width:700; height:700px; > < / iframe >
< BLOCKQUOTE> @ ViewContext.RouteData.Values [ ID]
Hi,
I have a view, inside view i am calling an aspx page to load report viewer. I wanted to pass the parameter of the url to the aspx page which is inside the iframe.
The browser url is localhost/Contract/ContractReport/12233
I want 12233 to be passed to the iframe source as ../../ContractReport.aspx?12233
Please give me suggestions
Simple call your page like this
<iframe src="/ContractReport.aspx?12233"></iframe>
------------- Updated Answer below
Set your URL in controller like this
public ActionResult Index() { ViewBag.myURL = "/abc.aspx?" + querystring; // set your dynamic URL here return View(); }
Then in your View,
<iframe id="iframe" src="@Url.Content(ViewBag.myURL)" style="width: 700; height: 700px;"></iframe>
@ViewContext.RouteData.Values["id"]
这篇关于参数值为iframe src的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!