<A href= links dont always render properly on my .aspx pages

Discussion in 'ASP .Net' started by Brian Watkins, Dec 31, 2003.

  1. Hello All,

    I have a a file display page that contains two frames. In the left
    frame is a tree view that lists a directory and all its subfolders. Each
    node in the left frames tree is a link that when clicked displays links to
    all the files in the right frame for the folder clicked. The problem I
    have is that some of the links don't work and some do. It seems like the <A
    href only renders when it wants to. Has anyone seen this before? Thanks
    in advance!
     
    Brian Watkins, Dec 31, 2003
    #1
    1. Advertising

  2. In article <O8POX#>,
    says...
    > Hello All,
    >
    > I have a a file display page that contains two frames. In the left
    > frame is a tree view that lists a directory and all its subfolders. Each
    > node in the left frames tree is a link that when clicked displays links to
    > all the files in the right frame for the folder clicked. The problem I
    > have is that some of the links don't work and some do. It seems like the <A
    > href only renders when it wants to. Has anyone seen this before? Thanks
    > in advance!


    Perhaps the <A> tags are being constructed properly. Can you show us a
    sample of the rendered HTML?

    --
    Patrick Steele
    Microsoft .NET MVP
    http://weblogs.asp.net/psteele
     
    Patrick Steele [MVP], Dec 31, 2003
    #2
    1. Advertising

  3. Patrick,

    Thanks for your response!
    Here is the HTML output:

    1 <Table bgColor=000066 width=100%>
    2 <tr>
    3 <td>
    4 <table bgColor=FFFFFF align=left width=100% cellpadding=1
    cellspacing=1>
    5 <tr>
    6 <th width=50%><b><FONT face='Times New Roman'>Name</th><th
    align='center' width=6%><b><FONT face='Times New Roman'>Size</th>
    7 <th align='center' width=23%><b><FONT face='Times New
    Roman'>Last Modified</th>
    8 <th align='center' width=23%><b><FONT face='Times New
    Roman'>Date Created</th>
    9 </tr>
    10 <tr bgcolor='#FFFFFF'>
    11 <td><a
    href='ShowFiles.aspx?Path=http://intranet/Documents/HR/Benefit SPDs and
    Documents' >Benefit SPDs and Documents</a></td>
    12 </tr>
    13 <tr bgcolor='#FFFFFF'>
    14 <td><a
    href='ShowFiles.aspx?Path=http://intranet/Documents/HR/Employee Handbook'
    >Employee Handbook</a></td>

    15 </tr>
    16 <tr bgcolor='#FFFFFF'>
    17 <td><a
    href='ShowFiles.aspx?Path=http://intranet/Documents/HR/Holiday Schedules'
    >Holiday Schedules</a></td>

    18 </tr>
    19 <tr bgcolor='#FFFFFF'>
    20 <td><a
    href='ShowFiles.aspx?Path=http://intranet/Documents/HR/HR Forms' >HR
    Forms</a></td>
    21 </tr>
    22 <tr bgcolor='#FFFFFF'>
    23 <td><a
    href='ShowFiles.aspx?Path=http://intranet/Documents/HR/Mgrs Policy and
    Procedure</a></td>
    24 </tr>
    25 </table>
    26 </td>
    27 </tr>
    28 </table>


    The links on lines 11, 14, and 17 didn't work( in this case), but the links
    on lines 20 and 23 work fine. I am using the response.write method within
    a function called by the page_load subroutine.

    The links that dont work look like links (ie undelined) but can't be clicked
    on.
     
    Brian Watkins, Dec 31, 2003
    #3
  4. In article <>,
    says...
    > 11 <td><a
    > href='ShowFiles.aspx?Path=http://intranet/Documents/HR/Benefit SPDs and
    > Documents' >Benefit SPDs and Documents</a></td>


    The 'Path' parameter is not properly HTML encoded (it contains spaces
    and slashes). You need to use HttpUtility.HtmlEncode to make sure the
    parameter data is properly formatted to HTML.

    --
    Patrick Steele
    Microsoft .NET MVP
    http://weblogs.asp.net/psteele
     
    Patrick Steele [MVP], Dec 31, 2003
    #4
  5. Patrick,

    Well if I don't know how to properly format a <A> by now I'm in trouble.
    Its funny because all the links are response.write to the page. This
    behaviour only occurs if I try to fill both frames with links at the same
    time. The exact code works if I fill the left frame links and fill the
    right frame based on a left frame click. But if I attempt to run both pages
    at the same time it doesn't work. Only some of the <A> tags render
    properly. Its almost as if the pages dont finish loading.
     
    Brian Watkins, Jan 5, 2004
    #5
  6. In article <>,
    says...
    > Well if I don't know how to properly format a <A> by now I'm in trouble.


    No offense was meant. When answering questions, I can't really assume
    too much about the posters knowledge in *all* fields. :)

    Did you see my other reply that the parameters of the HREF were not
    properly HTML encoded?

    --
    Patrick Steele
    Microsoft .NET MVP
    http://weblogs.asp.net/psteele
     
    Patrick Steele [MVP], Jan 6, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    556
    Juan T. Llibre [MVP]
    Dec 14, 2004
  2. =?Utf-8?B?SmFycm9k?=

    Aspx Pages dont work on Server

    =?Utf-8?B?SmFycm9k?=, Nov 10, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    626
    =?Utf-8?B?SmFycm9k?=
    Nov 10, 2005
  3. CRON
    Replies:
    24
    Views:
    203,871
    Adrienne Boswell
    Jun 20, 2006
  4. Replies:
    2
    Views:
    320
    Ben C
    Oct 9, 2006
  5. RadioSignal

    passing variables from .aspx.cs code pages to .aspx pages

    RadioSignal, Sep 12, 2005, in forum: ASP .Net Web Controls
    Replies:
    7
    Views:
    2,387
    Mirronelli
    Oct 22, 2005
Loading...

Share This Page