Click here to Skip to main content
15,922,533 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to open the external link on the body of the page without going to new tab
I tried target (blank.self, parent) which are for opening a new tab. however. I need to specify tag such div or any thing to display the page when the link is clicked from the menu.


please help
thank you

What I have tried:

this the link
External Links



this the body of the page between section (main-content)




<!--COMPLETED ACTIONS DONUTS CHART-->



Recent Comments on lectures


<!-- First Action -->
<asp:DataList ID="dlIdea" DataSourceID="SqlDataSource2" runat="server"
Width="100%" HorizontalAlign="Left" CellPadding="2">

<itemtemplate>



<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT TOP(5) t1.IssueDate, t1.comment, t2.*, t3.MName,t4.*,t5.* FROM [Comments] AS t1 INNER JOIN [Material] AS t2 ON t2.MaId=t1.MaID INNER JOIN [Modules] AS t3
ON t3.MId=t2.MID INNER JOIN [ModuleRelation] AS t4 ON t4.MId=t3.MId INNER JOIN [Users] AS t5 ON t5.UniID=t4.UId WHERE (t5.[UniID] = @UId) ORDER BY t1.[IssueDate] DESC">
<SelectParameters>
<asp:SessionParameter SessionField="UniID" Name="UId" Type="String">
</SelectParameters>





Posted
Updated 23-Aug-16 4:32am

1 solution

It's "_self" to open the link in the same tab

HTML DOM Anchor target Property[^]

or just leave out the "target" altogether and it'll default to _self. If you're asking how you can open the link in a div, then you can't. If the target is on your own site you could use something like jQuery's ajax.load

.load() | jQuery API Documentation[^]

That will only work if the html is suitable for embedding in another page, ie that is not a whole page with html and body, and that the css is needs is supported etc etc.

Your other alternative is to use an iframe and load your target page in that.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900