LinkButton without Javascript???

D

domtam

First of all, my ASP.NET application has to support browser with
Javascript disabled. In the application There is a control that looks
like a text hyperlink, but the server-side has to do some-processing
when the control is clicked. In other words, it has to generate a
postback.

I'd like to use a <asp:LinkButton> to do this control because it looks
like a text hyperlink and it generates postback for server-side
processing. However, I just realize that its implementation depends on
Javascript. So, it won't work if users disable Javascript on their
browser.

Obviously, <asp:HyperLink> won't work either because it doesn't
generate postback for server-side processing.

Does <asp:Button> provide any formatting property such that it can be
rendered like a text hyperlink?

Another alternative is to use <asp:ImageButton> and create an image
that looks like a text hyperlink. However, is it true that this
approach won't work in Mozilla / Netscape when Javascript is disabled?

Do I have any other alternatives? How about 3rd party control?
Thanks
Dom
 
B

bruce barker

if you need to support all browsers with client script off, then you can use
<asp:button> safely.

currently .net has a bug where <asp:image> will not work in non ie browsers
if the keyboard is used instead of the mouse for the submit. (they look for
the x and y values which are not sent without a mouse click ).

you can use <input type=image src="myimage.gif" value="submit"
name="myImage"> and dispatch the event your self by checking if the image
did a postback.

-- bruce (sqlwork.com)

| First of all, my ASP.NET application has to support browser with
| Javascript disabled. In the application There is a control that looks
| like a text hyperlink, but the server-side has to do some-processing
| when the control is clicked. In other words, it has to generate a
| postback.
|
| I'd like to use a <asp:LinkButton> to do this control because it looks
| like a text hyperlink and it generates postback for server-side
| processing. However, I just realize that its implementation depends on
| Javascript. So, it won't work if users disable Javascript on their
| browser.
|
| Obviously, <asp:HyperLink> won't work either because it doesn't
| generate postback for server-side processing.
|
| Does <asp:Button> provide any formatting property such that it can be
| rendered like a text hyperlink?
|
| Another alternative is to use <asp:ImageButton> and create an image
| that looks like a text hyperlink. However, is it true that this
| approach won't work in Mozilla / Netscape when Javascript is disabled?
|
| Do I have any other alternatives? How about 3rd party control?
| Thanks
| Dom
|
 
D

domtam

Thank you, bruce. Please see below....



bruce said:
if you need to support all browsers with client script off, then you can use
<asp:button> safely.

If I want to use <asp:button>, how can I make it render like a text
hyperlink (instead of a button-like style)? Is there such a property
/attribute that I can set?
currently .net has a bug where <asp:image> will not work in non ie browsers
if the keyboard is used instead of the mouse for the submit. (they look for
the x and y values which are not sent without a mouse click ).

you can use <input type=image src="myimage.gif" value="submit"
name="myImage"> and dispatch the event your self by checking if the image
did a postback.


Could you please elaborate a bit on how to dispatch the event to do the
postback? (Any reference on MSDN on how to do it?)

Thanks
Dom
 
D

David Jessee

this is close...you'll want to play with it a little.....

<style>
..linkLookingButton {
background-color: #FFFFFF;
border: 0px solid;
color: #0000FF;
text-decoration: underline;
cursor:hand
}
</style>

this make a regular button....set its CssClass property to
"linkLookingButton"
 
J

Jens Ansorg

David said:
this is close...you'll want to play with it a little.....

<style>
.linkLookingButton {
background-color: #FFFFFF;
border: 0px solid;
color: #0000FF;
text-decoration: underline;
cursor:hand
}
</style>

make that

cursor:pointer;

to be correct and have it working in non-IE Browsers



Jens
 
D

Dominic

That's great.....but the underline and the hand-cursor do not appear
in Opera 7. Any idea on how to fix this one?

Thanks
Dominic
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top