SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    runat="server" Golgotha's Avatar
    Join Date
    Nov 2001
    Location
    Colorado
    Posts
    2,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Make a button a link?

    just trying to make a button a link, what's the best way? Doesn't like my code below:

    <asp:Button ID="btnCancel" runat="server" Height="57px" Text="Cancel" Width="154px" onclick="javascript:MyFunction(window.location.href = 'related-items.aspx');return false;" />

  2. #2
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Seems Ok to me. Except that i wouldn't register the onclick event handler inline.

  3. #3
    runat="server" Golgotha's Avatar
    Join Date
    Nov 2001
    Location
    Colorado
    Posts
    2,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    doesn't work for me.... says object expected...

  4. #4
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What if yo just keep:
    onclick="window.location.href = 'related-items.aspx';return false;"

  5. #5
    runat="server" Golgotha's Avatar
    Join Date
    Nov 2001
    Location
    Colorado
    Posts
    2,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cool - thanks, that did it


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •