using tab control

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
10/5/2010 12:32:01 AM
Gravatar
Total Posts 33

using tab control

I am trying to use a asp tab control in a custom module.  I tried to add ajaxcontroltoolkit tab container to the mojoportal costum control. However when I run it doesn't show up on the page. So alternatively I tried to use mojo-tab(Is it jquery?) to get the tab container  on the custom control. The problem in here is tracking the tab changed event. As it is a on client side it didn't seem to be easy to track the tab changed event. Can you help me how I can use the aspnet tabcontrol or alternatively get the jquery tab to be able to trigger the code behind functions. I mean ability to call code behind method from jquery/javascript . Suggest me be below by tweeking in the code so I can use it.

Also a separate question as to how I could use inline css or external css for gridview/ mojogridview.

Thanks and greatly appreciate.

Nave

aspx page

------

<%@ Control Language="C#" AutoEventWireup="false" CodeBehind="test.ascx.cs" Inherits="mynamespace.UI.testModule" %>
<portal:mojoPanel ID="mp1" runat="server" ArtisteerCssClass="art-Post" RenderArtisteerBlockContentDivs="true">
    <mp:CornerRounderTop ID="ctop1" runat="server" />
    <asp:Panel ID="pnlWrapper" runat="server" CssClass="art-Post-inner panelwrapper Deals">
        <portal:ModuleTitleControl EditText="Edit" EditUrl="~/test/AdminDashboard.aspx"
            runat="server" ID="TitleControl" />
        <portal:mojoPanel ID="MojoPanel1" runat="server" ArtisteerCssClass="art-PostContent">
            <asp:Panel ID="pnlDeals" runat="server" CssClass="modulecontent">
                <script type="text/javascript">

                    $(document).ready(function () {
                        $(".selector").tabs();
                    });

                    function function1() {
                        alert("Tab1 clicked.");


                    }

                    function function2() {
                  

                        alert("Tab2 clicked.");

                    }

                    function function3() {

                        alert("Tab3 clicked.");

                    }
                    function CallPageMethod() {
                        PageMethods.MyFirstPageMethod(onSucceeded, onFailed);
                    }

                    function onSuccess(result) {

                        var lbl = document.getElementById('lbl');

                        lbl.innerHTML = result;
                        alert(result);
                    }



                    function onFailure(error) {

                        alert(error);

                    }

                </script>
             

      
                <div class="settingrow">
               
                   <ajaxToolkit:TabContainer runat="server" ID="Tabs" Height="150px" OnClientActiveTabChanged="ActiveTabChanged">
        <ajaxToolkit:TabPanel runat="Server" ID="Panel1" HeaderText="Tab One">
            <ContentTemplate>
                <br />PAGE ONE -  Sample HTML Content for Tab
            </ContentTemplate>
        </ajaxToolkit:TabPanel>
        <ajaxToolkit:TabPanel runat="Server" ID="Panel2" HeaderText="Tab Two" >
            <ContentTemplate>
                PAGE TWO - Sample HTML Content for Tab
            </ContentTemplate>
        </ajaxToolkit:TabPanel>
       
        <ajaxToolkit:TabPanel runat="Server" ID="Panel3" OnClientClick="PanelClick" HeaderText="Tab Three">
            <ContentTemplate>
                <BR /><BR />PAGE THREE - Sample HTML Content for Tab
            </ContentTemplate>
        </ajaxToolkit:TabPanel>
    </ajaxToolkit:TabContainer>
                    <div class="mojo-tabs">
                        <ul>
                            <li><a href="#tab1" onclick="function1();">Tab1</a></li>
                            <li><a href="#tab2" onclick="function2();">Tab2</a></li>
                            <li><a href="#tab3" onclick="function3();">Tab3</a></li>
                        </ul>
                        <div id="tab1">
                        </div>
                        <div id="tab2">
                            <p>
                                Tab 2 content</p>
                        </div>
                        <div id="tab3">
                            <p>
                                Tab 3 content</p>
                        </div>
                    </div>
                  </div>
            </asp:Panel>
        </portal:mojoPanel>
        <div class="cleared">
        </div>
    </asp:Panel>
    <mp:CornerRounderBottom ID="cbottom1" runat="server" />
</portal:mojoPanel>
 

10/5/2010 7:59:25 AM
Gravatar
Total Posts 18439

Re: using tab control

Hi,

I know of no reason why ajaxcontroltoolkit tabs would not work, maybe it does not show up because you have not the needed css.

What I do know is that neither ajaxcontroltoolkit tabs nor jquery tabs are meant to cause postback when the user clicks a tab, They are designed to be client side, the content of all tabs is all loaded into the page when it first renders and tabs are only to organize the content visually. The toolkit tabs have a server event that will fire indicating a tab change, but this would only fire when some other control causes the postback.

You can wire up client side javascript using either the toolkit tabs or jquery, but if you use jqueryui tabs then you should not use our automatic tabs based on the css class name mojo-tabs, because it does not give you a reference to the javascript tabs object, so instead you would have to wire it up yourself using javascript which would allow you to wire up events on it.

PageMethods cannot work inside a usercontrol, they only work inside a page.

You can style mojoGridView by adding the css from the style.config file of your skin, there are several themes to choose from as you can see by looking at style.config in skins that ship with mojoPortal:

<file cssvpath="/Data/style/gridview/SoftGreyGridView.css" imagebasevpath="/Data/style/gridview/">none</file>

  <!--
  <file cssvpath="/Data/style/gridview/ChromeBlackGridView.css" imagebasevpath="/Data/style/gridview/">none</file>
  <file cssvpath="/Data/style/gridview/ChromeGridView.css" imagebasevpath="/Data/style/gridview/">none</file>
  <file cssvpath="/Data/style/gridview/GlassBlackGridView.css" imagebasevpath="/Data/style/gridview/">none</file>
  <file cssvpath="/Data/style/gridview/SoftGreyGridView.css" imagebasevpath="/Data/style/gridview/">none</file>
  <file cssvpath="/Data/style/gridview/WhiteChromeGridView.css" imagebasevpath="/Data/style/gridview/">none</file>
  <file cssvpath="/Data/style/gridview/YahooGridView.css" imagebasevpath="/Data/style/gridview/">none</file>
  -->

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.