Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > i used the following code in .aspx file but gave error

Reply
Thread Tools

i used the following code in .aspx file but gave error

 
 
gaurav1234 gaurav1234 is offline
Junior Member
Join Date: Jul 2010
Posts: 1
 
      07-07-2010
hi i hv 2 doubts

(1) System.InvalidCastException: Operator '&' is not defined for string "fname=" and type 'HttpCookie'.Plz explain why so and how to correct it explicitly

<html>
<body>

<%
dim x,y
for each x in Request.Cookies
response.write("<p>")
if Request.Cookies(x).HasKeys then
for each y in Request.Cookies(x)
response.write(x & ":" & y & "=" & Request.Cookies(x)(y))
response.write("<br />")
next
else
Response.Write(x & "=" & Request.Cookies(x) & "<br />")
end if
response.write ("</p>")
next
%>

</body>
</html>
(2)the following statement gave an error in .aspx file.
response.cookies("NumVisits")=1
I found that it is corrected if value is used. why is this difference between asp and asp.net
response.cookies("NumVisits").value=1
 
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
The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/822319ev1'. 'HTTP/1.1 500 Internal Server Error'. chanmm ASP .Net 2 09-07-2010 07:37 AM
How to compile the following source code in VC6// I have error inVC++6 but compile ok in GCC fAnSKyer C++ 2 06-07-2009 07:57 AM
Gave away 10 CDs damon Firefox 0 11-04-2004 02:11 PM
GAVE WRONG WINDOWS MEDIA FILE INFORMATION...STILL NEED HELP nadine Computer Support 7 08-01-2004 01:43 AM
RE: The Web server reported the following error when attempting to create or open the Web project located at the following URL: <URL> =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?= ASP .Net 0 06-07-2004 07:36 AM



Advertisments