Main Page | Report Page

 

  .NET DotNet Forum Index » ASP.NET Forum » Handling back or refresh button in the browser...

Author Message
Krishna...
Posted: Thu Dec 10, 2009 2:02 am
 
I've an asp.net application, when the user click on back or refresh button, i
want the user to be redirected to a default.aspx always irrespective where he
was. What is the simplest and best way to accomplish this
 
Mark Rae [MVP]...
Posted: Thu Dec 10, 2009 5:39 am
 
"Krishna" <Krishna at (no spam) discussions.microsoft.com> wrote in message
news:68E6EEA3-D8D2-4491-99C7-1E803681A5BB at (no spam) microsoft.com...

Quote:
I've an ASP.NET application, when the user click on back or refresh
button, I
want the user to be redirected to a default.aspx always irrespective where
he
was. What is the simplest and best way to accomplish this

You have (almost) no chance of doing this. The back, forward and refresh
buttons are part of the web browser and, as such, web applications have
essentially no control over them.

This is about as good as you'll get:
http://www.4guysfromrolla.com/webtech/111500-1.shtml


--
Mark Rae
ASP.NET MVP
http://www.markrae.net
 
Gregory A. Beamer...
Posted: Thu Dec 10, 2009 1:13 pm
 
=?Utf-8?B?S3Jpc2huYQ==?= <Krishna at (no spam) discussions.microsoft.com> wrote in
news:68E6EEA3-D8D2-4491-99C7-1E803681A5BB at (no spam) microsoft.com:

Quote:
I've an asp.net application, when the user click on back or refresh
button, i want the user to be redirected to a default.aspx always
irrespective where he was. What is the simplest and best way to
accomplish this

Simplest and best is popup a form with no back button. :-)

See if this helps:
http://tinyurl.com/ybksoyd

It is not exhaustive, so a good Google search for more complete scripts,
etc, might be in order. I also need to put together a sample of how to
pattern ASP.NET to minimize back button horrors, but I don't have time
now.

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: at (no spam) gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Krishna...
Posted: Fri Dec 11, 2009 2:20 am
 
thanks a lot. But ive posted one more query , but i haven't got any response,
hence pasting my query here.

I have a asp.net page in which i have set the responseencoding
"WINDOWS-1252" it converts all the characters displayed from UTF-8 to
WINDOWS-1252. but i need to use WINDOWS-1252 as encoding type to post a
data to a server, but the display should remain in UTF-8. Like display all the
controls in UTF-8 when i click a button i need to convert the data from
UTF-8 to WINDOWS-1252 and post the data to server during postback is that
possible?

will yoy guys help?

"Gregory A. Beamer" wrote:

Quote:
=?Utf-8?B?S3Jpc2huYQ==?= <Krishna at (no spam) discussions.microsoft.com> wrote in
news:68E6EEA3-D8D2-4491-99C7-1E803681A5BB at (no spam) microsoft.com:

I've an asp.net application, when the user click on back or refresh
button, i want the user to be redirected to a default.aspx always
irrespective where he was. What is the simplest and best way to
accomplish this

Simplest and best is popup a form with no back button. :-)

See if this helps:
http://tinyurl.com/ybksoyd

It is not exhaustive, so a good Google search for more complete scripts,
etc, might be in order. I also need to put together a sample of how to
pattern ASP.NET to minimize back button horrors, but I don't have time
now.

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: at (no spam) gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
.

 
Gregory A. Beamer...
Posted: Fri Dec 11, 2009 11:19 am
 
=?Utf-8?B?S3Jpc2huYQ==?= <Krishna at (no spam) discussions.microsoft.com> wrote in
news:BAACE263-1AB3-43C0-B031-149ECFC8D80C at (no spam) microsoft.com:

Quote:
I have a asp.net page in which i have set the responseencoding
"WINDOWS-1252" it converts all the characters displayed from UTF-8 to
WINDOWS-1252. but i need to use WINDOWS-1252 as encoding type to post
a data to a server, but the display should remain in UTF-8. Like
display all the controls in UTF-8 when i click a button i need to
convert the data from UTF-8 to WINDOWS-1252 and post the data to
server during postback is that possible?

I have not seen this before. It would be easy enough to map from UTF-8
to Windows-1252 in binary, however.

http://dev.networkerror.org/utf8/
http://en.wikipedia.org/wiki/Windows-1252

I know it would be a bit of a pain, but chances are you are only using a
small number of characters out of the set, so you don't have to map
everything. In addition, the Windows-1252 char set only gives 256
characters (including null (0), so that is all you really have to map
for most instances).

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: at (no spam) gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Gregory A. Beamer...
Posted: Wed Dec 23, 2009 10:47 am
 
=?Utf-8?B?S3Jpc2huYQ==?= <Krishna at (no spam) discussions.microsoft.com> wrote in
news:8637DF17-C7E1-4D9F-99BF-5866D1A1F8C7 at (no spam) microsoft.com:

Quote:
any thoughts on my below ask?

Let's step back. Looking at the page, it looks like you are setting up a
form submit to google. Is that your goal? Submit to Google and get a valid
search?

Rather than "how to I solve the problem in the manner I am already trying
to solve it" let's get to "how do I solve the problem". So, what is the
goal. Not the goal plus the proposed solution, but a simple statement of
what the actual problem is.

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: at (no spam) gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Gregory A. Beamer...
Posted: Mon Dec 28, 2009 10:14 am
 
=?Utf-8?B?S3Jpc2huYQ==?= <Krishna at (no spam) discussions.microsoft.com> wrote in
news:B7FFC85E-74A6-4E19-B437-E7405D1E67A7 at (no spam) microsoft.com:

Quote:
Page has a button <input type=button value="ņ" " /
with Japenese text, which comes as ?????, i hope u have noticed it
when type in sample.aspx in the browser. SO my question is i want the
japaenese text button remains as it is and i wanna choose encoding as
'western european' to post the data when i click the submit button. is
my question clear

Is the button the only problem? If the button simply has to be in
Japanese, but all submissions need to be in 1252, then why not make an
image with the japanese characters and leave everything else 1252. This
will solve the button is not Japanese problem, if that is truly the
problem. ImageButton works nicely here and is much simpler than
translating the button.

If the main issue is output of the button on an otherwise 1252 page, you
are always going to have an issue. And if you are setting up the page as
Japanese and trying to convert, that might be a more complex solution
than needed.

Is the text entered Japanese? And, do you have to recreate it as
Japanese later?

Is storing in a database a problem? And, if so, can you change to
national variable character (2 byte, or Unicode) insted of variable
character (1 byte, or ANSI - ASCII if you wish)?

Or, perhaps you are really aiming at globalizing the application? If so,
there are numerous additions that allow for globalizing the application.

The main point of translating from one code page to another, or ANSI to
Unicode, etc, is the persistence of data. In a windows app, it could be
taking a Unicode file and saving as ANSI. In a web app, it might be
saving as varchar in SQL Server when the page is Unicode. But making a
whole page Japanese so you can make the button correct and then
converting everything to another code page to save in English goes
contrary to the way the system is meant to operate.

Am I hitting on the right direction, or did I miss something?

Peace and Grace,



--
Gregory A. Beamer (MVP)

Twitter: at (no spam) gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
 
Page 1 of 1    
All times are GMT - 5 Hours
The time now is Sun Sep 25, 2016 4:01 am