Open new tab on HTML Anchor link click

Last Reply one year ago By dharmendr

Posted one year ago

I have this code beloq i use to open a profile in another pge by clicking the link, but i want it to open in a new tab instead of the current tab

<a class="" href='<%#getUserHREF1(Container.DataItem)%>' >
    <img src='<%#getSRC(Container.DataItem)%>' class=" img-circle animated fadeInDown" style="width:45px; height:45px" />


public string getSRC(object sURL)
    DataRowView dRView = (DataRowView)sURL;
    string Id = dRView["UserName"].ToString();
    return ResolveUrl("~/MyProfile.aspx?Id=" + Id);
Posted one year ago

Hi micah,

To open in new tab you should add the target attribute in the anchor tag with the value _blank.

Refer below example.

<a class="" target="_blank" href=''>
    <img src="" class="img-circle animated fadeInDown"
        style="width: 45px; height: 45px" />