Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I developed a c# web application in Visual Studio 2012 that uses devExpress 2012 controls. A user captures information and selects a date from a devexpress ASPxDateEdit, saves the information, and it gets displayed on a gridview on another web form. When updating the date, the user clicks on the gridview row and data including the date previously captured on the devexpress ASPxDateEdit is populated using querystring as shown below:
C#
string TrainingStartDate = grid.GetRowValuesByKeyValue(id, "TrainingStartDate").ToString();

C#
Response.Redirect("ExistingCampaign.aspx?EmployeeID=" + EmployeeID"CampaignName=" + CampaignID + "&NoOfAgentsRequired=" + NoOfAgentsRequired +"&TrainingStartDate=" + TrainingStartDate);

The below code is on the load of the ExistingCampaign.aspx page that receives the data:
C#
string EmployeeID = Request.QueryString["EmployeeID"];
 string CampaignID = Request.QueryString["CampaignName"];
 string NoOfAgentsRequired = Request.QueryString["NoOfAgentsRequired"];
 string TrainingStartDate = Request.QueryString["TrainingStartDate"];

  ASPxCboCampaings.Text = CampaignID;
  ASPxtxtNoAgents.Text = NoOfAgentsRequired;
  ASPxDateEditTrainingStartDate.Text = TrainingStartDate;
  ASPxtxtTarAgents.Text = TargetedAgentsToDate;

When I run this locally the devexpress ASPxDateEdit is populated fine but when I publish the application the devexpress ASPxDateEdit does not get populated. Do i need to include any reference or? Thanks in advance.
Posted
Updated 11-Mar-14 2:55am
v2
Comments
P.C Shabangu 12-Mar-14 2:04am    
Any help/sugestions please?

I think the following line of code is causing error, try some other property of DateEdit Control..

C#
ASPxDateEditTrainingStartDate.Text = TrainingStartDate;
 
Share this answer
 
Comments
P.C Shabangu 12-Mar-14 3:26am    
Hi Manikandan

I am not sure if I understand?
try something like,

C#
ASPxDateEditTrainingStartDate.Date= TrainingStartDate;
 
Share this answer
 
C#
ASPxDateEditTrainingStartDate.Date= Convert.ToDate(TrainingStartDate);
 
Share this answer
 
Comments
P.C Shabangu 12-Mar-14 5:18am    
I tried it and it worked like a bomb. I thought it had something to do with the publish but it turns out it was my code.

Thanks Manikandan!
Manikandan K 12-Mar-14 5:21am    
what was that anyway??
P.C Shabangu 12-Mar-14 6:33am    
I was assigning a value that I got from a querystring to a devxpress 2012 datetime picker on form load. did I answer your question correctly?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900