Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default response.write URL

    I have a page which lists conferences and events which the company for which I
    coded the site attends or hosts themselves. They want to be able to continue
    to list the conferences and events after the date but they want the link
    removed. I've been able to get an if then else to filter out the links but I
    can't get the link properly written into the page using response.write. The
    quotation marks for the HTML attributes are interfering with the quotation
    marks for the server side call for the URL listed in the database. I've
    attached the code I've got partially working below. If anyone has any ideas as
    to how I might fix this code or perhaps a better approach to the problem I'd
    appreciate it.



    <td><h3><span
    class="green_hghlt"><%=(rs_conferences.Fields.Item ("confDate").Value)%> -
    <%=(rs_conferences.Fields.Item("confLocation").Val ue)%></span><br />
    <span
    class="blue_hghlt"><%=(rs_conferences.Fields.Item( "confTitle").Value)%></span></
    h3>
    <p><%=(rs_conferences.Fields.Item("confSummary").V alue)%></p>
    <% if rs_conferences.Fields.Item("confLink").Value <> " " then
    Response.Write "<div id=" & "css_button" & "><p><a href=" &
    "(rs_conferences.Fields.Item(" & "confLink" & ").Value)" & " target=" &
    "_blank" & " class=" & "link_highlight" & ">sign up for the
    conference...</a></p></div>"
    end if %>
    </td>

    s_mccoy Guest

  2. Similar Questions and Discussions

    1. If response.write help
      Hi, I am trying to code my asp page so that if you are on page Y, the link to page Y in the nav, is in the over state to help users identify where...
    2. quotes in response.write
      Hi there, I want to do: response.write("bla bla bla "in quotes" bla bla") How do I show the quotes on the screen in asp like I have to do \"...
    3. Response.Write not working
      Hello, in my ASP.NET c# project I can ouput text using response.write from the code behind class. It works in the aspx file using <asp:TextBox>...
    4. Response.Write and Response.Redirect
      On my Page_Load event, i need to do some validation and then either let them proceed, or display a error message and boot them back to the previous...
    5. asp response.write doesn't display
      Maybe you could start with a more barebones file, especially one without an unclosed LINK tag:
  3. #2

    Default Re: response.write URL

    *bump* Anyone know of a fix for this problem?
    s_mccoy Guest

  4. #3

    Default Re: response.write URL

    *bump* I really gotta get his issue resolved. Does no one know how to do this?
    s_mccoy Guest

  5. #4

    Default Re: response.write URL

    ..oO(s_mccoy)
    >[...] The
    >quotation marks for the HTML attributes are interfering with the quotation
    >marks for the server side call for the URL listed in the database. I've
    >attached the code I've got partially working below. If anyone has any ideas as
    >to how I might fix this code or perhaps a better approach to the problem I'd
    >appreciate it.
    I'm not familiar with ASP, so this is just a wild guess ...

    [...]
    Response.Write "<div class='css_button'><a href='" &
    rs_conferences.Fields.Item("confLink").Value &
    "' target='_blank'>sign up for the conference</a></div>"
    [...]

    Three additional changes I made:

    * 'css_button' should most likely be a class, not an ID as it was in
    your code (an ID has to be unique throughout a document).
    * The paragraph inside of the div is not necessary, styling can be
    applied with the class 'css_button'.
    * The class 'link_highlight' can most likely be removed. If you have to
    style the link you can do it in your CSS with

    .css_button a {...}

    And I would also remove the target attribute, because opening new
    windows sucks. But that's just my personal opinion.

    HTH
    Micha
    Michael Fesser Guest

  6. #5

    Default Re: response.write URL

    Micha,

    It turns out that the first div is not necessary. I think it was left behind
    when I rewrote the way the buttons worked to fix another issue elsewhere on the
    site. I still need the <p> tag to force that particular button to sit where it
    does. If I pad the button it breaks buttons elsewhere on the site. Either
    way, after doing a little clean up it didn't resolve my issue with the dynamic
    a href (no surprise there). Thanks for your reply though.

    s_mccoy Guest

  7. #6

    Default Re: response.write URL

    Never mind, problem solved. If anyone runs across this issue, you have to
    declare the recordset as a variable and call the variable. if you try to call
    the recordset twice, asp will ignore the second call. If you use a variable it
    only makes the connection once and reuses the value wherever you need to. In
    the case above I simply added <blockquote> confLinkURL =
    (rs_conferences.Fields.Item("confLink").Value)</blockquote>and replacced all
    instances of (rs_conferences.Fields.Item("confLink").Value) with confLinkURL.

    s_mccoy Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139