Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,153,133 members, 7,818,413 topics. Date: Sunday, 05 May 2024 at 02:46 PM |
Nairaland Forum / Science/Technology / Programming / Helpppppppppppp! Asp.net Code Issue (772 Views)
C# - Capturing File Name From A FileUpload Control In Asp.net / Tutorial: How To Return Html In Json Response Using Asp.net And Jquery / Vb.net Code To Display Image In Picturebox From Sql Server (2) (3) (4)
Helpppppppppppp! Asp.net Code Issue by spora1: 3:26pm On Sep 18, 2009 |
A friend is having issue on the code below. There are two forms on the server, the old and the new form, when the created date is greater than 16, the computer should load the first form and load the second form if otherwise but the computer keeps loading the first form <% if CreatedDate > 2009-09-16 then%> onClick="document.form.action='/Intranet/HRForms/formstest/<%=formNameLink%>.asp?pv=1&formID=<%=rs("formID"%>&code=<%=rs("code"%>'"> <%else%> onClick="document.form.action='/Intranet/HRForms/forms/<%=formNameLink%>.asp?pv=1&formID=<%=rs("formID"%>&code=<%=rs("code"%>'"> <%end if%> What do you think is wrong pleaseeeeeeeeeeeeeeeeeeee |
Re: Helpppppppppppp! Asp.net Code Issue by Kobojunkie: 3:33pm On Sep 18, 2009 |
<% if CreatedDate > 2009-09-16 then%> onClick="document.form.action='/Intranet/HRForms/formstest/<%=formNameLink%>.asp?pv=1&formID=<%=rs("formID"%>&code=<%=rs("code"%>'"> <%else%> onClick="document.form.action='/Intranet/HRForms/forms/<%=formNameLink%>.asp?pv=1&formID=<%=rs("formID"%>&code=<%=rs("code"%>'"> <%end if%> @Poster, why not do this neatly in backend code. As for your if statement above, your comparison there is likely being handled as string to string comparison and not Date to Date. If you cast both to date and try again, it will likely work. |
Re: Helpppppppppppp! Asp.net Code Issue by spora1: 3:50pm On Sep 18, 2009 |
Tx Kobo, Pls, how can he do the casting? He is really new in asp Please, help |
Re: Helpppppppppppp! Asp.net Code Issue by Kobojunkie: 4:01pm On Sep 18, 2009 |
Convert.ToDateTime(CreateDate) |
(1) (Reply)
I Need Help / Online Business Directory Script / Nigerian Developer.. What Should We Develop For, Money, Fame Or Fun
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9 |