#1
:?:
i use YAF in local
i'm going to create a page for manager some function.
i created adsmanager.aspx in root directory and add link in YafHeader.ascx:

 <asp:PlaceHolder ID="AdminModHolder" runat="server" Visible="false">
              <ul class="menuAdminList">
                 <li class="menuAdmin"><a title="Go to Ads Manager" href="http://localhost:20937/adsmanager.aspx" target="_top">Ads Manager</a></li>
                <asp:PlaceHolder ID="menuAdminItems" runat="server"></asp:PlaceHolder>
              </ul>
            </asp:PlaceHolder>



i access defaut.aspx and login with admin account. the link above is appear but when i click it, it always go to http://localhost:20937/adsmanager.aspx with defaut interface of forum.ascx
i view this post: http://forum.yetanotherforum.ne...033-Create-a-custom-page 
but still can't understand what need to do.
some one can help me clearly step by step?
thank, by the way help me to detect user loged in/or not in new page adsmanager.aspx
Topic Starter
  • yeutuihok
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    51.2%
  • Joined: 01/09/2017
  • Posts: 2
  •  Viet Nam
  • Thanks: 1 times
  • Was thanked: 1 time(s) in 1 post(s)
#2
exclude the page from the urlrewriter. all you need is open the file urlrewriter.config

and change line...

<if url="^((?!\.ashx|\.asmx|\.axd|\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js|\/install|error\.aspx|auth\.aspx|default\.aspx|popup\.aspx|advanced\.aspx|digest\.aspx|ftb.imagegallery\.aspx|ckfinder).)*$">
    <rewrite url="^~/(.+)?\?(.+)?$" to="~/Default.aspx?g=$1&amp;$2" processing="stop" />
    <rewrite url="^~/(.+)?\.aspx$" to="~/Default.aspx?g=$1" processing="stop" /> 
    <rewrite url="^~/(.+)?$" to="~/Default.aspx?g=$1" processing="stop" />
  </if>


to....

<if url="^((?!\.ashx|\.asmx|\.axd|\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js|\/install|error\.aspx|auth\.aspx|default\.aspx|popup\.aspx|advanced\.aspx|digest\.aspx|ftb.imagegallery\.aspx|ckfinder|adsmanager\.aspx).)*$">
    <rewrite url="^~/(.+)?\?(.+)?$" to="~/Default.aspx?g=$1&amp;$2" processing="stop" />
    <rewrite url="^~/(.+)?\.aspx$" to="~/Default.aspx?g=$1" processing="stop" /> 
    <rewrite url="^~/(.+)?$" to="~/Default.aspx?g=$1" processing="stop" />
  </if>


UserPostedImage
  • tha_watcha
  • Rank: YAF.NET Project Lead
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor: Portal Puzzle Master: Portal Puzzle Master for DNNMedal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.DNN Master: DNN Module ManBug Killer Medal of Honor: Medal for being a kick-ass bug killer!Medal of Honor for the Support King: Support King! Amazing asset to the YAF.NET Community.
  • Joined: 06/03/2010
  • Posts: 4,034
  •  Germany
  • Thanks: 73 times
  • Was thanked: 1215 time(s) in 1040 post(s)
#3
Originally Posted by: yeutuihok

by the way help me to detect user loged in/or not in new page adsmanager.aspx



if (HttpContext.Current.User.Identity.IsAuthenticated)
                    {
                       // do action if user is logged in
                    }
else  {

// do other action if user is aguest
}





UserPostedImage
  • tha_watcha
  • Rank: YAF.NET Project Lead
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor: Portal Puzzle Master: Portal Puzzle Master for DNNMedal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.DNN Master: DNN Module ManBug Killer Medal of Honor: Medal for being a kick-ass bug killer!Medal of Honor for the Support King: Support King! Amazing asset to the YAF.NET Community.
  • Joined: 06/03/2010
  • Posts: 4,034
  •  Germany
  • Thanks: 73 times
  • Was thanked: 1215 time(s) in 1040 post(s)
#4
THANKS tha_watcha SO MUCH! I CLICKED THANK BUTTON FOR YOU <3
Topic Starter
  • yeutuihok
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    51.2%
  • Joined: 01/09/2017
  • Posts: 2
  •  Viet Nam
  • Thanks: 1 times
  • Was thanked: 1 time(s) in 1 post(s)
Forum Jump  
  • You cannot post new topics in this forum.
  • You cannot reply to topics in this forum.
  • You cannot delete your posts in this forum.
  • You cannot edit your posts in this forum.
  • You cannot create polls in this forum.
  • You cannot vote in polls in this forum.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved