We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

is there a winow.open option for a hyperlink in a table?

jm76
jm76 asked
on
Medium Priority
324 Views
Last Modified: 2010-04-17
Hi,

I have a table on FORM1 and one column in the table is a hyperlink. I want the hyperlink to go to another page when clicked, but when the new page closes I would like the Form1 to show again.  Does that make sense, kind of how window.open works?  Below is the hyperlink column in my code.  It's in asp.net/VB

 <asp:TemplateColumn HeaderText="Name">

                                    <ItemTemplate>
                                     <asp:Hyperlink id="Hyperlink1"                              
                                     NavigateUrl="http://localhost/IDMD/PPDDetailForm.aspx"
                                     Text='<%# DataBinder.Eval(Container.DataItem, "name") %>'
                                     
                                     Runat=server />                                

                                    </ItemTemplate>

                        </asp:TemplateColumn>
Comment
Watch Question

why not use window.open to get the new page in the first place?  You could then reference the opening page with window.opener on close to place focus on the opener again : ).

...if you don't want a postback:  

<asp:Hyperlink id="Hyperlink1" NavigateUrl="javascript:OpenWindow()" ...etc

<script language=javascript>
     function OpenWindow()
     {
          detail_form = window.open('idmd/ppddetailform.aspx', 'detail_form');
          detail_form.focus();
      }
</script>

...or you can do the same thing from codebehind, if you don't mind a postback.  just change the link to a button (or linkbutton) and place the following within the button's click routine:

RegisterClientScriptBlock("detailWindow", "<script language='javascript'>detail_form = window.open('idmd/ppddetailform.aspx', 'detail_form'); detail_form.focus(); </script>")

...and then in the other form, something like:

<script language="Javascript">
     function OnClose()
     {
          window.opener.focus()
          window.close();
     }
</script>

wil

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.