Open a new window and set session variable?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi, all:

I have a linkbutton and I use javascript to open another webpage in a
new window. I also want to set my session variable value when this
linkbutton get clicked. These session variable is used in the the
webpage that in the new window. I do not want pass these variables as
parameters to the web page. Can I let the linkbutton execute postback
to set the session variable's value and also execute client javascript
to open a new window? I tried but get no luck. Or you have a better
idea to achieve this?


following is my code
<script language="javascript">
function NewWindow(strUrl){
var win = window.open(strUrl, null, 'height=600,width=1024,status=no,
toolbar=no,menubar=no,location=no');
}
</script>
<asp:linkbutton id="lbnPrint" runat="server" CssClass="NormalLinkSmall"
Print</asp:linkbutton>

code behind
lbnPrint.Attributes.Add("onClick","NewWindow('print.aspx)");





Thanks a lot
-rockdale

.



Relevant Pages

  • about onclientclick and postback
    ... I need to use a linkbutton to open a new window (it has to be a linkbutton ... OnClientClick property and insert some javascript into it. ... Does any body knows how to disable the postback behavior? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: about onclientclick and postback
    ... I figured out already...instead of a linkbutton I used a server hyperlink ... also added the real javascript to the attributes property. ... doesnt cause a postback. ... > client javascript to open a new window. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: about onclientclick and postback
    ... >I figured out already...instead of a linkbutton I used a server hyperlink ... also added the real javascript to the attributes property. ... >> works fine but I dont want the button to cause a postback since all I ... >> need is a client javascript to open a new window. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Opening a new window
    ... This is all still client side javascript. ... > How do I open a new window (webpage) without closing the current webpage ... The new window will be smaller and centered on the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: how to know whether the webpage is the top active IE window with javascript code
    ... I need to know whether the webpage is the top active IE window ... with javascript in the webpage,when I open 2 or more IE window. ... figuring out which window is the active topmost on a user's computer can probably be figured out using window.onfocusor document.onfocus. ...
    (comp.lang.javascript)