Rajaa Khalifeh

Rajaa Khalifeh

  • NA
  • 53
  • 6.1k

Get Date on query string in asp.net c#

Apr 19 2020 9:18 AM
I am trying to send date format with dd/mm/yyyy in a hypelink field to another page , on page load for the b form iam trying t get this date but it is not working with me..
 
GridView Data:
  1. <asp:HyperLinkField Text="Edit" Target="_blank" DataNavigateUrlFields="PackageId,StdId,CoachName,StdName,Sessions#,start_Date,Status,Remark"  
  2. DataNavigateUrlFormatString="EditAddPack.aspx?PackageId={0}&StdId={1}&CoachName={2}&StdName={3}&Sessions#={4}&start_Date={5:dd/MM/yyyy}&Status={6}&Remark={7}" />  
and the another form :
 
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
 
DateTime.ParseExact(Request.QueryString["start_Date"].ToString(),"dd/MM/yyyy",null).ToString("yyyy-MM-dd"));
 
also didn't work

Answers (2)