CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 11/14/2005 8:07:54 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 4 Views: 121 Favorited: 0 Favorite
5 Items, 1 Pages 1 |< << Go >> >|
fark
Asp.Net User
Page load order11/14/2005 8:07:54 PM

0

I am having trouble getting some functionality to work and it appears to be because the content page is loading before the code-behind in my master page executes.  I have DropDown2 on my Master Page and Button 3 on my master page.  Once a user selected edit or readonly from the dropdown it changes my formview1 to readonly or edit.  The problem is when I switch menu items the dropdown retains values but the formview reverts to readonly.  When I've tried to debug the problem the dropdownlist is set from the session variable after the content page loads.  How do I force the forview to stay in edit mode when I switch content pages?


/////////////////////////////////
Content Page

public
partial class Cost : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

 

DropDownList temp = new DropDownList();

temp = (DropDownList)this.Master.FindControl("DropDownList2");

if (temp.SelectedValue == "ReadOnly")

{

FormView1.ChangeMode(FormViewMode.ReadOnly);

}

else

{

FormView1.ChangeMode(FormViewMode.Edit);

}

}

}

///////////////////////////////////////////////////////////////////
Master Page

protected
void Page_Load(object sender, EventArgs e)

{

if ((string)Session["myDefaultMode"] != "" && (!Page.IsPostBack))

{

DropDownList2.SelectedValue = (string)Session["myDefaultMode"];

}

}


protected void Button3_Click(object sender, EventArgs e)

{

Session["myDefaultMode"] = DropDownList2.SelectedValue;

}

Fredrik N
Asp.Net User
Re: Page load order11/15/2005 10:49:21 AM

0

The Content Page Page_Load will be executed first, then the MasterPage Page_Load and last the Button3_Click method.

Instead of getting the DropDownList from the MasterPage, why don't you use the Session in the content page to decide the mode of the FormView?
/Fredrik Norm?n NSQUARED2
Microsoft MVP, MCSD, MCAD, MCT

Cornerstone

My Blog, ASP.Net 2.0 etc
SimonCal
Asp.Net User
Re: Page load order11/15/2005 11:33:17 PM

0

Yes, it is the same for a user control. Since the master-page effectivelky is a control in the content-page, it is loaded after the page. This is not the case though for Init however.
Simon
This posting is provided "AS IS" with no warranties, and confers no rights.
fark
Asp.Net User
Re: Page load order11/21/2005 8:01:55 PM

0

 Fredrik N wrote:
The Content Page Page_Load will be executed first, then the MasterPage Page_Load and last the Button3_Click method.

Instead of getting the DropDownList from the MasterPage, why don't you use the Session in the content page to decide the mode of the FormView?


I've tried this but I am having trouble with when to set the session variable.  If I do it in button3 it still gets executed after the content page loads.  I've tried setting it in the master page init but it looks like the Dropdown2.SelectedValue has not been updated yet.  Any furthur help would be appreciated.

Thanks,
Mark Fischer
KelseyThornton
Asp.Net User
Re: Page load order1/4/2008 12:06:02 PM

0

A bit late now, but to find the order in which master and content page events are fired see:

http://msdn2.microsoft.com/en-us/library/dct97kc3.aspx


Kelsey Thornton
(In the Netherlands)

Don't forget - Mark the post which answered your question with "Answer", then that user will get some kudos, and your post will be marked as "Answered" for future readers!
5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Macromedia Studio 8 All-in-One Desk Reference For Dummies: All-in-One Desk Reference for Dummies Authors: Damon Dean, Andy Cowitt, Pages: 888, Published: 2005
WebLogic: The Definitive Guide Authors: Jon Mountjoy, Avinash Chugh, Pages: 828, Published: 2004
ActionScript for Flash MX: The Definitive Guide Authors: Colin Moock, Pages: 1051, Published: 2003
How to Do Everything with Flash 8 Authors: Bonnie Blake, Doug Sahlin, Pages: 464, Published: 2006
ASP.NET 2.0 All-In-One Desk Reference For Dummies: all-in-one desk reference for dummies Authors: Doug Lowe, Jeff Cogswell, Ken Cox, Pages: 910, Published: 2006
Flash CS3: The Missing Manual Authors: E. A. Vander Veer, Chris Grover, Pages: 513, Published: 2007
Adobe Creative Suite 3 Web Premium All-in-One Desk Reference For Dummies: All-in-one Desk Reference for Dummies Authors: Damon Dean, Andy Cowitt, Jennifer Smith, Christopher Smith, Pages: 882, Published: 2007
Macromedia Flash MX for Windows and Macintosh: Visual QuickStart Guide Authors: Katherine Ulrich, Pages: 613, Published: 2002
Beginning Visual Basic 2005 Authors: Thearon Willis, Bryan Newsome, Pages: 799, Published: 2006
Structure and Fabric Authors: Jack Stroud Foster, Raymond Harington, Pages: 375, Published: 2000

Web:
How do you specify the load order of stuff on a page??? - kirupaForum How do you specify the load order of stuff on a page??? Client-Side (HTML, CSS, JavaScript)
CSS Page Load Order : Web Design CSS Page Load Order - Creative Cow's Web Design forum explores design and coding issues related to web pages, e-commerce, code and scripting, etc.
Browser Load order Jun 30, 2006 ... Nicholas Morgan wrote: > Does anyone know what the load order for a ... When you first request a page, your browser sends a GET request to ...
load order question Talk about load order question. ... Reload this Page load order question ... Initialize your user control at Page Init (not page load). ...
Page image Load Order - Load Background First, then the rest of ... Hi, I am using Frontpage 2003 and the page graphics seem to load first, then the background image. Is there any way to reverse this order so that the page ...
LoadOrder See the order in which devices are loaded on your WinNT/2K system. ... Run LoadOrder now from Live.Sysinternals.com. Top of page Top of page ...
HTML & CSS - Page Load Order | DreamInCode.net HTML & CSS - Page Load Order. Get help with this and thousands of other programming and web development topics at DreamInCode.net.
controling load order of swfs and jpgs on an html page, maybe ... Hi I hope this is more appropriate here than on the scripting page? I have a page with a 129kb flash swf file at the top, some jpg files, ...
Load Order on a Page Load Order on a Page. internetheaven #:3526610, 11:02 am on Dec. 13, 2007 (utc 0 ). I have a large flash section on my page and this slows down the rest of ...
Controlling the load order of images Images in a Web page sometimes load in an unpredictable order. ... Although page load-order is unpredictable, techniques exist which will allow more control ...

Videos:
Free Bots Acclaim Coins http://www.rewards1.com/index.php?referrer_id=258249 THIS SITE IS 100% LEGIT AND LEGAL! Step 1: Sign up. Link: http://tinyurl.com ...
FREE xbox 360,PS 3,xbox live or anything else!-101% Legit Heres the video i first saw that introduced me to the Rewards1 site... this is probably the best site explaining what to do and ho Heres the video ...
Zionist New World Order after 2007 A.D. Picture capture of El Al Israel Airlines web page that says "No departure flight" between September 14 and 16 http://i174.photobucket.com ...
Oblivion Music I put 5 songs in this video..The Intro music(when you press on the shortcut), Title music(when you get to the page where you load your saves ...
My FREE Playstation 3 with proof! Here's the link: http://www.rewards1.com/index.php?referrer_id=65152 Today I'm going to show you how I got my PS3 mailed to me for FREE ...
Shopping Cart Software: Exporting Orders http://www.MasterListBuilder.us Shopping Cart Software allows you many things to do. It automates your business, for you to have lesser time at ...
Free Mario Kart Wii or DS Here is the site for your free Mario Kart Wii or Ds: http://www.rewards1.com/index.php?referrer_id=258249 ...
(PCN Resistors) WARNING!!DO NOT JOIN THIS OPPORTUNITY!!! http://www.CreatorstoWealth.com Charlie Deleon Guerrero pcn resistors (pcn resistors) "pcn resistors" pcnresistors at http://www ...
How to get free ipods, itune cards, and whatever you want! Link : http://www.freeprizerebelcom.tk/ Hey guys! I'm going to show you how I got my ipod nano ailed to me completely free without using a credit ...
Free Nexon Cash For Maple Story, Ps3, Xbox 360, Wii and more go here first http://callofduty5free.tk/ Hey guys! I'm going to show you how I got 1600 XBox 360 Live Points emailed to me completely free ...






editing and saving profile values of user not logged in

problem with applicationname

how to assign a user a role 'x" by default?

keeping track of logged in users

owc permissions ?

login problem with customer membership provider

problem with access rules in iis6

fill the dropdownlist from the file servers with specific file extention

live mail - login form on site

certificate question

membership provider

login script wont work

rsa cryptography question

create account wizard-add fields

redirect to page where login button was clicked

impersonation based on a custom login

struggling with membership

asp.net.vulnerability: win32 api calls (potential security problems)

how can i get last login time for user to my website ?!

single signin for multiple application wouldn't work..

how to remove complete step (not usable for me) in createuserwizard, and how to login user from code

writing a cookie with authenticated users' information

matser page not applying formatting when "forms" authentication is used

certificate client link to active directory

read file on remote system

problems with dsacryptoserviceprovider fromxmlstring and toxmlstring on a shared hosting web server.

activation codes generator ?

how to manually reset a passowrd for a different user

failed to initialize object

problems with capicom while decrypting the data

   
  Privacy | Contact Us
All Times Are GMT