Looking for advice, problems w/ User Control and Master Page code behinds

Last post 05-11-2007 4:40 AM by MorningZ. 1 replies.

Sort Posts:

  • Looking for advice, problems w/ User Control and Master Page code behinds

    05-11-2007, 2:48 AM
    • Member
      21 point Member
    • SJLee
    • Member since 03-10-2007, 5:59 PM
    • Posts 61

    Ok, here's what I have:

    1.  Masterpage (Pretty basic, Header image, background color, and a content area)  Master page uses code behind, but has no code includes (Not sure if this even matters)

    2.  3 User controls, Logon, Navigation, and Footer.  Navigation and Footer and just HTML, nothing special, but Logon has 2 textboxes and a submit button.  The Logon.ascx file also has a code behind file.  All 3 controls are called by the master page, and work fine.

    3.  Finally, there is a page which calls the master page (Which is a basic form that is AJAX enabled), this page worked fine before I added the master page, but when I add it, the page loads fine, but when I click the submit button, I get a JavaScript error.

    Any ideas?

     I'm not even sure if this is the best way to do what I'm trying to do, so any advice would be appreciated.

    Stephen

  • Re: Looking for advice, problems w/ User Control and Master Page code behinds

    05-11-2007, 4:40 AM
    Answer
    • Star
      8,834 point Star
    • MorningZ
    • Member since 07-22-2002, 10:39 AM
    • Fort Lauderdale, FL
    • Posts 1,815

    Read the section "FindControl, Javascript and Naming Containers" section:

    http://www.odetocode.com/Articles/450.aspx

    The masterpage is changing the ID's of your controls, hence Javascript doesn't find the id's it expects

    "If you make it idiot proof, they'll build a better idiot"
Page 1 of 1 (2 items)