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 betw开发者_StackOverflow中文版een 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 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";
精彩评论