putting code in master page Page_Load event moves everything on the page down 2 lines?

Discussion in 'ASP .Net' started by Sunfire, Nov 5, 2007.

  1. Sunfire

    Sunfire Guest

    I put some code in the master page load event and find that for some reason,
    all of the stuff on the page got moved down 2 lines. Is there any way to fix
    this?
     
    Sunfire, Nov 5, 2007
    #1
    1. Advertising

  2. Sunfire

    David Wier Guest

    Depends on what you put in the page load event - - can you show us what you
    put in there?

    David Wier
    http://aspnet101.com
    http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
    bloated markup


    "Sunfire" <> wrote in message
    news:%23DiOYA%...
    >I put some code in the master page load event and find that for some
    >reason, all of the stuff on the page got moved down 2 lines. Is there any
    >way to fix this?
    >
    >
    >
     
    David Wier, Nov 5, 2007
    #2
    1. Advertising

  3. Sunfire

    Sunfire Guest

    Here is my page_load event in full:

    protected void Page_Load(object sender, EventArgs e)

    {


    //get the file name so we can test for its existance.

    String PageName = Path.GetFileName(Request.FilePath);

    switch (PageName)

    {

    case "index.aspx":

    MainMenu.Items[0].Enabled = false;

    break;

    case "AboutUs.aspx":

    MainMenu.Items[1].Enabled = false;

    break;

    case "InHim.aspx":

    MainMenu.Items[2].Enabled=false;

    break;

    case "OnlineCommunity.aspx":

    MainMenu.Items[3].Enabled=false;

    break;

    case "Links.aspx":

    MainMenu.Items[5].Enabled=false;

    break;

    case "Events.aspx":

    MainMenu.Items[6].Enabled=false;

    break;

    case "ContactUs.aspx":

    MainMenu.Items[7].Enabled=false;

    break;

    }

    }





    "David Wier" <> wrote in message
    news:%23PkCSL%...
    > Depends on what you put in the page load event - - can you show us what
    > you put in there?
    >
    > David Wier
    > http://aspnet101.com
    > http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with
    > no bloated markup
    >
    >
    > "Sunfire" <> wrote in message
    > news:%23DiOYA%...
    >>I put some code in the master page load event and find that for some
    >>reason, all of the stuff on the page got moved down 2 lines. Is there any
    >>way to fix this?
    >>
    >>
    >>

    >
    >
     
    Sunfire, Nov 5, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tony collier

    problem putting enum in page_load

    tony collier, Jan 21, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    370
    Teemu Keiski
    Jan 22, 2004
  2. Jay Douglas
    Replies:
    7
    Views:
    618
  3. Saurabh
    Replies:
    6
    Views:
    4,572
    Chris Smith
    May 30, 2004
  4. Doug McCann
    Replies:
    1
    Views:
    1,079
    William Brogden
    Aug 5, 2004
  5. rockdale
    Replies:
    1
    Views:
    675
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Nov 16, 2006
Loading...

Share This Page