Go Back   Velocity Reviews > Newsgroups > DotNet
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

DotNet - asp.net page load twice problem

 
Thread Tools Search this Thread
Old 06-02-2005, 09:18 PM   #1
Default asp.net page load twice problem


Hi there

I have one application use C# for asp.net, when I debug and write code
inside the page_load, it is loading twice, also I put IsNotPostBack, it
still load two times, any one have the same problem, and how to solve it?

by the way, I am using asp.net 1.1 version.

Thanks

Tony




Tony Dong
  Reply With Quote
Old 06-10-2005, 08:30 PM   #2
Yisheng
 
Posts: n/a
Default Re: asp.net page load twice problem
Tony, I had this problem today and spent quite a few hours on it.
Finally I found out it was one of the <td> attributes that was causing
the problem. The "background" attribute was assigned a color code,
where it was probably expecting an image, a file, or something. Here
is the partial code:

<TD valign="bottom" align="left" background="#B6C8DE">

bgColor, not background, should be assigned a color code. But when you
cut and paste in a hurry in the Properties Window in the .net IDE,
sometimes that happens. Your page may not have the same problem as
mine, but it most likely involves an error condition, or a bad
reference.

Yisheng

Tony Dong wrote:
> Hi there
>
> I have one application use C# for asp.net, when I debug and write code
> inside the page_load, it is loading twice, also I put IsNotPostBack, it
> still load two times, any one have the same problem, and how to solve it?
>
> by the way, I am using asp.net 1.1 version.
>
> Thanks
>
> Tony




Yisheng
  Reply With Quote
Old 06-21-2005, 10:48 AM   #3
Ashish
 
Posts: n/a
Default Re: asp.net page load twice problem
Really? It wud be interesting to know how is this affecting the postback ?


--
Thanks and Regards,
Ashish Gupta




"Yisheng" <> wrote in message
news: oups.com...
> Tony, I had this problem today and spent quite a few hours on it.
> Finally I found out it was one of the <td> attributes that was causing
> the problem. The "background" attribute was assigned a color code,
> where it was probably expecting an image, a file, or something. Here
> is the partial code:
>
> <TD valign="bottom" align="left" background="#B6C8DE">
>
> bgColor, not background, should be assigned a color code. But when you
> cut and paste in a hurry in the Properties Window in the .net IDE,
> sometimes that happens. Your page may not have the same problem as
> mine, but it most likely involves an error condition, or a bad
> reference.
>
> Yisheng
>
> Tony Dong wrote:
> > Hi there
> >
> > I have one application use C# for asp.net, when I debug and write code
> > inside the page_load, it is loading twice, also I put IsNotPostBack, it
> > still load two times, any one have the same problem, and how to solve

it?
> >
> > by the way, I am using asp.net 1.1 version.
> >
> > Thanks
> >
> > Tony

>





Ashish
  Reply With Quote
Old 08-01-2005, 09:21 AM   #4
Andreas Bergmeier
 
Posts: n/a
Default Re: asp.net page load twice problem
Ashish wrote:
> Really? It wud be interesting to know how is this affecting the postback ?
>
>
> --
> Thanks and Regards,
> Ashish Gupta

I encountered this, too (with having an empty background value). This
seems to be a problem with alternative browsers only as it did show only
in Firefox and Opera.
To me it seems like the parser is skipping the page or something - and
requesting it once again to be sure the data send was not skipped or so.

My 2c
Andreas


Andreas Bergmeier
  Reply With Quote
Old 07-24-2008, 04:31 PM   #5
Madbyggeren
Junior Member
 
Join Date: Jul 2008
Posts: 1
Default
Hi guys (+/girls),

I too had this error, and after some hours of debugging I found out, it was because of an empty src-attribute in an image-tag, e.g.

<img src="" alt="" />


In the end of my pageload, I was setting this value dynamically via javascript, which is why I didn't figure it out at first. But I hereby confirm, that at least firefox will reload the page (silently, though) if this "error" is present. The problem wasn't there in IE7, and I haven't tested other browsers.

Hope this helps somebody.

Regards,
Frederik Schøning


Madbyggeren
Madbyggeren is offline   Reply With Quote
Old 08-07-2008, 07:15 PM   #6
RobertJohnson
Junior Member
 
Join Date: Aug 2008
Posts: 1
Default
Thank you Frederik, your solution solved the problem for me.

I had src="" in an IMG and also an IFrame, I don't know if the iframe also causes it. It was only affecting Firefox.

I would never have solved it without your help!


RobertJohnson
RobertJohnson is offline   Reply With Quote
Old 08-27-2009, 02:41 PM   #7
hellobiswa2001
Junior Member
 
Join Date: Aug 2009
Posts: 5
Default
Use !IsPostBack event in page_load & write the code or call the function within that block like:

page_load()
{
if (!IsPostBack)
{
write the code;
}
}

I think its working

Bye


hellobiswa2001
hellobiswa2001 is offline   Reply With Quote
Old 09-02-2009, 11:18 PM   #8
nkindia
Junior Member
 
Join Date: Sep 2009
Posts: 2
Default Firefox will fire Page_Load twice when Stylesheet path is empty or invalid
I faced the issue of Page_load hitting twice in FF (3.5) only.
There were no problems with the html tags/images etc. The page had a blank link to stylesheet
like

<LINK href="" rel="stylesheet">

This causes Firefox to reload the page, thinking it lost the css tag in an error.
As long as you dont have any post back specific processing, this can be annoying

Thanks guys! I learnt more about Firefox behaviour, and eventually solved a bug


nkindia
nkindia is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Load .aspx page on another frame from TreeView Event Sangeeth Software 0 06-25-2009 09:20 AM
viewstate MAC failed in asp.net 2.0 while postback the page azraffarveen Software 0 05-12-2009 03:24 PM
How to load Two iframe in one aspx page? pratima Software 2 02-02-2008 03:17 AM
Don't want to load the page everytime when I clicked on any ImageButton in DataList tapasmahata Software 0 01-18-2008 08:45 AM
Re: Problem with DSL not connecting to web page after 10 mins natural_4u A+ Certification 0 07-25-2004 10:39 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

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