iframe快速提问

时间:2009-11-10 00:28:06

标签: c# asp.net iframe

我使用了以下代码

    

    

<a href="Projects.aspx" target="iframeTab"> Project Management </a> | <a href="ProjectUsers.aspx" target="iframeTab"> Project Users </a> 
 <iframe src="Projects.aspx" id="iframeTab" width="100%" height="768" frameborder="1" scrolling="auto" />

<asp:GridView DataKeyNames="ID" ID="ctrlGrid" runat="server" AutoGenerateColumns="False" OnDataBound="ctrlGrid_DataBound"
    OnRowDeleting="ctrlGrid_RowDeleting" OnRowEditing="ctrlGrid_RowEditing">
    <Columns>
        <asp:BoundField DataField="Name" HeaderText="Name" />
        <asp:BoundField DataField="CompanyName" HeaderText="Company" />
        <asp:HyperLinkField DataNavigateUrlFields="ID" DataNavigateUrlFormatString="~/TimeFilter.aspx?ProjectID={0}" HeaderText="Time" Text="Time" />
        <asp:HyperLinkField DataNavigateUrlFields="ID" DataNavigateUrlFormatString="~/ProjectNotes.aspx?ProjectID={0}" HeaderText="Notes" Text="Notes" />
        <asp:HyperLinkField DataNavigateUrlFields="ID" DataNavigateUrlFormatString="~/ProjectRequirements.aspx?ProjectID={0}" HeaderText="Requirements" Text="Requirements" />
        <asp:CommandField ButtonType="Button" ShowDeleteButton="True" ShowEditButton="True" />
    </Columns>
</asp:GridView>
<br />
<a href="ProjectEdit.aspx">Add new project</a>

iframes部分

项目管理|项目用户      

让标签出现在Project.aspx页面中,但当我点击两个标签中的任何一个时,它似乎没有超链接。 我怎么能纠正这个?

1 个答案:

答案 0 :(得分:0)

只需将Target =“windowname”属性添加到每个超链接即可。如果它们都使用相同的目标,它们将在同一窗口中打开。