Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing button's caption on click
Message
 
 
To
14/02/2003 15:20:39
Fabian Belo
Independent Developer
Argentina
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00752305
Message ID:
00753507
Views:
16
Ok, I can not get your code to work in Java script
<% Response.Cookies("verifycookie") = "True" 
 
   If (Request.Cookies("verifycookie") == "True" ) {
      Response.Write ("Browser supports cookie!")}
   else {
     Response.Write ("Browser does not support cookie!")}
 %>
Error Type:
Microsoft JScript compilation (0x800A03EC)
Expected ';'
/nadyatest/buttonchange.asp, line 42, column 47
If (Request.Cookies("verifycookie") == "True") {
What's wrong here?

>I srongly recommend: Do not use Cookies unless you need a lot of vars (like a shopping cart) because there's a lot of programs which block cookies at different levels and it's pretty ugly to tell the user "Please, Enable Cookies". I almost always use Session Variables (Session Vars Junkie), something like Global Vars in VB. Moderation is requiered in order to not affect the site performance. I think there are another ways/issues, this is just my way.
>
>Anyway...my way to verify if cookies are supported:
>
>
>Response.Cookies("verifycookie")="True"
>If Request.Cookies("verifycookie")="True" Then
>      'cookies enabled
>Else
>     'cookies disabled
>End If
>
>
>
>
>>>>Quick test, if browser accepts cookies or not: if HTTP_COOKIE value is not empty, it means, that client supports cookies, right?
>>>
>>>Nadya;
>>>
>>>I have not used HTTP_COOKIE. You might give this a try although your example might work.
>>>
>>>
>>>if(Request.Browser.Cookies)
>>>{
>>>   //... Your code goes here
>>>}
>>>
>>>
>>>Tom
>>Error Type:
>>Microsoft JScript runtime (0x800A138F)
>>'Request.Browser.Cookies' is null or not an object
>>/nadyatest/buttonchange.asp, line 39
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform