473,382 Members | 1,648 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

problem with request.querystring and date

Bob
Hi,

i want to pass the date/time from one page to another page like this:

firts page:
---------
<asp:HyperLink ID="HyperLink1" NavigateUrl="mypage.aspx?dat= & 'date.now'"
runat="server">lijst</asp:HyperLink>

the code-behind of mypage.aspx
---------------------------------
Dim dd As Date
dd = Date.Parse(Request.QueryString("dat"))

this gives the error: String was not recognized as a valid DateTime

Thanks for help
Bob

Dec 9 '07 #1
3 2592
"Bob" <cq@qs.qdqdwrote in message
news:uH**************@TK2MSFTNGP03.phx.gbl...
this gives the error: String was not recognized as a valid DateTime
What is the value of dat at this point...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Dec 9 '07 #2
Hello Bob
i want to pass the date/time from one page to another page like this:
[...]
this gives the error: String was not recognized as a valid DateTime
Use UrlDecode and UrlEncode.
-
http://msdn2.microsoft.com/en-us/lib...urldecode.aspx
-
http://msdn2.microsoft.com/en-us/lib...urlencode.aspx

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET

Dec 9 '07 #3
Use Server.UrlEncode to encode the date before adding it to the querystring.
When you retrieve it from the querystring, use Server.UrlDecode.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Bob" <cq@qs.qdqdwrote in message
news:uH**************@TK2MSFTNGP03.phx.gbl...
Hi,

i want to pass the date/time from one page to another page like this:

firts page:
---------
<asp:HyperLink ID="HyperLink1" NavigateUrl="mypage.aspx?dat= & 'date.now'"
runat="server">lijst</asp:HyperLink>

the code-behind of mypage.aspx
---------------------------------
Dim dd As Date
dd = Date.Parse(Request.QueryString("dat"))

this gives the error: String was not recognized as a valid DateTime

Thanks for help
Bob
Dec 11 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mikael | last post by:
Hi All! I have a problem here and i can't see what it is... My parameters (value) are shopped off. exampe "Hello world" will end up like "hello" How should i adjust the syntax to get a whole...
0
by: francois | last post by:
hi, I have an ASP.NET application with a piece of code that looks like this: (it is a VB.NET snippet) Thread.CurrentThread.CurrentCulture = New CultureInfo(Session.Item("Culture").ToString)...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
0
by: jegray | last post by:
I am very much a beginner in dealing with connection statments. I am getting the following error: Microsoft OLE DB Provider for ODBC Drivers error '80004005' Data source name not found and no...
3
by: anthonybrough | last post by:
I have an asp page that has a form to collect user data in a form. when the user clicks submit the input is validated. If any fields are not acceptable the user clicks on a button to go back to...
14
by: Simon Gare | last post by:
Hi, have a search.asp page with results.asp page drawing data from an SQL db, problem is the user has to type the whole field value into the search box to retrieve the value on results.asp, what...
5
by: sandipon | last post by:
I have used the following Pagination script to display database records in a series of pages, but only the first page shows up properly, and on clicking the links of subsequent pages or the NEXT ,...
0
by: webaccess | last post by:
Hi Friends ..!! I want to use datagrid/dataview control to data in tablular format,also I want to add paging and format the data of table column. Problem is data is coming from API Dom in as...
2
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.