hyperlink function in a normal button

G

Guest

Hi,

I want to simply add hyperlink functionality to a normal web control button.
I understand that i can use the hyperlink button for this but in this case i
dont want to do this.

Say i have a webcontrol button on the webform. within the onclick function
how would i hyperlink to a new aspx page in the same virtual directory? Is it
something to do with href? I dont wanna use the full hyperlink
(http://www.google.com.au/) but i want to just specify the .aspx page because
its in the same virtual directory....

I am developing a web app in asp.net using code behind and vb server and
client code.
 
H

Hermit Dave

well this is what you do

either
1. add onclick on the button which opens the relative url using javascript

or

2. on server side click handler. do a
Response.Redirect("virtualdir/newfile.aspx") // something like this

3. on server side click handler. do a
Server.Transfer("virtualdir/newfile.aspx")

response.redirect does a round trip to the client before reaching the
destination. server.transfer on the other than goes straight across.
but in this case client has no information on transfer and if the client
press F5 or refresh from the newpage would still be taken back to old page.

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top