Reputation: 85
I need to help about this issue, I have code inside asp.net page like;
for (int i = 0; i < lbl; i++)
{
HyperLink lnkBtn = new HyperLink();
lnkBtn.CssClass = "btn";
lnkBtn.Text = "WEB PAGE NAME";
lnkBtn.NavigateUrl = "URL OF DESİRED PAGES";
lnkBtn.Target = "myFrame";
LiteralControl linebreak = new LiteralControl("<br />");
placeholder.Controls.Add(lnkBtn);
placeholder.Controls.Add(linebreak);
}
I'm adding the hyperlink as button to the webpage, datas coming from database. I want to do the same thing windows form application.
I found "linklabel" but I need to target it to the browser on the application. I used webkitbrowser to display pages.
Any suggestion ?
Upvotes: 2
Views: 3233
Reputation: 15569
Handle the LinkClicked event in your WinForms code and perform whatever custom navigation from there.
Your handler would look something like this (assuming browser
is some sort of browser control also on the Form and the Tag
property of the link held the full Uri of the target)
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
browser.Navigate(e.Link.Tag.ToString());
}
Upvotes: 2
Reputation: 854
Link button is just a button styled as link. Put LinkButton component on form, open events and search for click event, double click on it. In generated method write:
System.Diagnostics.Process.Start("http://www.website.com");
Upvotes: 1
Reputation: 724
You can:
Upvotes: 1