Results 1 to 5 of 5

Thread: Ajax tab not wired up correctly to webform

  1. #1
    Join Date
    May 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ajax tab not wired up correctly to webform

    1) Script Title: Ajax Tabs Content Script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...axtabscontent/

    3) Describe problem: I am getting this error when I run the webform:
    Code:
    Parser Error Message: Could not load type 'Main_Project.ExternalAjaxWebforms.external2'.
    This is what I have on Line1 of the webform:
    Code:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Main_Project.ExternalAjaxWebforms.external2.aspx.cs" Inherits="Main_Project.ExternalAjaxWebforms.external2" %>
    This is what the codebehind looks like:
    Code:
    namespace Main_Project.ExternalAjaxWebforms 
    { 
        public partial class external2 : System.Web.UI.Page 
        { 
            protected void Page_Load(object sender, EventArgs e) 
            { 
     
            } 
        } 
    }
    This is what the external2.aspx looks like:
    Code:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="external2.aspx.cs" Inherits="Main_Project.ExternalAjaxWebforms.external2" %> 
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head runat="server"> 
        <title></title> 
    </head> 
    <body> 
        <form id="form1" runat="server"> 
        <div> 
        This is the contents of "external2.htm"<br /> 
    This is the contents of "external2.htm"<br /> 
    This is the contents of "external2.htm"<br /> 
        </div> 
        </form> 
    </body> 
    </html>
    Here is Line1 of the masterpage
    Code:
    <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MainMasterPage.master.cs" Inherits="Master_pages_MainMasterPage" %>
    Here is the webform that is linked to the masterpage
    Code:
    <%@ Page Title="" Language="C#" MasterPageFile="~/Master_pages/SecondLevel.master" AutoEventWireup="true" CodeBehind="GBResultsPage.aspx.cs" Inherits="Main_Project.GBond.GBResultsPage" %>
    Very grateful for any advice.

  2. #2
    Join Date
    May 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Following further testing I am now able to return the content of each tab without any errors.

    The only problem now is that the content of each tab does not display in the tab control itself but on a seperate webpage. Anyone got an idea what I need to do.

  3. #3
    Join Date
    May 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I have fixed this bug. The script
    Code:
    var countries = new ddajaxtabs("countrytabs", "countrydivcontainer")
        countries.setpersist(true)
        countries.setselectedClassTarget("link") //"link" or "linkparent"
        countries.init()
    should have been wrapped around
    Code:
    jQuery().ready(function () {});
    in the .js file

  4. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    if that's all the problem was, you could also simply place that script at the very bottom of your html page (just before </body>). that way, you know the document is ready before your scripts execute.

  5. #5
    Join Date
    May 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Your right, only there will be other webpages that will contain a tab control. I tend to place all scripts in a central .js file for easy maintenance.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •