linklabel, javascript and C Sharp

N

Nick P

Is it possible to use javascript within a link label link in C#?

I want to call up a web page from a link label but without any scroll
bars and have it a certain size. I am trying to use the
javascript:window.open

this.lbtnArrangeColumns.Links[0].LinkData =
"javascript:window.open('http://localhost/Test.aspx','access','width=600px,height=550px,scrollbars=no')";

private void Test(object sender,
System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{

System.Diagnostics.Process.Start(e.Link.LinkData.ToString());
}

However it opens a browser window with [Object] in it and then opens
my smaller custom window. Can any one tell me how to prevent it
opening the first browser window.

Thanks,

np
 
N

Nick P

I have tried this for some of my links, unfortuantely there is a piece
of functionality where I need process start to open the small window
as no link label is used.

Also were you able to superimpose the hyperlink over the winform
control so that it looks like it is part of the winform? I tried
messing about with Z-index but no good the winform is always in the
foreground so you can't see the hyperlink

Thanks in Advance,

Nick

Sunil TG said:
I too had the same problem. What i did to solve this
problem is, i deleted the server side linklabel, and
placed an ordinary hyperlink, and wrote javascript in the
aspx file, which nicely opened the smaller window.
-----Original Message-----
Is it possible to use javascript within a link label link in C#?

I want to call up a web page from a link label but without any scroll
bars and have it a certain size. I am trying to use the
javascript:window.open

this.lbtnArrangeColumns.Links[0].LinkData =
"javascript:window.open ('http://localhost/Test.aspx','access','width=600px,height=
550px,scrollbars=no')";

private void Test(object sender,
System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{

System.Diagnostics.Process.Start (e.Link.LinkData.ToString());
}

However it opens a browser window with [Object] in it and then opens
my smaller custom window. Can any one tell me how to prevent it
opening the first browser window.

Thanks,

np
.
 

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

Top