yeutuihok
  •  yeutuihok
  • 51.2% (Neutral)
  • YAF Forumling Topic Starter
2017-09-01T10:49:21Z
:?:
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
2017-09-02T14:01:28Z
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
2017-09-02T14:03:27Z
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
  •  yeutuihok
  • 51.2% (Neutral)
  • YAF Forumling Topic Starter
2017-09-03T01:26:07Z
THANKS tha_watcha SO MUCH! I CLICKED THANK BUTTON FOR YOU <3

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