Why Join
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
MonthlyLeaders
ASK A QUESTION
Forumguidelines
suresh
0
168
0
How to Open new tab when we click on LinkButton
Oct 9 2012 2:25 PM
Hi,
i am getting value from database and assigned to that LinkButton.
When i clicked that link button, it should open in new tab insted of new window.
<asp:LinkButton runat="server" ID="blCompurl" OnClick="OpenCompUrl"
CssClass="BodyLink2"></asp:LinkButton>
blCompurl.Text="http://www.google.com"
protected void OpenCompUrl(Object sendder, EventArgs e)
{
LinkButton btnComp = (LinkButton)sendder;
String Url = btnComp.Text;
//ScriptManager.RegisterStartupScript(this,this.GetType(), "Open", "window.open('" + Url + "');", true);
Response.Write("<script language='javascript'>window.open('" + Url + "','_blank','');");
Response.Write("</scr" + "ipt>");
}
it's opening in new window.
Reply
Answers (
4
)
Find Browser close event using C# / jquery
How to open exisiting word document from asp.net