Datepicker problem

I'm trying to edit an entry in XML. To do this when the page loads I am setting the fields as the value in the element. eg.

TitleTxt.Text = (string)assignment.Element("title");

The problem is that when I use the date picker to try and change the value, on the return to the edit page, the page is reloaded and all of the values are reset to the saved ones including the datepicker (the value just picked is overwritten). For the datepicker im using:

DateTxt.Value = ((DateTime)assignment.Element("date"));

I have tried using on navigated to and many more things but unfortunatly, these make it impossible for a different entry to be loaded.

Thanks!

Answers


Try using the DateTime.Parse() to parse the Element Value:

DateTime.Parse(assignment.Element("date").Value);

For anyone that has this problem, I solved it.

Simply create an new int. eg.

int loaded = 1;

and when setting the text boxes check whether loaded = 1

if (loaded == 1)
{
    TitleTxt.Text = (string)assignment.Element("title");
}

and at the end of the phone page loaded sub simply increase the value by 1.

loaded++;

Need Your Help

dotcloud django mongo 502

django mongodb dotcloud

I got a django app from https://github.com/jpetazzo/django-and-mongodb-on-dotcloud

store sql data in variables in nested if's

sql oracle unix

i have to use nested if/then/else statements to check the queries obtained from oracle db.