473,385 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Post Back on Web User Control

When I leave a page that has a user control and press the back button on my browser I notice that the Page_Load event of the user control doesn't fire unless i do a refresh on the page. Is there a way to fire this event when I hit the back button on the browser? Is this by design?
Nov 18 '05 #1
1 1228
Yes, it's by design in that the Back button is handled stricly within the browser and does not invoke a round-trip to the server. So, there's nothing to cause a server-side page load event to be reised

What can you do? Write a client-side onload event for the window object. In javascript, it would start out like this
<SCRIPT for="window" event="onload">. In that script, you can submit the form. (Something like "document.Form1.submit()" ). That will cause a postback to occur

The only question is: How to make sure that the window onload event is not raised when the page is first loaded? You'll need to check the content of some element on your page that you know will be different, depending on whether the page was freshly loaded or not. I've been known to use a hidden text box for such things but others might have for elegant solutions to offer

HTH
Nov 18 '05 #2

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

Similar topics

3
by: sentinel | last post by:
Hi, Wonder if anyone can help with this problem: I am using an app with several pages, using a session to track vars between the pages, and using an image map to re-direct back and forwards...
6
by: Phillip N Rounds | last post by:
I have a webform, from which I have to submit info to another site. Their instructions are to have a html form, with the following as the submit: <form method="post"...
1
by: Lolam | last post by:
Here is my problem, I am using 3 user controls in a page(Test.aspx) which are 1.Header UC 2.Body UC 3.Footer UC HeaderUC has a DropDownList control named "ddlList". On SelectIndexChanged...
0
by: Kaustav Neogy | last post by:
Hi Yatin, does this button have runat="server" ? Kaustav Neogy. >-----Original Message----- >Hi, >
2
by: sk2000 | last post by:
Hello All, I'm creating a web form with user controls in different HTML table cells (User Controls are place in the table cells at design time ). For some reason none of the Button type...
1
by: Troy | last post by:
Hi, I have buttons in a user control for navigation calling usercontrols into a panel on the base page. When I click the submit button on a user control contained in the panel, the usercontrol...
3
by: James T. | last post by:
Hello! How I can force user controls to reload on post-back? Thank you! James
6
by: guoqi zheng | last post by:
In a regular html form, when user press "enter" key, the form will be submitted. However, in ASP.NET web form, a form will only be submitted (post back) when a special button is clicked. Many...
0
by: jonathanyan | last post by:
Hi all: I am dynamically creating two dropdownlist controls in a user control, the data of the second dropdownlist control depends on the selected value of the first dropdownlist control, the...
7
by: loga123 | last post by:
Hi All, I have a web page where I would like to do certain activities when user click's a button. I have used button web control on my page. Each time, I click this button....page gets posted....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.