By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,301 Members | 1,752 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,301 IT Pros & Developers. It's quick & easy.

executing a hyperlink

P: n/a
I have a hyperlink on my aspx page added at dev time. Is there a way to
execute it from code?
Thanks,
G
Nov 18 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
G. Dean Blake wrote:
I have a hyperlink on my aspx page added at dev time. Is there a way to
execute it from code?
Thanks,
G


Response.Redirect( <yourLinkHere> );
Nov 18 '05 #2

P: n/a
"it" means the hyperlink control on my page(which has target='_new'), not
just a url.

"John Hann" <jovinhan@SPAM_FREEyahoo.com> wrote in message
news:JZ********************@comcast.com...
G. Dean Blake wrote:
I have a hyperlink on my aspx page added at dev time. Is there a way to
execute it from code?
Thanks,
G


Response.Redirect( <yourLinkHere> );

Nov 18 '05 #3

P: n/a
G. Dean Blake wrote:
"it" means the hyperlink control on my page(which has target='_new'), not
just a url.

"John Hann" <jovinhan@SPAM_FREEyahoo.com> wrote in message
news:JZ********************@comcast.com...
G. Dean Blake wrote:

I have a hyperlink on my aspx page added at dev time. Is there a way to
execute it from code?
Thanks,
G


Response.Redirect( <yourLinkHere> );



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
Nov 18 '05 #4

P: n/a
What I am trying to do is....

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
"John Hann" <jovinhan@SPAM_FREEyahoo.com> wrote in message
news:ez**************@TK2MSFTNGP12.phx.gbl...
G. Dean Blake wrote:
"it" means the hyperlink control on my page(which has target='_new'), not just a url.

"John Hann" <jovinhan@SPAM_FREEyahoo.com> wrote in message
news:JZ********************@comcast.com...
G. Dean Blake wrote:
I have a hyperlink on my aspx page added at dev time. Is there a way toexecute it from code?
Thanks,
G

Response.Redirect( <yourLinkHere> );



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

Nov 18 '05 #5

P: n/a
G. Dean Blake wrote:
What I am trying to do is....

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
Nov 18 '05 #6

P: n/a
while you can write javascript to do this, popup blockers will stop you.
"G. Dean Blake" <De**@nospam.com> wrote in message
news:Oi**************@TK2MSFTNGP12.phx.gbl...
"it" means the hyperlink control on my page(which has target='_new'), not
just a url.

"John Hann" <jovinhan@SPAM_FREEyahoo.com> wrote in message
news:JZ********************@comcast.com...
G. Dean Blake wrote:
I have a hyperlink on my aspx page added at dev time. Is there a way to execute it from code?
Thanks,
G


Response.Redirect( <yourLinkHere> );


Nov 18 '05 #7

P: n/a


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.