![]() |
|
|
|||||||
![]() |
DotNet - asp.net page load twice problem |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 |
|
|
|
|
#2 |
|
Posts: n/a
|
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 |
|
|
|
#3 |
|
Posts: n/a
|
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 |
|
|
|
#4 |
|
Posts: n/a
|
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 |
|
|
|
#5 |
|
Junior Member
Join Date: Jul 2008
Posts: 1
|
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 |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Aug 2008
Posts: 1
|
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 |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Aug 2009
Posts: 5
|
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 |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Sep 2009
Posts: 2
|
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 |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
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 |