Click here to Skip to main content
15,920,801 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i am working with chat appliation . where multiple users available.

when i click on user page is working properly but
when i right click and try to open page in new tab then it's open
about:blank

what is the problem i dont know .!!


In inspect element my user is showing like

<a id="ContentPlaceHolder1_RoomListView_room_5" class="user" target="_blank" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$RoomListView$ctrl6$room','')">dhrumil pate...</a>



when i

What I have tried:

<asp:LinkButton runat="server"
ID='room'
CssClass='<%# Eval("IsGroup").ToString()=="False"?"user":"group" %>'
Text='<%#Eval("Name").ToString().Length > 12 ? Eval("Name").ToString().PadRight(12).Substring(0,12).TrimEnd()+"..." : Eval("Name").ToString().PadRight(12).Substring(0,12).TrimEnd() %>'
CommandName='<%# Eval("IsGroup").ToString()=="False"?"User":"Group" %>'
CommandArgument='<%# Eval("RC_ID")+","+Eval("Username") %>'

/>
Posted
Comments
ZurdoDev 2-Oct-17 9:09am    
Because your link does not link to a page. What do you expect to happen when opening in new tab?
Jaydeep Shah 2-Oct-17 10:02am    
suppose you want to chat with 4 member and want to open ever user to every tab.
but flow is working in only one tab.
when i open in new tab it's about:blank.
when left click on user it's server side call goes and thire i append dynamic link
but when user right click and try to opne in new tab this server side call is not go.and just new window open which showing me about: blank.

i dont no why this not working.
Karthik_Mahalingam 3-Oct-17 1:02am    
use  Reply  button, to post Comments/query to the user, so that the user gets notified and responds to your text.
Jaydeep Shah 3-Oct-17 6:15am    
OK sure. :)
but can you give me above my question answer ??!

main problem i see this like mouce left click serverside call goes . but on right cilck and open in new tab .. that time server side call not happend.

serverside i use

ScriptManager.RegisterStartupScript(this, this.GetType(), "ChangeURL", "ChangeURL('" + HttpContext.Current.Handler + "','" + Name + "');", true);

and client side i change url

function ChangeURL(page, name) {
var kl = location.href.lastIndexOf("/");
if (typeof (history.pushState) != "undefined") {
var obj = { Page: page, Url: location.href.substr(0, kl + 1) + name };
history.pushState(obj, obj.Page, obj.Url);
$('.msgText').emojiPicker();
} else {
alert("Browser does not support HTML5.");
}
}

but this work only for left click.
Karthik_Mahalingam 3-Oct-17 6:48am    
if href contains a property url then right click new tab will work as expected

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