Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Response.write RecordSet values

Reply
Thread Tools

Response.write RecordSet values

 
 
Fawke101
Guest
Posts: n/a
 
      04-21-2004
Hi there,

I have a page that response.writes a table if certain conditions exist,
What i am trying to do is write a table that also has a text box that
displays a recordset value, is this possible??

***
Response.Write("<input name=Date type=text id=Date>")

what i want is =

Response.Write("<input name=Date type=text id=Date value=<%=RS(Date)%>>")
***

I have tried this and it does not work,
Hope you guys can help

Thanks

--
Thanks in advance

Fawke

Please remove ANTI and SPAM
from my email address before emailing me.

www.bradflack.com


 
Reply With Quote
 
 
 
 
Phill. W
Guest
Posts: n/a
 
      04-21-2004
"Fawke101" <> wrote in message
news:%...
> what i want is =
>
> Response.Write("<input name=Date type=text id=Date value=<%=RS(Date)%>>")


Something like this?
(lines breaks for clarity only).

Response.Write "<input " _
& "name=""Date"" " _
& "type=""text"" " _
& "id=""Date"" " _
& "value=""" & RS( "Date" ).Value & """>"

HTH,
Phill W.


 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      04-21-2004
Yes, you can do this, but you're mixing ASP within ASP there. Remember, <%
%> are the asp delimiters, so since you're response.Writing, you're already
inside a <% %> when you do the <%= %> thing. Two ways:


Response.Write "<input name=Date type=text value=" &
RS.Fields.Items("Date").Value & ">"

or

%>
<!-- now in html, not asp! -->

<input name=Date type=text value=<%=RS.Fields.Item("Date").Value%>>


You should use quote for your attributes in HTML tags, especially for the
value. If your value has a space in it, you won't see anything beyond the
first space. IE:

<input name="something" type="text" value="hi there">
as opposed to
<input name=something type=text value=hi there>

All you'd see in the latter one is "hi," not "hi there."

Ray at work

"Fawke101" <> wrote in message
news:%...
> Hi there,
>
> I have a page that response.writes a table if certain conditions exist,
> What i am trying to do is write a table that also has a text box that
> displays a recordset value, is this possible??
>
> ***
> Response.Write("<input name=Date type=text id=Date>")
>
> what i want is =
>
> Response.Write("<input name=Date type=text id=Date value=<%=RS(Date)%>>")
> ***



 
Reply With Quote
 
Fawke101
Guest
Posts: n/a
 
      04-21-2004
thanks for this guys, got it working

Ray -
I cannot response.write and write the values in there using speech marks,
because the speech/quote marks interfere with the response.write.

Make sense?

--
Thanks in advance

Fawke

Please remove ANTI and SPAM
from my email address before emailing me.

www.bradflack.com
"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:...
> Yes, you can do this, but you're mixing ASP within ASP there. Remember,

<%
> %> are the asp delimiters, so since you're response.Writing, you're

already
> inside a <% %> when you do the <%= %> thing. Two ways:
>
>
> Response.Write "<input name=Date type=text value=" &
> RS.Fields.Items("Date").Value & ">"
>
> or
>
> %>
> <!-- now in html, not asp! -->
>
> <input name=Date type=text value=<%=RS.Fields.Item("Date").Value%>>
>
>
> You should use quote for your attributes in HTML tags, especially for the
> value. If your value has a space in it, you won't see anything beyond the
> first space. IE:
>
> <input name="something" type="text" value="hi there">
> as opposed to
> <input name=something type=text value=hi there>
>
> All you'd see in the latter one is "hi," not "hi there."
>
> Ray at work
>
> "Fawke101" <> wrote in message
> news:%...
> > Hi there,
> >
> > I have a page that response.writes a table if certain conditions exist,
> > What i am trying to do is write a table that also has a text box that
> > displays a recordset value, is this possible??
> >
> > ***
> > Response.Write("<input name=Date type=text id=Date>")
> >
> > what i want is =
> >
> > Response.Write("<input name=Date type=text id=Date

value=<%=RS(Date)%>>")
> > ***

>
>



 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      04-21-2004

"Fawke101" <> wrote in message
news:...
>
> I cannot response.write and write the values in there using speech marks,
> because the speech/quote marks interfere with the response.write.
>
> Make sense?


You can response.write quotes. In VBScript, the way to "escape" quotes is
by doubling them up. Like so:

Response.Write "
You can response.write quotes. In VBScript, the way to ""escape"" quotes is
by doubling them up. Like so:"

Or:

Response.Write "<input name=""theName"" type=""text"" value=""" &
rs.fields.item("date").Value & """>"

Ray at work


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Most popular values in a recordset Eddie ASP General 2 12-13-2005 10:58 AM
Problem filtering recordset by values held in array Tim Pollard ASP General 8 12-03-2004 02:57 PM
Code Help Recordset values ferky Javascript 1 09-13-2004 01:25 PM
RecordSet.Move or RecordSet.AbsolutePosition?? Hung Huynh ASP General 8 09-24-2003 11:07 AM
Inserting text box into a form, displaying values from recordset Bill ASP General 2 07-09-2003 07:46 PM



Advertisments
 



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