Solved

Members only section in Website C#

Posted on 2012-03-22
3
253 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 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 55

Expert Comment

by:Huseyin KAHRAMAN
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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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 integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

691 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