displaying asp variable stored in db in an asp page

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default displaying asp variable stored in db in an asp page

    I am modifiying a database driven application. I need to store the
    following information and then have it shown in an asp page.

    <table width="100%" cellspacing="2" cellpadding="2" border="0">
    <tr>
    <td>
    <span class="Normal">
    Meeting:
    </span>
    </td>
    <td colspan="3">
    <span class="Normal">
    <b><%=strMeetingTitle%></b>
    </span>
    </td>
    </tr>
    </table>

    When I load the page the section where the table should show is blank.
    When I view source I see exactly the same code as above.

    So - it is not interpreting the <%=%> as response.write the variable
    strMeetingTitle that is set in the page before this database part is
    written.

    Any ideas on how to get this to work?

    Thanks!!!




    Jennifer Smith Guest

  2. Similar Questions and Discussions

    1. Coldfusion expression stored inside a variable...
      I have a Coldfusion expression stored inside a coldfusion variable, for example: <cfsavecontent time = #CreateODBCDateTime(now())#> if i do not...
    2. Stored Procedure Result Variable
      I am having trouble returning variables from my stored procedures. My CFML and SP code is attached. The error is always: Attribute validation...
    3. HELP : problem with sessions, and php code stored within a variable
      I am getting the following error on a peice of code of mine: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or...
    4. How can I execute code stored in variable
      > Something like ***execute()***, but instead of executing shell oops! By execute() I meant exec() or passthru(). It was very late when I...
    5. can i get the html that a page creates stashed off in a variable to be stored later
      You should be able to override the Render method of your page object and get the final output from there. Here's more info:...
  3. #2

    Default Re: displaying asp variable stored in db in an asp page

    Is this a page with a .ASP extension?

    Ray at work

    "Jennifer Smith" <jennifer@nospam.com> wrote in message
    news:403E69EC.72BC0CA@nospam.com...
    > I am modifiying a database driven application. I need to store the
    > following information and then have it shown in an asp page.
    >
    > <table width="100%" cellspacing="2" cellpadding="2" border="0">
    > <tr>
    > <td>
    > <span class="Normal">
    > Meeting:
    > </span>
    > </td>
    > <td colspan="3">
    > <span class="Normal">
    > <b><%=strMeetingTitle%></b>
    > </span>
    > </td>
    > </tr>
    > </table>
    >
    > When I load the page the section where the table should show is blank.
    > When I view source I see exactly the same code as above.
    >
    > So - it is not interpreting the <%=%> as response.write the variable
    > strMeetingTitle that is set in the page before this database part is
    > written.
    >
    > Any ideas on how to get this to work?
    >
    > Thanks!!!
    >
    >
    >
    >

    Ray at Guest

  4. #3

    Default Re: displaying asp variable stored in db in an asp page

    Yes.

    "Ray at <%=sLocation%> [MVP]" wrote:
    > Is this a page with a .ASP extension?
    >
    > Ray at work
    >
    > "Jennifer Smith" <jennifer@nospam.com> wrote in message
    > news:403E69EC.72BC0CA@nospam.com...
    > > I am modifiying a database driven application. I need to store the
    > > following information and then have it shown in an asp page.
    > >
    > > <table width="100%" cellspacing="2" cellpadding="2" border="0">
    > > <tr>
    > > <td>
    > > <span class="Normal">
    > > Meeting:
    > > </span>
    > > </td>
    > > <td colspan="3">
    > > <span class="Normal">
    > > <b><%=strMeetingTitle%></b>
    > > </span>
    > > </td>
    > > </tr>
    > > </table>
    > >
    > > When I load the page the section where the table should show is blank.
    > > When I view source I see exactly the same code as above.
    > >
    > > So - it is not interpreting the <%=%> as response.write the variable
    > > strMeetingTitle that is set in the page before this database part is
    > > written.
    > >
    > > Any ideas on how to get this to work?
    > >
    > > Thanks!!!
    > >
    > >
    > >
    > >
    Jennifer Smith Guest

  5. #4

    Default Re: displaying asp variable stored in db in an asp page

    Is it on an IIS server? Tell us about the server.

    Ray at work

    "Jennifer Smith" <jennifer@nospam.com> wrote in message
    news:403E6DA8.A4A02C0A@nospam.com...
    > Yes.
    >
    > "Ray at <%=sLocation%> [MVP]" wrote:
    >
    > > Is this a page with a .ASP extension?
    > >
    > > Ray at work
    > >
    > > "Jennifer Smith" <jennifer@nospam.com> wrote in message
    > > news:403E69EC.72BC0CA@nospam.com...
    > > > I am modifiying a database driven application. I need to store the
    > > > following information and then have it shown in an asp page.
    > > >
    > > > <table width="100%" cellspacing="2" cellpadding="2" border="0">
    > > > <tr>
    > > > <td>
    > > > <span class="Normal">
    > > > Meeting:
    > > > </span>
    > > > </td>
    > > > <td colspan="3">
    > > > <span class="Normal">
    > > > <b><%=strMeetingTitle%></b>
    > > > </span>
    > > > </td>
    > > > </tr>
    > > > </table>
    > > >
    > > > When I load the page the section where the table should show is blank.
    > > > When I view source I see exactly the same code as above.
    > > >
    > > > So - it is not interpreting the <%=%> as response.write the variable
    > > > strMeetingTitle that is set in the page before this database part is
    > > > written.
    > > >
    > > > Any ideas on how to get this to work?
    > > >
    > > > Thanks!!!
    > > >
    > > >
    > > >
    > > >
    >

    Ray at Guest

  6. #5

    Default Re: displaying asp variable stored in db in an asp page

    p.s.

    In IIS manager, pull up the properties of your site or application. Click
    "Configuration" in the Application Settings area. In the Application
    Mappings, there should be an entry like:

    Extension Executeable Path Verbs
    ..asp C:\Winnt\System32\inetsrv\asp.dll GET,HEAD,POST,TRACE

    This assumes that your %systemroot% is C:\Winnt.

    Ray at work


    "Jennifer Smith" <jennifer@nospam.com> wrote in message
    news:403E6DA8.A4A02C0A@nospam.com...
    > Yes.
    >
    > "Ray at <%=sLocation%> [MVP]" wrote:
    >
    > > Is this a page with a .ASP extension?
    > >
    > > Ray at work
    > >
    > > "Jennifer Smith" <jennifer@nospam.com> wrote in message
    > > news:403E69EC.72BC0CA@nospam.com...
    > > > I am modifiying a database driven application. I need to store the
    > > > following information and then have it shown in an asp page.
    > > >
    > > > <table width="100%" cellspacing="2" cellpadding="2" border="0">
    > > > <tr>
    > > > <td>
    > > > <span class="Normal">
    > > > Meeting:
    > > > </span>
    > > > </td>
    > > > <td colspan="3">
    > > > <span class="Normal">
    > > > <b><%=strMeetingTitle%></b>
    > > > </span>
    > > > </td>
    > > > </tr>
    > > > </table>
    > > >
    > > > When I load the page the section where the table should show is blank.
    > > > When I view source I see exactly the same code as above.
    > > >
    > > > So - it is not interpreting the <%=%> as response.write the variable
    > > > strMeetingTitle that is set in the page before this database part is
    > > > written.
    > > >
    > > > Any ideas on how to get this to work?
    > > >
    > > > Thanks!!!
    > > >
    > > >
    > > >
    > > >
    >

    Ray at Guest

  7. #6

    Default Re: displaying asp variable stored in db in an asp page

    Hi Jennifer,

    Do you mean that "<%=strMeetingTitle%>" works in Response.Write, however,
    it doesn't work in that table?

    Thanks.

    Best regards,
    Yanhong Huang
    Microsoft Community Support

    Get Secure! ¨C [url]www.microsoft.com/security[/url]
    This posting is provided "AS IS" with no warranties, and confers no rights.

    Yan-Hong Huang[MSFT] Guest

  8. #7

    Default Re: displaying asp variable stored in db in an asp page

    I hope this will explain it better.

    On my asp page I have a database query where retrieve values. One of the
    fields is called - lets say - header_field

    header_field has the the following code:
    <table width="100%" cellspacing="2" cellpadding="2" border="0">
    <tr>
    <td>
    <span class="Normal">
    Meeting:
    </span>
    </td>
    <td colspan="3">
    <span class="Normal">
    <b><%=strMeetingTitle%></b>
    </span>
    </td>
    </tr>
    </table>

    When the database field - rs("header_field") is written to the page - it shows
    the table as is, and the <%=%> is not taken as an asp variable.

    Hope that explains better :)

    "Yan-Hong Huang[MSFT]" wrote:
    > Hi Jennifer,
    >
    > Do you mean that "<%=strMeetingTitle%>" works in Response.Write, however,
    > it doesn't work in that table?
    >
    > Thanks.
    >
    > Best regards,
    > Yanhong Huang
    > Microsoft Community Support
    >
    > Get Secure! ¨C [url]www.microsoft.com/security[/url]
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    Jennifer Smith Guest

  9. #8

    Default Re: displaying asp variable stored in db in an asp page

    You see <%=strMeetingTitle%> in a view source? Is that what you're saying?
    Did you read and consider my other two posts?

    Ray at work

    "Jennifer Smith" <jennifer@nospam.com> wrote in message
    news:403F621A.C87CEAF8@nospam.com...
    > I hope this will explain it better.
    >
    > On my asp page I have a database query where retrieve values. One of the
    > fields is called - lets say - header_field
    >
    > header_field has the the following code:
    > <table width="100%" cellspacing="2" cellpadding="2" border="0">
    > <tr>
    > <td>
    > <span class="Normal">
    > Meeting:
    > </span>
    > </td>
    > <td colspan="3">
    > <span class="Normal">
    > <b><%=strMeetingTitle%></b>
    > </span>
    > </td>
    > </tr>
    > </table>
    >
    > When the database field - rs("header_field") is written to the page - it
    shows
    > the table as is, and the <%=%> is not taken as an asp variable.
    >
    > Hope that explains better :)
    >
    > "Yan-Hong Huang[MSFT]" wrote:
    >
    > > Hi Jennifer,
    > >
    > > Do you mean that "<%=strMeetingTitle%>" works in Response.Write,
    however,
    > > it doesn't work in that table?
    > >
    > > Thanks.
    > >
    > > Best regards,
    > > Yanhong Huang
    > > Microsoft Community Support
    > >
    > > Get Secure! ¨C [url]www.microsoft.com/security[/url]
    > > This posting is provided "AS IS" with no warranties, and confers no
    rights.
    >

    Ray at Guest

  10. #9

    Default Re: displaying asp variable stored in db in an asp page

    Windows2000 using iis5 - and I checked the configuration. It is as you
    mentioned in your post.

    I think the problem is I am trying to display a variable in a variable :P

    And yes I see <%=strMeetingTitle%> in a view source.

    "Ray at <%=sLocation%> [MVP]" wrote:
    > You see <%=strMeetingTitle%> in a view source? Is that what you're saying?
    > Did you read and consider my other two posts?
    >
    > Ray at work
    >
    > "Jennifer Smith" <jennifer@nospam.com> wrote in message
    > news:403F621A.C87CEAF8@nospam.com...
    > > I hope this will explain it better.
    > >
    > > On my asp page I have a database query where retrieve values. One of the
    > > fields is called - lets say - header_field
    > >
    > > header_field has the the following code:
    > > <table width="100%" cellspacing="2" cellpadding="2" border="0">
    > > <tr>
    > > <td>
    > > <span class="Normal">
    > > Meeting:
    > > </span>
    > > </td>
    > > <td colspan="3">
    > > <span class="Normal">
    > > <b><%=strMeetingTitle%></b>
    > > </span>
    > > </td>
    > > </tr>
    > > </table>
    > >
    > > When the database field - rs("header_field") is written to the page - it
    > shows
    > > the table as is, and the <%=%> is not taken as an asp variable.
    > >
    > > Hope that explains better :)
    > >
    > > "Yan-Hong Huang[MSFT]" wrote:
    > >
    > > > Hi Jennifer,
    > > >
    > > > Do you mean that "<%=strMeetingTitle%>" works in Response.Write,
    > however,
    > > > it doesn't work in that table?
    > > >
    > > > Thanks.
    > > >
    > > > Best regards,
    > > > Yanhong Huang
    > > > Microsoft Community Support
    > > >
    > > > Get Secure! ¨C [url]www.microsoft.com/security[/url]
    > > > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    > >
    Jennifer Smith Guest

  11. #10

    Default Re: displaying asp variable stored in db in an asp page

    If you are seeing <%=strMeetingTitle%> in a view source, your page is NOT
    being processed by the asp engine. This is why I posted the other things I
    posted, asking if you're on an IIS server, if this is an ASP page, if you
    have the .asp extension mapped to asp.dll...

    Ray at work

    "Jennifer Smith" <jennifer@nospam.com> wrote in message
    news:403F69D6.4763142B@nospam.com...
    > Windows2000 using iis5 - and I checked the configuration. It is as you
    > mentioned in your post.
    >
    > I think the problem is I am trying to display a variable in a variable :P
    >
    > And yes I see <%=strMeetingTitle%> in a view source.
    >
    > "Ray at <%=sLocation%> [MVP]" wrote:
    >
    > > You see <%=strMeetingTitle%> in a view source? Is that what you're
    saying?
    > > Did you read and consider my other two posts?
    > >
    > > Ray at work
    > >
    > > "Jennifer Smith" <jennifer@nospam.com> wrote in message
    > > news:403F621A.C87CEAF8@nospam.com...
    > > > I hope this will explain it better.
    > > >
    > > > On my asp page I have a database query where retrieve values. One of
    the
    > > > fields is called - lets say - header_field
    > > >
    > > > header_field has the the following code:
    > > > <table width="100%" cellspacing="2" cellpadding="2" border="0">
    > > > <tr>
    > > > <td>
    > > > <span class="Normal">
    > > > Meeting:
    > > > </span>
    > > > </td>
    > > > <td colspan="3">
    > > > <span class="Normal">
    > > > <b><%=strMeetingTitle%></b>
    > > > </span>
    > > > </td>
    > > > </tr>
    > > > </table>
    > > >
    > > > When the database field - rs("header_field") is written to the page -
    it
    > > shows
    > > > the table as is, and the <%=%> is not taken as an asp variable.
    > > >
    > > > Hope that explains better :)
    > > >
    > > > "Yan-Hong Huang[MSFT]" wrote:
    > > >
    > > > > Hi Jennifer,
    > > > >
    > > > > Do you mean that "<%=strMeetingTitle%>" works in Response.Write,
    > > however,
    > > > > it doesn't work in that table?
    > > > >
    > > > > Thanks.
    > > > >
    > > > > Best regards,
    > > > > Yanhong Huang
    > > > > Microsoft Community Support
    > > > >
    > > > > Get Secure! ¨C [url]www.microsoft.com/security[/url]
    > > > > This posting is provided "AS IS" with no warranties, and confers no
    > > rights.
    > > >
    >

    Ray at Guest

  12. #11

    Default Re: displaying asp variable stored in db in an asp page

    Hi Jennifer,

    I totally agree with Ray here. If ASP engineer works well, it will parse
    <%=strMeetingTitle%> correctly in server side and render it to
    corresponding HTML in client side. If you still see <%=strMeetingTitle%> in
    view->source, that means the variable is not rendered correctly in server
    side.

    So what we need to do is:
    1) Check whether web server supports ASP programming
    2) Check whether .ASP file is mapped correctly in web server

    Thanks.

    Best regards,
    Yanhong Huang
    Microsoft Community Support

    Get Secure! ¨C [url]www.microsoft.com/security[/url]
    This posting is provided "AS IS" with no warranties, and confers no rights.

    Yan-Hong Huang[MSFT] Guest

  13. #12

    Default Re: displaying asp variable stored in db in an asp page

    Hello Jennifer

    Maybe I'm way off base here...

    Are you storing vbscript code inside of ASP delimiters as part of a string contained
    in the database? I don't think you can Response.Write the string that you return from
    the db and expect the asp portions inside the string to execute. Won't the browser
    just render the <%=strMeetingTitle%> as text?

    Perhaps you could replace <%=strMeetingTitle%> in the database with a token, and then
    before writing it to the page do something like

    str = Replace(rs("header_field"), "<<token>>", strMeetingTitle))
    Response.Write str

    --
    HTH,
    Stephen


    "Jennifer Smith" <jennifer@nospam.com> wrote in message
    news:403F621A.C87CEAF8@nospam.com...
    > I hope this will explain it better.
    >
    > On my asp page I have a database query where retrieve values. One of the
    > fields is called - lets say - header_field
    >
    > header_field has the the following code:
    > <table width="100%" cellspacing="2" cellpadding="2" border="0">
    > <tr>
    > <td>
    > <span class="Normal">
    > Meeting:
    > </span>
    > </td>
    > <td colspan="3">
    > <span class="Normal">
    > <b><%=strMeetingTitle%></b>
    > </span>
    > </td>
    > </tr>
    > </table>
    >
    > When the database field - rs("header_field") is written to the page - it shows
    > the table as is, and the <%=%> is not taken as an asp variable.
    >
    > Hope that explains better :)
    >
    > "Yan-Hong Huang[MSFT]" wrote:
    >
    > > Hi Jennifer,
    > >
    > > Do you mean that "<%=strMeetingTitle%>" works in Response.Write, however,
    > > it doesn't work in that table?
    > >
    > > Thanks.
    > >
    > > Best regards,
    > > Yanhong Huang
    > > Microsoft Community Support
    > >
    > > Get Secure! ¨C [url]www.microsoft.com/security[/url]
    > > This posting is provided "AS IS" with no warranties, and confers no rights.
    >

    Stephen Willingham 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