Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2006
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PostBackUrl to a new window?

    I am having some difficulties with this. I read somewhere to use this:

    OnClientClick="window.document.forms[0].target='_blank';" PostBackUrl = "/_MembersOnly/MemberProfile/EditProfileRedirect.asp"

    which works great, but when I close EditProfileRedirect.asp and then click on another link on the posting page, it opens the link clicked plus EditProfileRedirect.asp within a new window?

    Any ideas?

  • #2
    Regular Coder
    Join Date
    May 2006
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Your are doing a postback for nothing. No need to do a postback to open a new window, simply use window.open:
    Code:
    OnClientClick="window.open('/_MembersOnly/MemberProfile/EditProfileRedirect.asp','','left=100,top=50,width=400,height=300,scrollbars=1');return false;"

  • #3
    New Coder
    Join Date
    Mar 2006
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by otaku149 View Post
    Your are doing a postback for nothing. No need to do a postback to open a new window, simply use window.open:
    Code:
    OnClientClick="window.open('/_MembersOnly/MemberProfile/EditProfileRedirect.asp','','left=100,top=50,width=400,height=300,scrollbars=1');return false;"

    Thanks for the quick response, but I do indeed have to do a post, because here is the full section:

    <asp:LinkButton ID="agent_profile_lnk" runat="server" CssClass="LinkNormalBold" OnClientClick="window.document.forms[0].target='_blank';" Text="Edit Your Agent Search Profile"></asp:LinkButton><br /> <asp:HiddenField ID="sesMemberId_Hidden" runat="server" />
    <asp:HiddenField ID="KeyToken_Hidden" runat="server"/>
    <asp:HiddenField ID="iBrokerId_Hidden" runat="server" />
    <asp:HiddenField ID="IMSLogin_Hidden" runat="server" />
    <asp:HiddenField ID="UserPWD_Hidden" runat="server" />
    <asp:HiddenField ID="sesIsBroker_Hidden" runat="server" />

    in the codebehind:

    agent_profile_lnk.PostBackUrl = "/_MembersOnly/MemberProfile/EditProfileRedirect.asp"

    As you can see, I have these hidden values that will post to a redirect page, which is a classic asp page, which I then set the request values to session values. I want to avoid passing the parameters via a GET to show the user certain information across the browser.

    Thanks,
    Robert

  • #4
    Regular Coder
    Join Date
    May 2006
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think what you need to do is to refresh the main window once EditProfileRedirect.asp is opened. Try this, add the following javascript code into the onload event of EditProfileRedirect.asp
    Code:
    <body onload="window.opener.self.location.replace(window.opener.self.location.href);">


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •