how to disable tabs in MyAccount ?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 năm cách đây
I want to disable few tabs from the My Account Section, i tried to comment out ajax tab panel but it still shows in My Account..
Please guide me in a right direction how to remove tabs from My Account Page ...
13 năm cách đây
Find Account.aspx.cs and in the function "Page_PreRender" just set Visible=false on the panel you want to hide, example.

To hide the Address tab just add:
pnlCustomerAddresses.Visible = false;

BR
Joakim
13 năm cách đây
If i want to add new tabs, then ?
Lets say i want to add a tab that will show user's total posts on forum then how i will accomplish that ?
13 năm cách đây
Add a new usercontrol in the modules directory, then reference it on the top of the account.aspx page like:
<%@ Register TagPrefix="nopCommerce" TagName="CustomerDownloadableProducts" Src="~/Modules/CustomerDownloadableProducts.ascx" %>

Then just copy&paste the TabPanel to add one more tab and rename it to call your new usercontrol.
13 năm cách đây
jockesoft wrote:
Add a new usercontrol in the modules directory, then reference it on the top of the account.aspx page like:
<%@ Register TagPrefix="nopCommerce" TagName="CustomerDownloadableProducts" Src="~/Modules/CustomerDownloadableProducts.ascx" %>

Then just copy&paste the TabPanel to add one more tab and rename it to call your new usercontrol.


Thanks Joakim
13 năm cách đây
I just added this in the new ascx file:

<asp:PlaceHolder runat="server" ID="phTotalPosts">
                    <div class="totalposts">
                        <%=GetLocaleResourceString("Forum.TotalPosts")%>:
                        <asp:Label runat="server" ID="lblTotalPosts" CssClass="statvalue" />
                    </div>
                </asp:PlaceHolder>

and i am getting an error message with underlines"GetLocaleResourceString"

"GetLocaleResourceString" does not exist in the current context ? why ?
13 năm cách đây
oops
13 năm cách đây
abcd_12345 wrote:
I just added this in the new ascx file:

<asp:PlaceHolder runat="server" ID="phTotalPosts">
                    <div class="totalposts">
                        <%=GetLocaleResourceString("Forum.TotalPosts")%>:
                        <asp:Label runat="server" ID="lblTotalPosts" CssClass="statvalue" />
                    </div>
                </asp:PlaceHolder>

and i am getting an error message with underlines"GetLocaleResourceString"

"GetLocaleResourceString" does not exist in the current context ? why ?


Ok i fixed this error
but i wanted to add a new tab which will give total forum posts of the user
there is already a module that gives this value "ForumPost.ascx"
I added this in Account.aspx page:
<%@ Register TagPrefix="nopCommerce" TagName="ForumPost" Src="~/Modules/ForumPost.ascx" %>

Created Resource in database as MyTopic.UserPosts

Added this tab in account.aspx
<ajaxToolkit:TabPanel runat="server" ID="TabPanel1" HeaderText="<% $NopResources:MyTopic.UserPosts %>">
                    <ContentTemplate>
                        <nopCommerce:ForumPost ID="RewardPoints1" runat="server" />
                    </ContentTemplate>
                </ajaxToolkit:TabPanel>

Re-build the project

The good part is i am getting a new tab saying User Posts
but when i click on the new tab i see this:

Total Posts:
Joined:
Location:

I don't see any values for these fields...why ?
13 năm cách đây
Well, looking at the code in ForumPost.ascx.cs it looks like you first have to set ForumPost and then call DataBind in that class.
13 năm cách đây
jockesoft wrote:
Well, looking at the code in ForumPost.ascx.cs it looks like you first have to set ForumPost and then call DataBind in that class.


Sorry jockesoft i didn't understand what you mean by that,

and one more thing > Logically forumpost.ascx works perfectly fine in forum section of the nopCommerce website

then why it is not working in the My Account Section ?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.