Hyperlink in ASP to another aspx page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fperri
    New Member
    • May 2007
    • 88

    Hyperlink in ASP to another aspx page

    Hi,

    I'm very new to ASP, and I have been thrown into updating a website that was already written in ASP and pushing it to the web for the first time.

    So far, with my old knowledge of html and my somewhat understanding of ASP I've been able to make the updates, but the menu (which is done in JavaScript) is not displaying at all.

    I checked the links to the external javascript (.js) files, double checked that the files were in the proper folders, But it still won't work.

    So I was just going to scrap that menu (since I don't understand how it works) and just manually put the links on the pages for the time being.

    I started with an HTML link and linked it to the "About US" page (it is an aspx page) but when the link is clicked it pops up a download dialog box asking whether you want to open or download it. So I changed it from a regular HTML hyperlink tag to an ASP tag, and now it doesn't do anything at all.

    Please help me! I'm soooooooooooo lost.

    Here is my code for the link.

    <asp:hyperlin k runat="server" navigateurl='./App_Templates/Narrative%20Abo ut%20Us.aspx'>A bout Us</asp:hyperlink>
  • AricC
    Recognized Expert Top Contributor
    • Oct 2006
    • 1885

    #2
    Originally posted by fperri
    Hi,

    I'm very new to ASP, and I have been thrown into updating a website that was already written in ASP and pushing it to the web for the first time.

    So far, with my old knowledge of html and my somewhat understanding of ASP I've been able to make the updates, but the menu (which is done in JavaScript) is not displaying at all.

    I checked the links to the external javascript (.js) files, double checked that the files were in the proper folders, But it still won't work.

    So I was just going to scrap that menu (since I don't understand how it works) and just manually put the links on the pages for the time being.

    I started with an HTML link and linked it to the "About US" page (it is an aspx page) but when the link is clicked it pops up a download dialog box asking whether you want to open or download it. So I changed it from a regular HTML hyperlink tag to an ASP tag, and now it doesn't do anything at all.

    Please help me! I'm soooooooooooo lost.

    Here is my code for the link.

    <asp:hyperlin k runat="server" navigateurl='./App_Templates/Narrative%20Abo ut%20Us.aspx'>A bout Us</asp:hyperlink>
    If you are doing the site in HTML why don't you just use the usual anchor tag <a href="somesite. com">Go To Some Site</a>? That looks like a .net link to me.

    Comment

    • fperri
      New Member
      • May 2007
      • 88

      #3
      Originally posted by AricC
      If you are doing the site in HTML why don't you just use the usual anchor tag <a href="somesite. com">Go To Some Site</a>? That looks like a .net link to me.
      The site is in ASP.net, all the web pages have a .aspx extension.

      I got the links in there now, but I don't understand why - when you click on them, instead of it opeining and displaying the page, it pops up a download box.

      It does this on all my links. But the default.aspx page displays fine.

      ~ Franccesca

      Comment

      • jhardman
        Recognized Expert Specialist
        • Jan 2007
        • 3405

        #4
        Aric's right. I'm sure the <asp:hyperlin k> tag isn't interpreted because the browser has no idea what it should do. change it to:
        [html]<a href="/app_templates/narrative%20abo ut%20us.aspx">A bout Us</a>[/html]

        Jared

        Comment

        • fperri
          New Member
          • May 2007
          • 88

          #5
          Originally posted by jhardman
          Aric's right. I'm sure the <asp:hyperlin k> tag isn't interpreted because the browser has no idea what it should do. change it to:
          [html]<a href="/app_templates/narrative%20abo ut%20us.aspx">A bout Us</a>[/html]

          Jared
          Ok, I changed the link to HTML. It now is displaying just the narrative text of the page - it doesn't apply the ASP template at all.

          Here is what the browser displays now (Exactly as you see it here):
          _______________ _______________ _______________ _______________ ____




          <%@ Page Language="C#" MasterPageFile= "~/App_Templates/Narrative.maste r" Title="Untitled Page" %>

          <asp:Content ID="Content1" ContentPlaceHol derID="ContentP laceHolder1" Runat="Server">



          <p>Intro here ....... p>

          <b>Timelines</b></br>
          <p>Gaining valuable insignt into .......bla bla bla.</p>

          <b>Accuracy & Integrity</b></br>
          <p>Attention to detail ..bla bla bla....</p>

          <b>Competitiv e Connections</b></br>
          <p>.bla bla bla......</p>

          <a href="#">Click here for a list of our products.</a>

          </asp:Content>



          _______________ _______________ _______________ _______________ ____
          And now I'm even more confused....... .why does is say C# as the language at the top of the page when I was told the site was done in ASP?

          I must sound like a moron :P

          I'm sorry, I literally got thown into this without ever coding anything for the web except HTML and javascript rollovers. They hired me to code VB, not ASP. I'm usually ok with doing changes to other people's work, but I don't believe this was ever actually tested live? I mean, the company has never used it - they hired an outside web design company to design it for them. I should have been able to just change the text between the HTML tags, push it to the web and have it work right? Am I mising some configuration file that I didn't FTP over or is there a setting that my host needs? I'm soooooooooooo frustrated.

          Comment

          • jhardman
            Recognized Expert Specialist
            • Jan 2007
            • 3405

            #6
            Ahh. It looks like this was coded in asp.net which can actually use several different languages. (Microsoft decided to change asp over to be part of its .net package, The original asp was strictly coded in vbscript which was very easy for VBers to write.) Anyway, it looks like your server might not understand vb.net (I'm sure I don't understand it that well, but it invloves several files and compilation to binary at one point). Anyway, I'm sorry I'm not much help, but you might want to check with the .net forum to see if they have any ideas.

            Jared

            Comment

            • fperri
              New Member
              • May 2007
              • 88

              #7
              Thanks, I was thinking that its got to be something with our host's server. I'm going to have to give them a call.

              ~ Franccesca

              Comment

              Working...