Scenario below:
I have a .asp window A (here we call it parent window)which contains a frameset. (actually it sometimes contain frameset, sometimes do not contain frameset.) A includes a header file we call it TopBar.asp.I have a asp.net window B (we call it child window), it has a lot of different URL links on window B. When I click each of the links, they will open in page A.It didn't works if I use target="_parent" in window B. So I give a name "aaa" to TopBar, then set target="aaa" and open the links in window A.Question:
How could I open the links in window A from Top window in .net? Since my .net code do not have <a href ...> or anything like asp.(I could not put the page "aaa" in frameset, since sometimes the window do not have frameset)I am not sure if I make sense. Please let me know if it has any questions. Thanks a lot!
I have a .asp window A (here we call it parent window)which contains a frameset. (actually it sometimes contain frameset, sometimes do not contain frameset.) A includes a header file we call it TopBar.asp.I have a asp.net window B (we call it child window), it has a lot of different URL links on window B. When I click each of the links, they will open in page A.It didn't works if I use target="_parent" in window B. So I give a name "aaa" to TopBar, then set target="aaa" and open the links in window A.Question:
How could I open the links in window A from Top window in .net? Since my .net code do not have <a href ...> or anything like asp.(I could not put the page "aaa" in frameset, since sometimes the window do not have frameset)I am not sure if I make sense. Please let me know if it has any questions. Thanks a lot!
解决方案 »
- C# 如何将图片封装至dll中
- 求 自定义DataGridViewColumn 怎么写
- c#培训资料培训新人
- 求助!菜鸟问题!
- isa 检测是否给定类的对象【isa是什么的缩写?】
- 如何用CreateElement创建带有冒号的XmlElement??
- 各位好同志 小弟正在做一个小的考试系统 怎么从数据库读出随机数呢?
- C#数据类型转换的几种形式
- asp.net ajax 服务器如何将处理结果发送给客户端
- 请教微软专家,你们的各种技术和产品在在软件开发中地位,现在和未来趋势。 能答多少都给分
- 100分求救!WinForm中DataGrid在可编辑情况下分页
- 不知道在水晶报表中得到双击的某一列的值
--------------------------
楼主这个是怎么回事啊?
-----------------------------
还有这个from top window,搞得一头雾水,请楼主介绍清楚
都不知道这个写对了不
unfortunately, not yet
Method1:
As opening a page from asp, pls add some parameters to indicate whether current sub-page is made up of framesets or not. And then set target according to the parameters.Method2:
Use js in asp page to handle link-click event of sub-page.
ref:
http://community.csdn.net/Expert/TopicView3.asp?id=4967911you implement the link-click event in parent page, and submit them from sub-page.
I just start to learn javascript.What's your sentence mean?"Use js in asp page to handle link-click event of sub-page.""you implement the link-click event in parent page, and submit them from sub-page."is this two sentence conflict?The "sub-page" you mention here is a .net page, and all my links is on this page.
//Add js function in parent page
<script language="javascript">
function LinkClicked( strURL )
{
window.location.href=strURL;
}
</script>//in sub-page
<script language="javascript">
function LinkClicked( strURL )
{
window.parent.LinkClicked( strURL );
}
</script>
<!--
Add link as follows
By the way, you can created URL parameter in server-side for function named "LinkClicked"
-->
<asp:HyperLink ID="lnkParentURL" runat="server" NavigateUrl="#" onclick="LinkClicked('http://www.google.com')">MyTest</asp:HyperLink>
I may control target = "_parent", but it can only open in current window, not in parent window.
To Knight94(愚翁),My current window is .net code, my links is bound to GridView, not asp code.<asp:HyperLink ID="hyperLinkResult" runat="server" Text='<%# getSubString(Eval("resultName").ToString()) %>' NavigateUrl='<%# String.Format(Eval("resultUrl").ToString(), Eval("resultName"))%>' Target='<%# getTargetString(Eval("resultUrl").ToString()) %>' />
protected string getTargetString(string rstUrl)
{
string targetStr = "aaa";
if (rstUrl.Substring(14, 18) == "repositoryFile.asp")
{
targetStr = "_new";
}
return targetStr;
}
you can't do nothing means you can do anything