...

View Full Version : PostBackUrl to a new window?



binici
01-09-2007, 12:12 AM
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?

otaku149
01-09-2007, 12:50 AM
Your are doing a postback for nothing. No need to do a postback to open a new window, simply use window.open:


OnClientClick="window.open('/_MembersOnly/MemberProfile/EditProfileRedirect.asp','','left=100,top=50,width=400,height=300,scrollbars=1');return false;"

binici
01-09-2007, 12:58 AM
Your are doing a postback for nothing. No need to do a postback to open a new window, simply use window.open:


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

otaku149
01-09-2007, 02:59 AM
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


<body onload="window.opener.self.location.replace(window.opener.self.location.href);">



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum