?
Solved

Members only section in Website C#

Posted on 2012-03-22
3
Medium Priority
?
257 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Accepted Solution

by:
Lalit Chandra earned 2000 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 57

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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
Suggested Courses

771 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