473,624 Members | 2,565 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating a "Back" button in VB.Net/ASP.Net

Yes, I know why would I want to create a back button when there is one on
the browser? Because that's what the users want! they want a "Previous"
button that they can click from any web page in our application that will do
the exact same thing as the Back button in the browser. Can anyone give me
any suggestions on how to do this using VB .Net? I have Googled for "Create
Back Button" and found stuff in JavaScript and HTML but nothing in VB .Net.
Can this be done as simply as doing a response.redire ct? Any help would be
appreciated.

Coleen
May 23 '06 #1
8 23225
"Coleen" <co**********@y ahoo.com> schrieb:
Yes, I know why would I want to create a back button when there is one on
the browser? Because that's what the users want! they want a "Previous"
button that they can click from any web page in our application that will
do
the exact same thing as the Back button in the browser. Can anyone give
me
any suggestions on how to do this using VB .Net? I have Googled for
"Create
Back Button" and found stuff in JavaScript and HTML but nothing in VB
.Net.
Can this be done as simply as doing a response.redire ct? Any help would
be
appreciated.


As the action takes place on the client (as does pressing the browser's
"Back" button) you may want to use client-side JavaScript. Solutions can be
found on the Web.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

May 23 '06 #2
Yes, I know I can use JavaScript, thanks. I was trying to find out if there
is a way to do this using VB.Net? I have been reading all the help files
and searching on-line but can't find anything to accomplish this in VB .Net.
Is this not supported by .Net? Why is it that things that should be very
simple are so convoluted in .Net?

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:Ou******** *******@TK2MSFT NGP05.phx.gbl.. .
"Coleen" <co**********@y ahoo.com> schrieb:
Yes, I know why would I want to create a back button when there is one on the browser? Because that's what the users want! they want a "Previous" button that they can click from any web page in our application that will do
the exact same thing as the Back button in the browser. Can anyone give
me
any suggestions on how to do this using VB .Net? I have Googled for
"Create
Back Button" and found stuff in JavaScript and HTML but nothing in VB
.Net.
Can this be done as simply as doing a response.redire ct? Any help would
be
appreciated.
As the action takes place on the client (as does pressing the browser's
"Back" button) you may want to use client-side JavaScript. Solutions can

be found on the Web.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

May 23 '06 #3
>> Is this not supported by .Net?

Why would it be? .Net runs on the server, and you are trying to perform a
client action.
Why is it that things that should be very simple are so convoluted in ..Net?

What makes you think it's simple? Is because you think simply?

Or is it because you are trying so hard to *make* it not simple?

Why do you want to go back to the server to perform an action that is
handled more simply, and natively on the client?

What is convoluted about it?

Of course, if you insist on going back to the server, I guess you could
store the previous page in a session variable, post back to the server, read
the variable, and redirect to that page.

But, that would be not simple, and also very convoluted. Oh, yeah - and
stupid.

Bob Lehmann

"Coleen" <co**********@y ahoo.com> wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Yes, I know I can use JavaScript, thanks. I was trying to find out if there is a way to do this using VB.Net? I have been reading all the help files
and searching on-line but can't find anything to accomplish this in VB ..Net. Is this not supported by .Net? Why is it that things that should be very
simple are so convoluted in .Net?

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:Ou******** *******@TK2MSFT NGP05.phx.gbl.. .
"Coleen" <co**********@y ahoo.com> schrieb:
Yes, I know why would I want to create a back button when there is one
on the browser? Because that's what the users want! they want a "Previous" button that they can click from any web page in our application that will do
the exact same thing as the Back button in the browser. Can anyone give me
any suggestions on how to do this using VB .Net? I have Googled for
"Create
Back Button" and found stuff in JavaScript and HTML but nothing in VB
.Net.
Can this be done as simply as doing a response.redire ct? Any help would be
appreciated.


As the action takes place on the client (as does pressing the browser's
"Back" button) you may want to use client-side JavaScript. Solutions

can be
found on the Web.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


May 24 '06 #4
Thanks for your insults - I mean input!

"Bob Lehmann" <no****@dontbot herme.zzz> wrote in message
news:u%******** ********@TK2MSF TNGP04.phx.gbl. ..
Is this not supported by .Net?
Why would it be? .Net runs on the server, and you are trying to perform a
client action.
Why is it that things that should be very simple are so convoluted in .Net?

What makes you think it's simple? Is because you think simply?

Or is it because you are trying so hard to *make* it not simple?

Why do you want to go back to the server to perform an action that is
handled more simply, and natively on the client?

What is convoluted about it?

Of course, if you insist on going back to the server, I guess you could
store the previous page in a session variable, post back to the server, read the variable, and redirect to that page.

But, that would be not simple, and also very convoluted. Oh, yeah - and
stupid.

Bob Lehmann

"Coleen" <co**********@y ahoo.com> wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Yes, I know I can use JavaScript, thanks. I was trying to find out if

there
is a way to do this using VB.Net? I have been reading all the help files and searching on-line but can't find anything to accomplish this in VB

.Net.
Is this not supported by .Net? Why is it that things that should be very simple are so convoluted in .Net?

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:Ou******** *******@TK2MSFT NGP05.phx.gbl.. .
"Coleen" <co**********@y ahoo.com> schrieb:
> Yes, I know why would I want to create a back button when there is one
on
> the browser? Because that's what the users want! they want a

"Previous"
> button that they can click from any web page in our application that

will
> do
> the exact same thing as the Back button in the browser. Can anyone

give > me
> any suggestions on how to do this using VB .Net? I have Googled for
> "Create
> Back Button" and found stuff in JavaScript and HTML but nothing in
VB > .Net.
> Can this be done as simply as doing a response.redire ct? Any help

would > be
> appreciated.

As the action takes place on the client (as does pressing the browser's "Back" button) you may want to use client-side JavaScript. Solutions

can
be
found on the Web.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>



May 24 '06 #5
Sorry I couldn't Resist :-)

The plain "simple" truth is that I don't know JavaScript - and honestly do
NOT know that much about what calls the server and what calls the client so
I did not realize that Javascript does not call the server while .Net
does...so my remarks were in ignorance of .Net's capabilities not meant to
belittle .Net - only that I thought this should be a simple thing to do.

The problem I am having is that since I do not Know JavaScript, the code
that I have found on-line to do this simple (yes the CODE IS simple in
JavaScript and even in HTML!) but I am using a User Control that has
multiple buttons and I put the code for the Back button in the User Control
VB code-behind:

btn_prev.Attrib utes.Add("oncli ck", "javascript:his tory.go(-1);")
btn_prev.Attrib utes.Add("oncli ck", "javascript:his tory.back();")

Neither one of these works, and since I don't know JavaScript I do NOT know
how to get this to work!

If you have any suggestions I would appreciate them.

Coleen

"Coleen" <co**********@y ahoo.com> wrote in message
news:e9******** ******@TK2MSFTN GP02.phx.gbl...
Thanks for your insults - I mean input!

"Bob Lehmann" <no****@dontbot herme.zzz> wrote in message
news:u%******** ********@TK2MSF TNGP04.phx.gbl. ..
> Is this not supported by .Net?


Why would it be? .Net runs on the server, and you are trying to perform a
client action.
> Why is it that things that should be very simple are so convoluted in

.Net?

What makes you think it's simple? Is because you think simply?

Or is it because you are trying so hard to *make* it not simple?

Why do you want to go back to the server to perform an action that is
handled more simply, and natively on the client?

What is convoluted about it?

Of course, if you insist on going back to the server, I guess you could
store the previous page in a session variable, post back to the server,

read
the variable, and redirect to that page.

But, that would be not simple, and also very convoluted. Oh, yeah - and
stupid.

Bob Lehmann

"Coleen" <co**********@y ahoo.com> wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Yes, I know I can use JavaScript, thanks. I was trying to find out if

there
is a way to do this using VB.Net? I have been reading all the help files and searching on-line but can't find anything to accomplish this in VB

.Net.
Is this not supported by .Net? Why is it that things that should be very simple are so convoluted in .Net?

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:Ou******** *******@TK2MSFT NGP05.phx.gbl.. .
> "Coleen" <co**********@y ahoo.com> schrieb:
> > Yes, I know why would I want to create a back button when there is one on
> > the browser? Because that's what the users want! they want a
"Previous"
> > button that they can click from any web page in our application that will
> > do
> > the exact same thing as the Back button in the browser. Can anyone give
> > me
> > any suggestions on how to do this using VB .Net? I have Googled
for > > "Create
> > Back Button" and found stuff in JavaScript and HTML but nothing in VB > > .Net.
> > Can this be done as simply as doing a response.redire ct? Any help

would
> > be
> > appreciated.
>
> As the action takes place on the client (as does pressing the browser's > "Back" button) you may want to use client-side JavaScript.

Solutions can
be
> found on the Web.
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://classicvb.org/petition/>
>



May 24 '06 #6
i think that this would be complex in vb.net; i mean-- you would need
to encode an undo functionality to everything you.

perhaps starting a transaction and not commiting it would be the way to
go?

are you building data entry apps??

-Aaron

May 24 '06 #7
Yes. The app is an on-line entry for users and we have created a "Footer"
user control that has all the buttons for Back, Submit, Next , Add, Clear or
Update the current page. Some buttons will have slightly different
functions from page to page, but buttons such as the Back, Next, and Submit
will always do the same thing. So I am trying to set up the code to do the
Back and next buttons in the User Control. The code I showed before for the
JavaScript doesn't work, so since I'm not a JavaScript programmer I don't
know how to troubleshoot it. If you have any suggestions on how to embed a
JavaScript function in a VB/ASCX User Control, I would greatly appreciate
any help.

Thanks :-)

Coleen
<aa*********@gm ail.com> wrote in message
news:11******** **************@ j33g2000cwa.goo glegroups.com.. .
i think that this would be complex in vb.net; i mean-- you would need
to encode an undo functionality to everything you.

perhaps starting a transaction and not commiting it would be the way to
go?

are you building data entry apps??

-Aaron

May 24 '06 #8
Okay - I got some help from someone who knows JavaScript here and we solved
this by putting the code:
btn_prev.Attrib utes.Add("oncli ck", "javascript : history.go(-1); return
false;")
in the Page load of the user control instead of in the Click event of the
control. Two things here - I was not using the return false option or
spacing the JavaScript code correctly, and the code has to be in the page
load not in the Click event. Any way, this is the solution for any one else
who comes across this problem.

Coleen

"Coleen" <co**********@y ahoo.com> wrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
Yes, I know why would I want to create a back button when there is one on
the browser? Because that's what the users want! they want a "Previous"
button that they can click from any web page in our application that will do the exact same thing as the Back button in the browser. Can anyone give me any suggestions on how to do this using VB .Net? I have Googled for "Create Back Button" and found stuff in JavaScript and HTML but nothing in VB ..Net. Can this be done as simply as doing a response.redire ct? Any help would be appreciated.

Coleen

May 24 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2271
by: Nick Li | last post by:
Hi, I need to create a html page so that "Back" button(or some other button) is disabled in IE browser. I would appreciate your help. Nick Li
1
5813
by: JJA | last post by:
When my webserver does not process a user's change because of an invalid password, I inform the user and I want to present them a button for a retry: <TR id=continuebuttonrow> <td width="05%">&nbsp;</td> <TD width="90%" align=center valign=middle colspan=2> <BUTTON TYPE=BUTTON ONCLICK="location.href='<% = Request.ServerVariables("HTTP_REFERER") %>';"
1
2109
by: Tom Youngquist | last post by:
Does anyone know the command to "imitate" the "Back" button on a browser in .NET. I have looked in the Redirect but can't seem to find anything. I can re-direct to a specific page but my users come from differnet places so would like to put a "Back" button on the page. Thanks. Tom Youngquist Tom_Y@ix.netcom.com
5
2428
by: Dani | last post by:
Hello everybody, I have some code that disables form elements on body load, but I notice when I hit the "back" button, I need to re-enable the form elements (that is done by clicking on a radial button). Is there any way I can keep the form for disabling every time a user hits the back button and "remember" what elements should be enabled? I was thinking maybe utilizing some referrer thing, but I'm not that good with JS yet. Thanks...
12
10160
by: VB Programmer | last post by:
I know some sites will display the following message if you click on the BACK button in your browser. How do I implement this feature? Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you. To resubmit your information and view this Web page, click the...
2
2047
by: VB Programmer | last post by:
I created a page which I am using to prevent the user from hitting the BACK button. I'll call it my "Auto Jump" page. When it is called it basically auto-redirects to a page specified in the QueryString. (We'll call the page it goes to the "destination page".) If the user hits BACK on the destination page it should goto the "Auto Jump" page which should put you right back to where you hit the button. In Page_Load of this "Auto Jump"...
2
3795
by: Leszek Taratuta | last post by:
Hello, I am using the following code to prevent users to see the previous pages: Response.CacheControl = "no-cache"; Response.AddHeader( "Pragma", "no-cache" ); Response.Expires = -1; When users select the "Back" button in IE, they see the message:
11
2689
by: John A Grandy | last post by:
asp.net 1.1 ie 6 how to lock-out the user from clicking the browser "Back" button ?
0
3520
by: sagarp86 | last post by:
How to lock / deactivate "Refresh" and "Back" button on browser. Problem is in voting application. Once we click for a vote application goes to next page and increament one vote in the database. But when we click on "Refresh" button on the browser, the query is fired again and again one vote is added un-necessarily..Only one vote should be posted from each pc / user. Same thing is with "Back" button on browser. when we click on vote,...
0
8249
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8179
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8685
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8633
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8348
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8493
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6112
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2613
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1797
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.