LinkButton without Javascript???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • domtam@hotmail.com

    LinkButton without Javascript???

    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:HyperLin k> 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:ImageButto n> 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

  • bruce barker

    #2
    Re: LinkButton without Javascript???

    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.gi f" value="submit"
    name="myImage"> and dispatch the event your self by checking if the image
    did a postback.

    -- bruce (sqlwork.com)

    <domtam@hotmail .com> wrote in message
    news:1106609169 .116912.58130@z 14g2000cwz.goog legroups.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:HyperLin k> 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:ImageButto n> 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
    |


    Comment

    • domtam@hotmail.com

      #3
      Re: LinkButton without Javascript???

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



      bruce barker wrote:[color=blue]
      > if you need to support all browsers with client script off, then you[/color]
      can use[color=blue]
      > <asp:button> safely.[/color]

      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?
      [color=blue]
      >
      > currently .net has a bug where <asp:image> will not work in non ie[/color]
      browsers[color=blue]
      > if the keyboard is used instead of the mouse for the submit. (they[/color]
      look for[color=blue]
      > the x and y values which are not sent without a mouse click ).
      >
      > you can use <input type=image src="myimage.gi f" value="submit"
      > name="myImage"> and dispatch the event your self by checking if the[/color]
      image[color=blue]
      > did a postback.
      >[/color]


      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[color=blue]
      > -- bruce (sqlwork.com)
      >
      > <domtam@hotmail .com> wrote in message
      > news:1106609169 .116912.58130@z 14g2000cwz.goog legroups.com...
      > | First of all, my ASP.NET application has to support browser with
      > | Javascript disabled. In the application There is a control that[/color]
      looks[color=blue]
      > | like a text hyperlink, but the server-side has to do[/color]
      some-processing[color=blue]
      > | 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[/color]
      looks[color=blue]
      > | like a text hyperlink and it generates postback for server-side
      > | processing. However, I just realize that its implementation depends[/color]
      on[color=blue]
      > | Javascript. So, it won't work if users disable Javascript on their
      > | browser.
      > |
      > | Obviously, <asp:HyperLin k> 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[/color]
      be[color=blue]
      > | rendered like a text hyperlink?
      > |
      > | Another alternative is to use <asp:ImageButto n> 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[/color]
      disabled?[color=blue]
      > |
      > | Do I have any other alternatives? How about 3rd party control?
      > | Thanks
      > | Dom
      > |[/color]

      Comment

      • David Jessee

        #4
        Re: LinkButton without Javascript???

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

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

        this make a regular button....set its CssClass property to
        "linkLookingBut ton"

        <domtam@hotmail .com> wrote in message
        news:1106609169 .116912.58130@z 14g2000cwz.goog legroups.com...[color=blue]
        > 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:HyperLin k> 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:ImageButto n> 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
        >[/color]


        Comment

        • Jens Ansorg

          #5
          Re: LinkButton without Javascript???

          David Jessee wrote:[color=blue]
          > this is close...you'll want to play with it a little.....
          >
          > <style>
          > .linkLookingBut ton {
          > background-color: #FFFFFF;
          > border: 0px solid;
          > color: #0000FF;
          > text-decoration: underline;
          > cursor:hand
          > }
          > </style>
          >[/color]

          make that

          cursor:pointer;

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



          Jens

          Comment

          • Dominic

            #6
            Re: LinkButton without Javascript???

            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

            Jens Ansorg <jens@ja-web.de> wrote in message news:<e50xpV8AF HA.3492@TK2MSFT NGP12.phx.gbl>. ..[color=blue]
            > David Jessee wrote:[color=green]
            > > this is close...you'll want to play with it a little.....
            > >
            > > <style>
            > > .linkLookingBut ton {
            > > background-color: #FFFFFF;
            > > border: 0px solid;
            > > color: #0000FF;
            > > text-decoration: underline;
            > > cursor:hand
            > > }
            > > </style>
            > >[/color]
            >
            > make that
            >
            > cursor:pointer;
            >
            > to be correct and have it working in non-IE Browsers
            >
            >
            >
            > Jens[/color]

            Comment

            • Dominic

              #7
              Re: LinkButton without Javascript???

              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

              Jens Ansorg <jens@ja-web.de> wrote in message news:<e50xpV8AF HA.3492@TK2MSFT NGP12.phx.gbl>. ..[color=blue]
              > David Jessee wrote:[color=green]
              > > this is close...you'll want to play with it a little.....
              > >
              > > <style>
              > > .linkLookingBut ton {
              > > background-color: #FFFFFF;
              > > border: 0px solid;
              > > color: #0000FF;
              > > text-decoration: underline;
              > > cursor:hand
              > > }
              > > </style>
              > >[/color]
              >
              > make that
              >
              > cursor:pointer;
              >
              > to be correct and have it working in non-IE Browsers
              >
              >
              >
              > Jens[/color]

              Comment

              Working...