yeutuihok
  • Posts: 2
  • Joined: 01/09/2017
:?:
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
Sponsor
tha_watcha
  • Posts: 4130
  • Joined: 06/03/2010
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
  • Posts: 4130
  • Joined: 06/03/2010
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
yeutuihok
  • Posts: 2
  • Joined: 01/09/2017
THANKS tha_watcha SO MUCH! I CLICKED THANK BUTTON FOR YOU <3
Users browsing this topic
    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