localized back button

Discussion in 'ASP .Net' started by wwildenborg@gmail.com, May 23, 2006.

  1. Guest

    I got it to work, but somehow it doesn't seem like the proper solution.
    I can't switch anymore to design view for instance.

    <input id="cmd_back" class=button type="button" value="<asp:Localize
    ID='Localize13' Text='<%$ Resources:Catalogue, Back %>'
    runat='server'></asp:Localize>" onclick="history.back(1);" />

    I suppose it would be easier to use a <asp:button>, but I can't get
    that one to not postback. As you can tell I am reasonably new to
    asp.net 2. How do I manage to make an <asp:button> that does not post
    back?
    , May 23, 2006
    #1
    1. Advertising

  2. Guest

    You can use a <asp:Button> with its UseSybmitBehaviour property set to
    false. Also, ypo can use its OnClientClick property to link to
    javascript code.

    -Dhanvanth
    , May 23, 2006
    #2
    1. Advertising

  3. Kerem OZMAN Guest

    Alternatively,
    <asp:Localize ID='Localize13' Text='<%$ Resources:Catalogue, Back %>'
    runat='server'></asp:Localize>
    <input type="button" value="<%= Localize13.Text %>
    <> wrote in message
    news:...
    > You can use a <asp:Button> with its UseSybmitBehaviour property set to
    > false. Also, ypo can use its OnClientClick property to link to
    > javascript code.
    >
    > -Dhanvanth
    >
    Kerem OZMAN, May 23, 2006
    #3
  4. Willem Guest

    I tried that, but doesn't work.
    <asp:Button ID="Button1" CssClass=button runat="server" Text="<%$
    Resources:Catalogue, Back %>" UseSubmitBehavior="false"
    OnClientClick="history.back(1);" />

    This is the HTML it generates:
    <input type="button" name="ctl00$MainContent$Button1" value="Back"
    onclick="history.back(1);__doPostBack('ctl00$MainContent$Button1','')"
    id="ctl00_MainContent_Button1" class="button" />

    Now, if I could only get rid of
    __doPostBack('ctl00$MainContent$Button1','').
    Willem, May 23, 2006
    #4
  5. Willem Guest

    Thanks ... it works and I can switch to design-view again. It does
    leave me to wonder: is there no way to prevent an ASP:button to do a
    postback?
    Willem, May 23, 2006
    #5
  6. You can intercept the postback via javascript by adding a client side
    onClick. Otherwise, no, that's what it does. If you don't need that
    behaviour, use a server side HtmlButton:

    <button id="b" runat="server" ... />

    Karl

    --
    http://www.openmymind.net/



    "Willem" <> wrote in message
    news:...
    > Thanks ... it works and I can switch to design-view again. It does
    > leave me to wonder: is there no way to prevent an ASP:button to do a
    > postback?
    >
    Karl Seguin [MVP], May 23, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Piotr Strycharz

    Customizing localized applications

    Piotr Strycharz, Aug 20, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    308
    clintonG
    Aug 20, 2004
  2. sylvia sil
    Replies:
    1
    Views:
    597
    Curt_C [MVP]
    Dec 29, 2004
  3. Jéjé
    Replies:
    0
    Views:
    482
    Jéjé
    Jun 25, 2005
  4. Author
    Replies:
    6
    Views:
    3,069
    George
    Jan 22, 2009
  5. Useful Info

    Firefox back button takes me back 2 pages.

    Useful Info, Jun 3, 2007, in forum: Javascript
    Replies:
    0
    Views:
    332
    Useful Info
    Jun 3, 2007
Loading...

Share This Page