Get Date on query string in asp.net c#

Rajaa Khalifeh

New Member
I am trying to send date format with dd/mm/yyyy in a hyperlink field to another page , on page load for the other form am trying to get this date using query string but it is not working with me..


GridView Data:


C#:
<asp:HyperLinkField Text="Edit" Target="_blank" DataNavigateUrlFields="PackageId,StdId,CoachName,StdName,Sessions#,start_Date,Status,Remark" 
DataNavigateUrlFormatString="EditAddPack.aspx?PackageId={0}&StdId={1}&CoachName={2}&StdName={3}&Sessions#={4}&start_Date={5:dd/MM/yyyy}&Status={6}&Remark={7}" />

and on page load of the other form :


C#:
editstarttxt.Text = Convert.ToDateTime(Request.QueryString["start_Date"]).ToString("dd/MM/yyyy")
// the value that

i get is 01/11/0001 which is not the date ,

i also tried this but also an error occurs

C#:
DateTime.ParseExact(Request.QueryString["start_Date"].ToString(),"dd/MM/yyyy",null).ToString("yyyy-MM-dd"));

also didn't work
 
Top