views:

286

answers:

1

As you all know, HyperLink have a navigateURL property and whenever you click on a hyperlink you'll redirect to link destination, it is ok.

So LinkButton in visual cases are same as Hyperlink but it have not a navigateURL property and instead you can redirect user by using Response.Redirect on OnClick event of LinkButton,

the differet between thee mehods are that HyperLink has the ability to open the destinatio URL on a new browser tab or a new page, but linkButton just redirect user in current open window.

you can open a window by window.opn with javascript butall I need is use a HyperLink that generate his destination URL by a composition of user selected Items ( this is not possible with hyper link but is available with LinkButton)

any Idea to generate NavigatURL whenever User clicks on the link not staticly before selecting Items

A: 

Hey,

A link button can trigger a redirect when its clicked by doing Response.Redirect(""); you can store the URL to redirect to as the command argument of the button... A hyperlink is a link, and you can handle client-side clicks, but easiest may be to create your own links... I'm not sure what the final solution you are looking for is?

Do you want to be able to process the click on the server and then redirect? How do you generate the URL? You can always change the href of a link in JS by doing:

var a = document.getElementById("linkid");
a.href = "http://hewlink.com";
Brian
Dear Brian, as you mentioned reading box items with javascript and assign them to navigateURL of links is a solution but its not good for us and it is a time costly solution. we are looking for another solution. like a extension Methos or vice versa.
Nasser Hadjloo
OK, I'm not sure what you mean by "I need is use a HyperLink that generate his destination URL by a composition of user selected Items"? If you could elaborate on this, I can update my post with some more detailed info.
Brian