javascript popup causing postback on parent. Pls Help!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a web page that is in a master page. The user fills in the page and
at the bottom I have a link for terms which when they click is causing post
back. Here is the code. Is there a way to just have the popup without the
postback? this is in ASP.NET 2.0

HyperLink ID="HyperLink2" runat="server"
NavigateUrl="javascript:location=location;window.open('iTerms.aspx','NMO','height=400,width=400,scrollbars=Yes,resizable=Yes')"
EnableViewState="False">Termsr</HyperLink>


Thank you in advance.
 
The hyperlink that you wrote down there does not cause a postback. However,
the aspx that was opened in the new window would display the blue-color
progress indicator on the status bar until the page named ('iTerms.aspx')
finished loading, but the page where the link is has not posted back to the
server.
 
No, it is definately posting back on the parent. is it because I am using
asp:hyperlink? The new window does a load and that is ok. The parent page
reloads and refreshes all the controls. thanks for you help.
 
I'm sorry, I don't mean a post back. I mean a refresh. I'm sorry for not
being more clear. I stepped through and postback is false but refresh and
reload is what is happening.

Thank you
 
Yes, you are right. It is the JavaScript syntax that you typed there that is
incorrect. You should not put location=location; because this instructs the
document to reload itself. Here is the correct syntax:

NavigateUrl="javascript:var
temp=window.open('iTerms.aspx','_blank','height=400,width=400,scrollbars=Yes,resizable=Yes');"
 
Back
Top