1

the following Hyperlink is in the popup written in C#.

var hypLink = new HyperLink
{
    Text = "Order Nummer",
    NavigateUrl = "~/Order.Page.aspx?OrderID=00001001"
};

The above code is redirecting the Order.Page.aspx inside the popup.

But I am trying, When user clicks on the hyperlink:

  1. the popup should close.
  2. redirect to the NavigateUrl ~/Order.Page.aspx?OrderID=00001001
SinisterMJ
  • 3,425
  • 2
  • 33
  • 53
darma
  • 25
  • 5

1 Answers1

0

One of the options you have is using javascript code. You add your window that you want to close in my_window variable, and with custom method closepopup() you can close your popup window.

<script type="text/javascript">


   my_window = window.open("", "mywindow","status=1,width=350,height=150");

   function closepopup()
   {
      if(false == my_window.closed)
      {
         my_window.close ();
      }
      else
      {
         alert('Window already closed!');
      }
   }
</script>

<body>
   <p>
      <a href="javascript: closepopup()">Close the Popup Window</a>
   </p>
</body>

Another option is to try this attribute that Hyperlink has:

var hypLink = new HyperLink
{
    Text = "Order Nummer",
    NavigateUrl = "~/Order.Page.aspx?OrderID=00001001"
};

    hypLink.Attributes.Add("onclick", "window.close()")
Annotex
  • 1
  • 3