Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Display different image between dates using ASP

Reply
Thread Tools

Display different image between dates using ASP

 
 
DavidM
Guest
Posts: n/a
 
      11-03-2004
Hello -- I would like to display a different logo on my website for
different seasons of the month.

I currently have a logo for Halloween, Thanksgiving, and December.

Can someone tell me what VBScript/ASP code I need to display an HTML image.

Basically:
1) any date from 10/01 thru 10/31 I would like to display the Halloween.
2) any date between 11/01 - 11/30, I would like to display Thanksgiven.
3) any date between 12/01 - 12/31, I would like to display the Christmas.

Any help would be appreciated.



 
Reply With Quote
 
 
 
 
DavidM
Guest
Posts: n/a
 
      11-03-2004
I understand that -- but a simple:

If Date > 10/01 And Date < 10/31 Then
Response.write "Display Logo1"
Elese
Response.write "Display Logo 2"
End If

Doesn't work..



"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%...
>a simple IF/THEN with Response.Write() will work if you dont store the info
>in a DB.
>
> --
> Curt Christianson
> Owner/Lead Developer, DF-Software
> Site: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com
>
>
> "DavidM" <> wrote in message
> news:...
>> Hello -- I would like to display a different logo on my website for
>> different seasons of the month.
>>
>> I currently have a logo for Halloween, Thanksgiving, and December.
>>
>> Can someone tell me what VBScript/ASP code I need to display an HTML
>> image.
>>
>> Basically:
>> 1) any date from 10/01 thru 10/31 I would like to display the Halloween.
>> 2) any date between 11/01 - 11/30, I would like to display Thanksgiven.
>> 3) any date between 12/01 - 12/31, I would like to display the Christmas.
>>
>> Any help would be appreciated.
>>
>>
>>

>
>



 
Reply With Quote
 
 
 
 
DavidM
Guest
Posts: n/a
 
      11-03-2004
What if I don't want to hardcode the year?


"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%...
> this works for me
>
> <%
> if Date > "12/1/2004" and Date < "12/31/2004" then
> response.write "yes"
> else
> response.write "no"
> end if
> %>
>
> --
> Curt Christianson
> Owner/Lead Developer, DF-Software
> Site: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com
>
>
> "DavidM" <> wrote in message
> news:%...
>>I understand that -- but a simple:
>>
>> If Date > 10/01 And Date < 10/31 Then
>> Response.write "Display Logo1"
>> Elese
>> Response.write "Display Logo 2"
>> End If
>>
>> Doesn't work..
>>
>>
>>
>> "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
>> news:%...
>>>a simple IF/THEN with Response.Write() will work if you dont store the
>>>info in a DB.
>>>
>>> --
>>> Curt Christianson
>>> Owner/Lead Developer, DF-Software
>>> Site: http://www.Darkfalz.com
>>> Blog: http://blog.Darkfalz.com
>>>
>>>
>>> "DavidM" <> wrote in message
>>> news:...
>>>> Hello -- I would like to display a different logo on my website for
>>>> different seasons of the month.
>>>>
>>>> I currently have a logo for Halloween, Thanksgiving, and December.
>>>>
>>>> Can someone tell me what VBScript/ASP code I need to display an HTML
>>>> image.
>>>>
>>>> Basically:
>>>> 1) any date from 10/01 thru 10/31 I would like to display the
>>>> Halloween.
>>>> 2) any date between 11/01 - 11/30, I would like to display Thanksgiven.
>>>> 3) any date between 12/01 - 12/31, I would like to display the
>>>> Christmas.
>>>>
>>>> Any help would be appreciated.
>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      11-03-2004
Or

Select Case Month(date)
Case 1
Response.write "January"
....
End Select

DavidM wrote:
> What if I don't want to hardcode the year?
>
>
> "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
> news:%...
>> this works for me
>>
>> <%
>> if Date > "12/1/2004" and Date < "12/31/2004" then
>> response.write "yes"
>> else
>> response.write "no"
>> end if
>> %>
>>
>> --
>> Curt Christianson
>> Owner/Lead Developer, DF-Software
>> Site: http://www.Darkfalz.com
>> Blog: http://blog.Darkfalz.com
>>
>>
>> "DavidM" <> wrote in message
>> news:%...
>>> I understand that -- but a simple:
>>>
>>> If Date > 10/01 And Date < 10/31 Then
>>> Response.write "Display Logo1"
>>> Elese
>>> Response.write "Display Logo 2"
>>> End If
>>>
>>> Doesn't work..
>>>
>>>
>>>
>>> "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
>>> news:%...
>>>> a simple IF/THEN with Response.Write() will work if you dont store
>>>> the info in a DB.
>>>>
>>>> --
>>>> Curt Christianson
>>>> Owner/Lead Developer, DF-Software
>>>> Site: http://www.Darkfalz.com
>>>> Blog: http://blog.Darkfalz.com
>>>>
>>>>
>>>> "DavidM" <> wrote in message
>>>> news:...
>>>>> Hello -- I would like to display a different logo on my website
>>>>> for different seasons of the month.
>>>>>
>>>>> I currently have a logo for Halloween, Thanksgiving, and December.
>>>>>
>>>>> Can someone tell me what VBScript/ASP code I need to display an
>>>>> HTML image.
>>>>>
>>>>> Basically:
>>>>> 1) any date from 10/01 thru 10/31 I would like to display the
>>>>> Halloween.
>>>>> 2) any date between 11/01 - 11/30, I would like to display
>>>>> Thanksgiven. 3) any date between 12/01 - 12/31, I would like to
>>>>> display the Christmas.
>>>>>
>>>>> Any help would be appreciated.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
Reply With Quote
 
DavidM
Guest
Posts: n/a
 
      11-04-2004
Ahhh---such an elegant approach.

I like this much better.

strImage="logo_default.gif"
Select Case Month(Date)
Case 10
strImage="logo_oct.gif"
Case 11
strImage="logo_nov.gif"
Case 12
strImage="logo_dec.gif"
End Select

Perfect and makes perfect sense.



"Bob Barrows [MVP]" <> wrote in message
news:...
> Or
>
> Select Case Month(date)
> Case 1
> Response.write "January"
> ...
> End Select
>
> DavidM wrote:
>> What if I don't want to hardcode the year?
>>
>>
>> "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
>> news:%...
>>> this works for me
>>>
>>> <%
>>> if Date > "12/1/2004" and Date < "12/31/2004" then
>>> response.write "yes"
>>> else
>>> response.write "no"
>>> end if
>>> %>
>>>
>>> --
>>> Curt Christianson
>>> Owner/Lead Developer, DF-Software
>>> Site: http://www.Darkfalz.com
>>> Blog: http://blog.Darkfalz.com
>>>
>>>
>>> "DavidM" <> wrote in message
>>> news:%...
>>>> I understand that -- but a simple:
>>>>
>>>> If Date > 10/01 And Date < 10/31 Then
>>>> Response.write "Display Logo1"
>>>> Elese
>>>> Response.write "Display Logo 2"
>>>> End If
>>>>
>>>> Doesn't work..
>>>>
>>>>
>>>>
>>>> "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
>>>> news:%...
>>>>> a simple IF/THEN with Response.Write() will work if you dont store
>>>>> the info in a DB.
>>>>>
>>>>> --
>>>>> Curt Christianson
>>>>> Owner/Lead Developer, DF-Software
>>>>> Site: http://www.Darkfalz.com
>>>>> Blog: http://blog.Darkfalz.com
>>>>>
>>>>>
>>>>> "DavidM" <> wrote in message
>>>>> news:...
>>>>>> Hello -- I would like to display a different logo on my website
>>>>>> for different seasons of the month.
>>>>>>
>>>>>> I currently have a logo for Halloween, Thanksgiving, and December.
>>>>>>
>>>>>> Can someone tell me what VBScript/ASP code I need to display an
>>>>>> HTML image.
>>>>>>
>>>>>> Basically:
>>>>>> 1) any date from 10/01 thru 10/31 I would like to display the
>>>>>> Halloween.
>>>>>> 2) any date between 11/01 - 11/30, I would like to display
>>>>>> Thanksgiven. 3) any date between 12/01 - 12/31, I would like to
>>>>>> display the Christmas.
>>>>>>
>>>>>> Any help would be appreciated.

>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>



 
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
find days between two dates span different years Li Chen Ruby 2 03-04-2010 02:11 AM
RFC-822 dates into Ruby dates kellygreer1 Ruby 1 06-08-2008 10:59 PM
Need to use dates earlier than 1900 (Time library says out of range for dates < 1900) me@benjaminarai.com Ruby 1 07-17-2007 02:25 PM
Dates dates dates dates... SQL and ASP.NET David Lozzi ASP .Net 1 09-30-2005 02:18 PM
Dates! Dates! Dates! PW ASP General 4 08-09-2004 04:42 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