Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Hyperlink Control

Reply
Thread Tools

Hyperlink Control

 
 
=?Utf-8?B?c2NrMTA=?=
Guest
Posts: n/a
 
      10-21-2004
Hello,

Can you control the window attributes (toolbar, scrollbars, left and right
exc.) when using the hyperlink control as you would when using javascript?

For examle, I am using the following javascript to open another window and
would like to control these attributes with the hyperlink control:
window.open(msgSubmitterInfo,t,s);return false"
var s="toolbar=no,directories=no,scrollbars=yes,resiza ble=yes,";
s+= "left=200,top=100,width=500,height=400";

--
Thanks in advance,
sck10
 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      10-21-2004
Those aren't attributes; they're parameters, which are passed to the
JavaScript window.open() method. Now, you certainly CAN make the URL of a
hyperlink point to a JavaScript method call:

<a href="javascript:window.open(...)">Click Here</a>

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"sck10" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> Can you control the window attributes (toolbar, scrollbars, left and right
> exc.) when using the hyperlink control as you would when using javascript?
>
> For examle, I am using the following javascript to open another window and
> would like to control these attributes with the hyperlink control:
> window.open(msgSubmitterInfo,t,s);return false"
> var s="toolbar=no,directories=no,scrollbars=yes,resiza ble=yes,";
> s+= "left=200,top=100,width=500,height=400";
>
> --
> Thanks in advance,
> sck10



 
Reply With Quote
 
 
 
 
=?Utf-8?B?QmlsbCBCb3Jn?=
Guest
Posts: n/a
 
      10-21-2004
Kevin, along these lines, is there any other way to insert code into an href
without using the "javascript:"? I am allowing users to define certain links
in my system, and want to make sure I filter out anything that might be
malicious. Thanks.

"Kevin Spencer" wrote:

> Those aren't attributes; they're parameters, which are passed to the
> JavaScript window.open() method. Now, you certainly CAN make the URL of a
> hyperlink point to a JavaScript method call:
>
> <a href="javascript:window.open(...)">Click Here</a>
>
> --
> HTH,
> Kevin Spencer
> ..Net Developer
> Microsoft MVP
> I get paid good money to
> solve puzzles for a living
>
> "sck10" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hello,
> >
> > Can you control the window attributes (toolbar, scrollbars, left and right
> > exc.) when using the hyperlink control as you would when using javascript?
> >
> > For examle, I am using the following javascript to open another window and
> > would like to control these attributes with the hyperlink control:
> > window.open(msgSubmitterInfo,t,s);return false"
> > var s="toolbar=no,directories=no,scrollbars=yes,resiza ble=yes,";
> > s+= "left=200,top=100,width=500,height=400";
> >
> > --
> > Thanks in advance,
> > sck10

>
>
>

 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      10-21-2004
> Kevin, along these lines, is there any other way to insert code into an
href
> without using the "javascript:"?


Afraid not, Bill. You'll have to think of a secure way of doing what you
want. If you want JavaScript in hyperlinks, you will get JavaScript in
hyperlinks. The "javascript:" has nothing to do with it, other than
informing the browser that the hyperlink is to a JavaScript function, rather
than to an HTTP URL.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Bill Borg" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Kevin, along these lines, is there any other way to insert code into an

href
> without using the "javascript:"? I am allowing users to define certain

links
> in my system, and want to make sure I filter out anything that might be
> malicious. Thanks.
>
> "Kevin Spencer" wrote:
>
> > Those aren't attributes; they're parameters, which are passed to the
> > JavaScript window.open() method. Now, you certainly CAN make the URL of

a
> > hyperlink point to a JavaScript method call:
> >
> > <a href="javascript:window.open(...)">Click Here</a>
> >
> > --
> > HTH,
> > Kevin Spencer
> > ..Net Developer
> > Microsoft MVP
> > I get paid good money to
> > solve puzzles for a living
> >
> > "sck10" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Hello,
> > >
> > > Can you control the window attributes (toolbar, scrollbars, left and

right
> > > exc.) when using the hyperlink control as you would when using

javascript?
> > >
> > > For examle, I am using the following javascript to open another window

and
> > > would like to control these attributes with the hyperlink control:
> > > window.open(msgSubmitterInfo,t,s);return false"
> > > var s="toolbar=no,directories=no,scrollbars=yes,resiza ble=yes,";
> > > s+= "left=200,top=100,width=500,height=400";
> > >
> > > --
> > > Thanks in advance,
> > > sck10

> >
> >
> >



 
Reply With Quote
 
=?Utf-8?B?QmlsbCBCb3Jn?=
Guest
Posts: n/a
 
      10-21-2004
If I understand you right, I think that's a good thing. Aren't you saying
that if the "javascript:" is not there the browser won't try to "run" it, in
which case I can just exclude any user-defined links that include
"javascript" (e.g. I just remove the word and let the browser give a 404 when
somebody clicks on that "link")?

"Kevin Spencer" wrote:

> > Kevin, along these lines, is there any other way to insert code into an

> href
> > without using the "javascript:"?

>
> Afraid not, Bill. You'll have to think of a secure way of doing what you
> want. If you want JavaScript in hyperlinks, you will get JavaScript in
> hyperlinks. The "javascript:" has nothing to do with it, other than
> informing the browser that the hyperlink is to a JavaScript function, rather
> than to an HTTP URL.
>
> --
> HTH,
> Kevin Spencer
> ..Net Developer
> Microsoft MVP
> I get paid good money to
> solve puzzles for a living
>
> "Bill Borg" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Kevin, along these lines, is there any other way to insert code into an

> href
> > without using the "javascript:"? I am allowing users to define certain

> links
> > in my system, and want to make sure I filter out anything that might be
> > malicious. Thanks.
> >
> > "Kevin Spencer" wrote:
> >
> > > Those aren't attributes; they're parameters, which are passed to the
> > > JavaScript window.open() method. Now, you certainly CAN make the URL of

> a
> > > hyperlink point to a JavaScript method call:
> > >
> > > <a href="javascript:window.open(...)">Click Here</a>
> > >
> > > --
> > > HTH,
> > > Kevin Spencer
> > > ..Net Developer
> > > Microsoft MVP
> > > I get paid good money to
> > > solve puzzles for a living
> > >
> > > "sck10" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > Hello,
> > > >
> > > > Can you control the window attributes (toolbar, scrollbars, left and

> right
> > > > exc.) when using the hyperlink control as you would when using

> javascript?
> > > >
> > > > For examle, I am using the following javascript to open another window

> and
> > > > would like to control these attributes with the hyperlink control:
> > > > window.open(msgSubmitterInfo,t,s);return false"
> > > > var s="toolbar=no,directories=no,scrollbars=yes,resiza ble=yes,";
> > > > s+= "left=200,top=100,width=500,height=400";
> > > >
> > > > --
> > > > Thanks in advance,
> > > > sck10
> > >
> > >
> > >

>
>
>

 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      10-21-2004
Hi Bill,

> If I understand you right, I think that's a good thing. Aren't you saying
> that if the "javascript:" is not there the browser won't try to "run" it,

in
> which case I can just exclude any user-defined links that include
> "javascript" (e.g. I just remove the word and let the browser give a 404

when
> somebody clicks on that "link")?


Correct, as long as we're talking about the href of a hyperlink. Make sure
that they can't add any "onclick" attributes, though, as that would be able
to call JavScript without the "javascript:".

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Bill Borg" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If I understand you right, I think that's a good thing. Aren't you saying
> that if the "javascript:" is not there the browser won't try to "run" it,

in
> which case I can just exclude any user-defined links that include
> "javascript" (e.g. I just remove the word and let the browser give a 404

when
> somebody clicks on that "link")?
>
> "Kevin Spencer" wrote:
>
> > > Kevin, along these lines, is there any other way to insert code into

an
> > href
> > > without using the "javascript:"?

> >
> > Afraid not, Bill. You'll have to think of a secure way of doing what you
> > want. If you want JavaScript in hyperlinks, you will get JavaScript in
> > hyperlinks. The "javascript:" has nothing to do with it, other than
> > informing the browser that the hyperlink is to a JavaScript function,

rather
> > than to an HTTP URL.
> >
> > --
> > HTH,
> > Kevin Spencer
> > ..Net Developer
> > Microsoft MVP
> > I get paid good money to
> > solve puzzles for a living
> >
> > "Bill Borg" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Kevin, along these lines, is there any other way to insert code into

an
> > href
> > > without using the "javascript:"? I am allowing users to define certain

> > links
> > > in my system, and want to make sure I filter out anything that might

be
> > > malicious. Thanks.
> > >
> > > "Kevin Spencer" wrote:
> > >
> > > > Those aren't attributes; they're parameters, which are passed to the
> > > > JavaScript window.open() method. Now, you certainly CAN make the URL

of
> > a
> > > > hyperlink point to a JavaScript method call:
> > > >
> > > > <a href="javascript:window.open(...)">Click Here</a>
> > > >
> > > > --
> > > > HTH,
> > > > Kevin Spencer
> > > > ..Net Developer
> > > > Microsoft MVP
> > > > I get paid good money to
> > > > solve puzzles for a living
> > > >
> > > > "sck10" <(E-Mail Removed)> wrote in message
> > > > news:(E-Mail Removed)...
> > > > > Hello,
> > > > >
> > > > > Can you control the window attributes (toolbar, scrollbars, left

and
> > right
> > > > > exc.) when using the hyperlink control as you would when using

> > javascript?
> > > > >
> > > > > For examle, I am using the following javascript to open another

window
> > and
> > > > > would like to control these attributes with the hyperlink control:
> > > > > window.open(msgSubmitterInfo,t,s);return false"
> > > > > var s="toolbar=no,directories=no,scrollbars=yes,resiza ble=yes,";
> > > > > s+= "left=200,top=100,width=500,height=400";
> > > > >
> > > > > --
> > > > > Thanks in advance,
> > > > > sck10
> > > >
> > > >
> > > >

> >
> >
> >



 
Reply With Quote
 
=?Utf-8?B?QmlsbCBCb3Jn?=
Guest
Posts: n/a
 
      10-21-2004
Got it, thanks.

"Kevin Spencer" wrote:

> Hi Bill,
>
> > If I understand you right, I think that's a good thing. Aren't you saying
> > that if the "javascript:" is not there the browser won't try to "run" it,

> in
> > which case I can just exclude any user-defined links that include
> > "javascript" (e.g. I just remove the word and let the browser give a 404

> when
> > somebody clicks on that "link")?

>
> Correct, as long as we're talking about the href of a hyperlink. Make sure
> that they can't add any "onclick" attributes, though, as that would be able
> to call JavScript without the "javascript:".
>
> --
> HTH,
> Kevin Spencer
> ..Net Developer
> Microsoft MVP
> I get paid good money to
> solve puzzles for a living
>
> "Bill Borg" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > If I understand you right, I think that's a good thing. Aren't you saying
> > that if the "javascript:" is not there the browser won't try to "run" it,

> in
> > which case I can just exclude any user-defined links that include
> > "javascript" (e.g. I just remove the word and let the browser give a 404

> when
> > somebody clicks on that "link")?
> >
> > "Kevin Spencer" wrote:
> >
> > > > Kevin, along these lines, is there any other way to insert code into

> an
> > > href
> > > > without using the "javascript:"?
> > >
> > > Afraid not, Bill. You'll have to think of a secure way of doing what you
> > > want. If you want JavaScript in hyperlinks, you will get JavaScript in
> > > hyperlinks. The "javascript:" has nothing to do with it, other than
> > > informing the browser that the hyperlink is to a JavaScript function,

> rather
> > > than to an HTTP URL.
> > >
> > > --
> > > HTH,
> > > Kevin Spencer
> > > ..Net Developer
> > > Microsoft MVP
> > > I get paid good money to
> > > solve puzzles for a living
> > >
> > > "Bill Borg" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > Kevin, along these lines, is there any other way to insert code into

> an
> > > href
> > > > without using the "javascript:"? I am allowing users to define certain
> > > links
> > > > in my system, and want to make sure I filter out anything that might

> be
> > > > malicious. Thanks.
> > > >
> > > > "Kevin Spencer" wrote:
> > > >
> > > > > Those aren't attributes; they're parameters, which are passed to the
> > > > > JavaScript window.open() method. Now, you certainly CAN make the URL

> of
> > > a
> > > > > hyperlink point to a JavaScript method call:
> > > > >
> > > > > <a href="javascript:window.open(...)">Click Here</a>
> > > > >
> > > > > --
> > > > > HTH,
> > > > > Kevin Spencer
> > > > > ..Net Developer
> > > > > Microsoft MVP
> > > > > I get paid good money to
> > > > > solve puzzles for a living
> > > > >
> > > > > "sck10" <(E-Mail Removed)> wrote in message
> > > > > news:(E-Mail Removed)...
> > > > > > Hello,
> > > > > >
> > > > > > Can you control the window attributes (toolbar, scrollbars, left

> and
> > > right
> > > > > > exc.) when using the hyperlink control as you would when using
> > > javascript?
> > > > > >
> > > > > > For examle, I am using the following javascript to open another

> window
> > > and
> > > > > > would like to control these attributes with the hyperlink control:
> > > > > > window.open(msgSubmitterInfo,t,s);return false"
> > > > > > var s="toolbar=no,directories=no,scrollbars=yes,resiza ble=yes,";
> > > > > > s+= "left=200,top=100,width=500,height=400";
> > > > > >
> > > > > > --
> > > > > > Thanks in advance,
> > > > > > sck10
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlink control in user control =?Utf-8?B?Y2dhbWJpbm8=?= ASP .Net 2 03-22-2007 10:19 PM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink davetichenor ASP .Net 1 10-30-2006 02:57 PM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink Dave ASP .Net Datagrid Control 0 10-21-2006 07:48 PM
Dynamically Hyperlink and Event Handler for the Hyperlink ? Ken ASP .Net Datagrid Control 1 08-15-2003 11:38 PM
Get a hyperlink control inside a datalist when databouding Arjen ASP .Net 0 08-04-2003 09:22 PM



Advertisments