Welcome Guest! To enable all features please Login or Register.
Options
View
Go to last post Go to first unread
Offline yeutuihok  
#1 Posted : Friday, September 1, 2017 4:49:21 AM(UTC)
yeutuihok


Rank: YAF Forumling

Reputation:

Joined: 9/1/2017(UTC)
Posts: 2
Viet Nam

Thanks: 1 times
Confused:
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:
Code:

 <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

Edited by user Friday, September 1, 2017 4:54:07 AM(UTC)  | Reason: make clearly

Sponsor
Offline tha_watcha  
#2 Posted : Saturday, September 2, 2017 8:01:28 AM(UTC)
tha_watcha


Rank: YAF.NET Project Lead

Reputation:

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: 3/6/2010(UTC)
Posts: 3,721
Germany

Thanks: 70 times
Was thanked: 1147 time(s) in 977 post(s)
exclude the page from the urlrewriter. all you need is open the file urlrewriter.config

and change line...

Code:
<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....

Code:
<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>

Offline tha_watcha  
#3 Posted : Saturday, September 2, 2017 8:03:27 AM(UTC)
tha_watcha


Rank: YAF.NET Project Lead

Reputation:

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: 3/6/2010(UTC)
Posts: 3,721
Germany

Thanks: 70 times
Was thanked: 1147 time(s) in 977 post(s)
Originally Posted by: yeutuihok Go to Quoted Post
by the way help me to detect user loged in/or not in new page adsmanager.aspx


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

// do other action if user is aguest
}




thanks 1 user thanked tha_watcha for this useful post.
yeutuihok on 9/2/2017(UTC)
Offline yeutuihok  
#4 Posted : Saturday, September 2, 2017 7:26:07 PM(UTC)
yeutuihok


Rank: YAF Forumling

Reputation:

Joined: 9/1/2017(UTC)
Posts: 2
Viet Nam

Thanks: 1 times
THANKS tha_watcha SO MUCH! I CLICKED THANK BUTTON FOR YOU <3
Rss Feed  Atom Feed
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.

Notification

Icon
Error