views:

173

answers:

0

I Do not know any JQuery and have to create a Tab with JQuery or JavaScript which works well with Multiview. And note that I have this kinds of tabs in more than 40 pages so I'm looking for a solution which works for all of them. This is my current Scenario

I have a Multiview and some Buttons above Multiview. Each Multiview contains a module (.ascx control) whenever User clicks on a button MultiView ActiveIndex Change to specific index.

Each Module (tab content) has some Ajax functionality and I want to change tab items with JQuery in order to prevent post backing page.

I have MultiView ID , ActiveIndex and ButtonID which change its CSS.here is my code

#region Tab Buttons
// tabed button list.
Button[] butt = null;
/// <summary>
/// called when loading page.
/// in first time set the button1 css class, first component in the
/// tab pane.
/// </summary>
protected void Page_Load(object sender, EventArgs e)
{
    // configure button list.
    butt = new Button[2];
    butt[0] = btnLessonList;
    butt[1] = btnCourseDocument;
    butt[TabContentPane.ActiveViewIndex].CssClass = "activeTabButton";
}

protected void btnLessonList_Click(object sender, EventArgs e)
{
    ChangeTab(0);
}

protected void btnCourseDocument_Click(object sender, EventArgs e)
{
    ChangeTab(1);
}

private void ChangeTab(int index)
{
        butt[TabContentPane.ActiveViewIndex].CssClass = "TabButton";
        TabContentPane.ActiveViewIndex = index;
        butt[TabContentPane.ActiveViewIndex].CssClass = "activeTabButton";
}
#endregion

public void SetActiveIndex(int index)
{
    TabContentPane.ActiveViewIndex = index;
}

Please give complete code, cause I don't know any Jquery. Thanks in Advance