CodeVerge.Net Beta
Login Idy
Register Password
  Forgot?
Explore    Item Entry    Profile   
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML





Zone: > newsgroup > asp.net forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 10/18/2006 9:40:53 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 6 Views: 11 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
7 Items, 1 Pages 1 |< << Go >> >|
pardo
Asp.Net User
Why is my master page firing Page_Load twice?10/18/2006 9:40:53 PM

0/0

I've searched this forum and cannot find a suitable fix. There are lots of threads that suggest this problem is caused by images not having src or alt set properly. Or an imageButton not having its ImageUrl property set properly. I've removed all images and imagebuttons from my master page. Its still posting back 2 times.

 

I have no code behind my master page. The markup for my master page only contains a simple table and a contentPlaceHolder.

 

Does anyone have any ideas?

 

Pardo

mbanavige
Asp.Net User
Re: Why is my master page firing Page_Load twice?10/19/2006 12:35:27 AM

0/0

i had a situation where my default page was being called multiple times.
the cause was an incomplete img src tag in a 3rd party control.

since there was no image src, the control was issuing a extra request for "/" which iis happily maps to your default page.

if your default page is using your master page...

check your iis logs to see if extra requests for your default page is the culprit


Mike Banavige
~~~~~~~~~~~~
Dont forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
pardo
Asp.Net User
Re: Why is my master page firing Page_Load twice?10/19/2006 2:10:11 AM

0/0

I do have extra requests to my default page in my iis logs. Still, I have no idea how to mitigate the calls to the page. As far as I'm concerned, my markup and code are tight as a frogs rear end. Still looking into a fix...

 

Thanks!

pardo
Asp.Net User
Re: Why is my master page firing Page_Load twice?10/19/2006 2:51:44 AM

0/0

Okay, in the same project, I created a new blank master page and a new blank content page. I then set the content page as the start page. When I run the project and log in, the new master page loads 2 times.

 

This is obiously a config issue. I redirect to this project from another project thats used to authenticate users. Here's the contents of the offensive projects web.config:

 

<machineKey

validationKey= "C50B3C89CB21F4F1422FF158A5B42D0E8DB8CB5CDA1742572A487D9401E3400286682B202B746511891C1BAF47F8D25C07F6C39A104696DB51F17C529AD3CABE"

decryptionKey= "8A9BE8FD67AF6979E7D20186CFEA50DD3D3799C77AF2B72F"

validation="SHA1"/>

 

<authentication mode="Forms">

<forms name="Admin" timeout="30" enableCrossAppRedirects="true" loginUrl="../Login/Login.aspx"

slidingExpiration="true" />

</authentication>

<authorization>

<deny users="?" />

</authorization>

 

<roleManager enabled="true" cacheRolesInCookie="true" cookieName=".RolesCookie"

cookieTimeout="300" defaultProvider="RoleProvider">

<providers>

<add connectionStringName="conn_UserAdmin" applicationName="Roles"

name="RoleProvider" type="System.Web.Security.SqlRoleProvider" />

</providers>

</roleManager>

 

 

<compilation debug="true" strict="false" explicit="true"/>

<

membership defaultProvider="MembershipProvider">

<providers>

<add connectionStringName="conn_UserAdmin" minRequiredNonalphanumericCharacters="0"

passwordStrengthRegularExpression="w+" minRequiredPasswordLength="4"

applicationName="Membership" enablePasswordRetrieval="true"

passwordFormat="Clear" enablePasswordReset="true" requiresQuestionAndAnswer="false"

requiresUniqueEmail="false" name="MembershipProvider" type="System.Web.Security.SqlMembershipProvider" />

</providers>

</membership>

pardo
Asp.Net User
Re: Why is my master page firing Page_Load twice?10/19/2006 3:03:56 AM

0/0

Okay, I created a new project. I added a new master page, which I didn't touch. I then added a new webform that uses the master page. I didn't touch anything in the webform, but I set it to as the start page. I didn't touch the web.config.

 

The master page loads twice!

 

I'm completely befuddled.

pardo
Asp.Net User
Re: Why is my master page firing Page_Load twice?10/20/2006 12:42:11 PM

0/0

mbanavige:

i had a situation where my default page was being called multiple times.
the cause was an incomplete img src tag in a 3rd party control.

since there was no image src, the control was issuing a extra request for "/" which iis happily maps to your default page.

if your default page is using your master page...

check your iis logs to see if extra requests for your default page is the culprit

 

Do you have any idea how to fix this issue? I'm still banging my head against the wall with this....

 

Thanks!

pardo
Asp.Net User
Re: Why is my master page firing Page_Load twice?10/20/2006 1:10:57 PM

0/0

Okay, I found the reason. I was using this page load declaration:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, Me.Load

When I should have been using this one:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load

When I added pages, there were no page_load funcitons automatically declared. So I copied one over from my VS 2003 project. Wups!

Hope this helps someone in the future.

Pardo

7 Items, 1 Pages 1 |< << Go >> >|



Search This Site:


Meet Our Sponsors:



Other Resources:

Session value - general_asp.net.state_management - Web Programming ... ... page (clicked Refresh button or pressed a submit button), Page_Load fired again ... Since I am using two event handlers, actually the page is loaded twice. ...
Great New Advanced Article on ASP.NET 2.0 Master Pages - ScottGu's Blog It's why we're not using master pages at all. ... the code which is just placed into the Page_Load function of the master pages: <code> ...
Confused with autoeventwireup Other pages using the same Master page does NOT fire ... wire-up and Page_Load is fired (even twice !!) Show quote. Hide quote "Kevin Jones" wrote: ...
TheMSsForum.com >> Asp >> Server event not firing twice - The Microsoft ... ... scripts to all pages in my master page and then in each page load the scripts ... Is there any good reason why i should switch to (and learning) C#? ...
SitePoint Blogs " Page_Load is Evil Why is this a ... using Master pages and base classes to the page and ... after viewstate is loaded, but before common control events are fired" ...
Gridview delete event firing twice when a Formview is present. - Extend ... I ended up just programing my delete event to only run once per Page_Load. ... Form Master 1.6 is an intuitive Form Creation Module at a great price. ...
Gridview delete event firing twice when a Formview is present. - Extend ... This only occurs when a formView is also on the screen. Does anyone know why this is? ... I ended up just programing my delete event to only run once per Page_Load. ...
TheMSsForum.com >> Asp >> Why LINQ? - The Microsoft Software Forum Server event not firing twice here is the code -Register Src="~/UserControls ... scripts to all pages in my master page and then in each page load the scripts ...
SaveViewState executing twice by line to verify your assertion that SVS is firing twice during one page ... executing twice on load of page and can't figure out why. ...
DataGrid Paging Events not firing - Rick Strahl's Web Log I don't exactly know why but that is the first place that I would look. ... page index in the page_load handler, your pageIndexChanged event won't fire for ...
Why redirect? Why not use a Modal Login? - Ryan Ternier ... ShowUsers page, which will cause this ModalLogin to fire, however the page will load. ... MasterPage.Master. 74 <asp:UpdatePanel ID="upLogin" runat="server" ...


 
All Times Are GMT