Solved

Members only section in Website C#

Posted on 2012-03-22
3
228 Views
Last Modified: 2012-03-22
Hi Guys,

I'm building a website using Visual Web Developer 2010 Express with a template I downloaded.  Following microsofts guide (http://msdn.microsoft.com/en-us/library/ff184050.aspx) I made a folder under the root directory named "Account". ("Account" folder by default denies anyone who is not logged in)    In that folder I created a two .aspx pages.

Here's the problem, when I run my site, and login, that works.  Once logged in if I hit page "A",  it works.  Or if I login, then hit page"B", that works also.

The problem is, once logged in, and say I am on Page "A", if I hit the link for page"B", it gives me the following error

The resource cannot be found.
Requested URL: /WebSite1/Account/Account/testMembers.aspx


The problem I think is on the site.master file
      <div id="menu">
            <ul>
                  <li class="first current_page_item"><a href="#">Homepage</a></li>
                  <li><a href="#">Products</a></li>
                  <li><a href="#">Services</a></li>
                  <li><a href="#">Clients</a></li>
                  <li><a href="#">Support</a></li>
                  <li><a href="Account/Login.aspx">About</a></li>
            <li><a href="Account/MembersOnly.aspx">Members Only</a></li>
            <li><a href="Account/testMembers.aspx">Test Members</a></li>
                  <li class="last"><a href="#">Contact</a></li>
            </ul>


But I do not know how to fix this... any suggestions?
.. the path is showing Account twice
0
Comment
Question by:solarissf
3 Comments
 
LVL 7

Accepted Solution

by:
Lalit Chandra earned 500 total points
Comment Utility
you have 2 choice,
1. If your Account folder is on the root,and the two pages inside it then you have to change the anchor href from
   <li><a href="Account/MembersOnly.aspx">Members Only</a></li>
To
   <li><a href="/Account/MembersOnly.aspx">Members Only</a></li>

   Just Add "/" in the beginning of href;

2. Simple use Asp.net Server control
   <asp:HyperLink NavigateUrl="~/account/MembersOnly.aspx" runat="server">HyperLink</asp:HyperLink>


Hope above will fix your problem
0
 
LVL 51

Expert Comment

by:HainKurt
Comment Utility
this may also work

<a runat=server href="~/Account/MembersOnly.aspx">Members Only</a>
0
 

Author Comment

by:solarissf
Comment Utility
the "~/Account" and "/Account" did not work.  But the hyperlink worked, thank you
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now