1

I got this code in LinkButton Click event

    Session("Factor") = Session("rating")       
    Response.Write("<script>")
    Response.Write("window.open('Resources/Resources.aspx','_blank')")
    Response.Write("</script>")

The reason I need in code behind is because I have to set that session. This opens in new window. But how can I make it open in a new tab? or any alternative approach. Please remember I have to set that session. QueryString not good for me.

Thanks,

J. Steen
  • 15,470
  • 15
  • 56
  • 63
Laurence
  • 7,633
  • 21
  • 78
  • 129

1 Answers1

1

I know this is an old post, but still I want to share it with everybody.

You can use the linkbutton's attribute from code behind. Some thing like this.

On the form load event add this code.

linkbutton.Attributes.Add("onclick", "window.open('http://localhost:50/mailconfirm.htm','NameOfTheWindow','height=400,width=400,status=yes,toolbar=no,menubar=no,location=0,scrollbars=no,left=200,top=200')")

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
arun
  • 11
  • 1
  • 1
    Please do not include 'signatures' in your posts. *Most especially*, do not include your website link in that way, or your posts could be mistaken for spam. I have removed the link and your signature. Keep this in mind for the future. – Andrew Barber Nov 28 '12 at 09:55