Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > localized back button

Reply
Thread Tools

localized back button

 
 
wwildenborg@gmail.com
Guest
Posts: n/a
 
      05-23-2006
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?

 
Reply With Quote
 
 
 
 
dhanvanth@gmail.com
Guest
Posts: n/a
 
      05-23-2006
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

 
Reply With Quote
 
 
 
 
Kerem OZMAN
Guest
Posts: n/a
 
      05-23-2006
Alternatively,
<asp:Localize ID='Localize13' Text='<%$ Resources:Catalogue, Back %>'
runat='server'></asp:Localize>
<input type="button" value="<%= Localize13.Text %>
<> wrote in message
news: ups.com...
> 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
>



 
Reply With Quote
 
Willem
Guest
Posts: n/a
 
      05-23-2006
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$MainC ontent$Button1','')"
id="ctl00_MainContent_Button1" class="button" />

Now, if I could only get rid of
__doPostBack('ctl00$MainContent$Button1','').

 
Reply With Quote
 
Willem
Guest
Posts: n/a
 
      05-23-2006
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?

 
Reply With Quote
 
Karl Seguin [MVP]
Guest
Posts: n/a
 
      05-23-2006
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: oups.com...
> 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?
>



 
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
Localized pages and change keylayout/Language by code (simulance Alt+Shift ) sastwhc ASP .Net 0 12-06-2005 07:44 AM
Adding a control to a localized ASP .NET 2.0 application =?Utf-8?B?SGVua2U=?= ASP .Net 0 08-08-2005 05:39 AM
Localized resources not loaded until an administrator open the site... Jéjé ASP .Net 0 06-25-2005 02:53 PM
disable the back button provide the users with my own button to go back. sylvia sil ASP .Net 1 12-29-2004 04:41 PM
Customizing localized applications Piotr Strycharz ASP .Net 4 08-20-2004 07:34 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57