Ask a Question related to ASP.NET General, Design and Development.
-
Matt #1
Load event behavior
Hello,
I just don't get it. I have a simple webform1.aspx page, when loaded
for the first time, the load even fires which is fine.
In webform1.aspx i have a button that has a onclick event, and in this
event i do a response.redirect to webform2.aspx page. However on the
onclick event of the button, the Load event for webform1.aspx is
loaded again! Then the redirection is done!
And that's not all: once we are in webform2.aspx, if i do a
response.redirect to webform1.aspx, the load event in webform1.aspx
fires twice!
Could please someone explain me this weird behavior please? Thanks
Matt Guest
-
Document Load Completion Event
Does anyone know the last file or function that is called DW completes opening a document? -
Object reference error in UserControl's Load event
I have a UserControl that I declare programmatically as follows: Dim userctrl as New rightside_portal() The codebehind file for this... -
Best event to load usercontrols in ASP.NET 2.0
Hi My question is what is the best event in the page and in the user controls to dynamilly load the user controls, and why CreateChildControls is... -
Having a checkbox column and the grid disabled upon first load generated wierd behavior when Postback occurs.
I have a grid with a checkbox column in it, that is disabled at Form_Load but it loaded with data anyway. Selecting a radio button enables it but... -
Page Load Event Fires Twice
This is a classic asp newsgroup. While you may be lucky enough to find a dotnet-savvy person here who can answer your question, you can eliminate... -
Kevin Bilbee #2
Re: Load event behavior
Matt
"Matt" <metal@rocks.com> wrote in message
news:md69hv8oiqk5f5brb8snm1des78pvr5f4v@4ax.com...Use IsPostBack in the Load event to determine if it is a post back or not.> Hello,
>
> I just don't get it. I have a simple webform1.aspx page, when loaded
> for the first time, the load even fires which is fine.
>
> In webform1.aspx i have a button that has a onclick event, and in this
> event i do a response.redirect to webform2.aspx page. However on the
> onclick event of the button, the Load event for webform1.aspx is
> loaded again! Then the redirection is done!
>
> And that's not all: once we are in webform2.aspx, if i do a
> response.redirect to webform1.aspx, the load event in webform1.aspx
> fires twice!
>
> Could please someone explain me this weird behavior please? Thanks
Load will run every time the
private void Page_Load(object sender, System.EventArgs e) {
if (IsPostBack) {
// This would be run if the page is posted back like in your situation
// Do some code
} else {
// this would be executed the first time the page is loaded
// do some other code
}
Kevin Bilbee
Kevin Bilbee Guest
-
Damian Maclennan #3
Re: Load event behavior
If you don't want the load event to fire why are you redirecting at all ?
You could just go directly to webform2 via a hyperlink or some client side
JS behind the button. That will save asp.net from having to fire up webform1
when it isn't really needed.
Damian
"Matt" <metal@rocks.com> wrote in message
news:md69hv8oiqk5f5brb8snm1des78pvr5f4v@4ax.com...> Hello,
>
> I just don't get it. I have a simple webform1.aspx page, when loaded
> for the first time, the load even fires which is fine.
>
> In webform1.aspx i have a button that has a onclick event, and in this
> event i do a response.redirect to webform2.aspx page. However on the
> onclick event of the button, the Load event for webform1.aspx is
> loaded again! Then the redirection is done!
>
> And that's not all: once we are in webform2.aspx, if i do a
> response.redirect to webform1.aspx, the load event in webform1.aspx
> fires twice!
>
> Could please someone explain me this weird behavior please? Thanks
Damian Maclennan Guest
-
Natty Gur #4
Re: Load event behavior
Hi,
Could you send sample code ? I try to create this senario on machine
without any luck.
Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114
Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377
Know the overall picture
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest



Reply With Quote

