Solved

Members only section in Website C#

Posted on 2012-03-22
3
230 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
ID: 37753736
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
ID: 37753752
this may also work

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

Author Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Align Buttons next to each other 2 25
Windows 10 IIS and Windows Authentication to SQL 21 54
consuming an asmx web service in winforms application 3 25
Error in JQuery 5 39
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…

867 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

12 Experts available now in Live!

Get 1:1 Help Now