使用javascript打开一个aspx页面作为框架 [英] Open an aspx page as a frame using javascript

查看:84
本文介绍了使用javascript打开一个aspx页面作为框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个打开.aspx页面作为框架的问题。我有一个在运行时创建的链接按钮。如果我点击该链接,我需要打开另一个.aspx页面作为一个框架。由于我在运行时创建链接按钮,因此无法将.aspx页面作为一个框架打开。有没有办法打开.aspx页面作为框架而不是窗口。在javascript中有一个函数可以打开另一个页面作为window.open()的浏览器窗口。我需要只使用Javascript打开它。



我们是否有任何函数可以像window.open()一样打开.aspx页面?



你的答案将帮助我解决我的问题。提前谢谢。

I have a problem of opening an .aspx page as a frame. I have a link button that is created at run time. If i click on that link i need to open another .aspx page as a frame. Since i am creating the link button at run time i could not open the .aspx page as a frame. Is there a way to open the .aspx page as a frame and not as a window. There is a function in javascript to open another page as a browser window that is "window.open()". And i need to open it by only using Javascript.

Do we have any function to open the .aspx page as as frame like "window.open()"?

Your answer will help me to solve my problems. Thank you in advance.

推荐答案

Dim JScrip As StringBuilder = New StringBuilder

Dim Location As String = Request.ApplicationPath& /BugTrack/ViewCallDetails.aspx

位置=位置& ?action =&行动

JScrip.Append(& vbCrLf)

JScrip.Append(var WinSettings ='center:yes; resizable:no; dialogWidth:800pt; dialogHeight: 500pt';)

JScrip.Append(window.showModalDialog('& Location&',window,WinSettings);)

'JScrip。追加(window.open('& Location&');)

JScrip.Append()

Page.ClientScript.RegisterStartupScript(GetType (字符串),ViewDetails,JScrip.ToString())
Dim JScrip As StringBuilder = New StringBuilder
Dim Location As String = Request.ApplicationPath & "/BugTrack/ViewCallDetails.aspx"
Location = Location & "?action=" & action
JScrip.Append("" & vbCrLf)
JScrip.Append(" var WinSettings = 'center:yes;resizable:no;dialogWidth:800pt;dialogHeight:500pt';")
JScrip.Append("window.showModalDialog('" & Location & "', window, WinSettings);")
'JScrip.Append("window.open('" & Location & "');")
JScrip.Append("")
Page.ClientScript.RegisterStartupScript(GetType(String), "ViewDetails", JScrip.ToString())


我终于找到了在代码隐藏时打开.aspx页面作为框架的解决方案。



StringBuilder sb = new StringBuilder();

sb.Append(< table>);

sb.Append(< ; tr>);



for(int i = 0; i< tickers.Count; i ++)

{

sb.Append(< td>);

sb.Append(< a id ='lnkTicker+ tickers [i] .Tic kerId +'class ='thickbox'href ='ticker-detail / default.aspx?TickerId =+ tickers [i] .TickerId +& keepThis = true& TB_iframe = true& height = 350& width = 500' title ='Ticker Details'>< span style ='COLOR:+ tickers [i] .TickerColor +'>+ tickers [i] .TickerText +& nbsp;& nbsp;< em> ;阅读更多...< / em>& nbsp;& nbsp;& nbsp;& nbsp;< / span>< / a>);

sb。追加(< / td>);

}

sb.Append(< / tr>);

sb .Append(< / table>);

Tickertbl.InnerHtml = sb.ToString();





其中'tickers'是绑定列表对象,'Tickertbl'是
I finally found the solution to open an .aspx page as a frame at codebehind.

StringBuilder sb = new StringBuilder();
sb.Append("<table>");
sb.Append("<tr>");

for (int i = 0; i < tickers.Count; i++)
{
sb.Append("<td>");
sb.Append("<a id='lnkTicker" + tickers[i].TickerId + "' class='thickbox' href='ticker-detail/default.aspx?TickerId=" + tickers[i].TickerId + "&keepThis=true&TB_iframe=true&height=350&width=500' title='Ticker Details'><span style='COLOR: " + tickers[i].TickerColor + "'>" + tickers[i].TickerText + "&nbsp;&nbsp;<em>read more...</em>&nbsp;&nbsp;&nbsp;&nbsp;</span></a>");
sb.Append("</td>");
}
sb.Append("</tr>");
sb.Append("</table>");
Tickertbl.InnerHtml = sb.ToString();


Where 'tickers' is the bound list object and 'Tickertbl' is a
元素标签id。


这篇关于使用javascript打开一个aspx页面作为框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆