In that case, I'm not quite sure what you're trying to accomplish.
"_new" does not have a special meaning as a value for the Target
property, so I doubt that will affect the behavior of your HyperLink.
And you're trying to "execute" it from code, does that mean redirect the
browser to the NavigateURL of the HyperLink? If you want to do that, try
this
Reponse.Redirect(yourHyperLink.NavigateURL);
If that's not what you intend to do, please be more specific.
- John
I want to switch to Page2.aspx using a response.redirect but I want
Page2.aspx to display in a New Browser Window. If I simply execute
response.redirect(page2.aspx) it will display in the same browser window.
If I have a hyperlink added at design time and specify '_new' in the target
property it will pop up a new window when that hyperlink is clicked by the
user. But if I try to execute that hyperlink from code by doing
response.redirect(myHyperlink.NavigateURL) it simply uses that string and
doesn't really execute the hyperlink in the web page (that has Target='_new'
in it).
G
I want to switch to Page2.aspx using a response.redirect but I want
Page2.aspx to display in a New Browser Window. If I simply execute
response.redirect(page2.aspx) it will display in the same browser window.
If I have a hyperlink added at design time and specify '_new' in the target
property it will pop up a new window when that hyperlink is clicked by the
user. But if I try to execute that hyperlink from code by doing
response.redirect(myHyperlink.NavigateURL) it simply uses that string and
doesn't really execute the hyperlink in the web page (that has Target='_new'
in it).
G
Ok, now I understand. I don't know if you can get the behavior you're
looking for without a hack. Here's what I've done when faced with the
same problem. Write an onload javascript function for your page's body
element. That onload function should check an hidden HTML input for a
URL value and, if one is found, popup a window with that URL in it. That
hidden variable should also have "runat=server" specified. When you want
to popup the window from server-side code, set the hidden form variable
to the url you want to popup, and the onload function will do the dirty
work for you.
- John
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.