.net dll clears values after validate

Good day,

I created a simple dll to test the the validation of all required fields on a entryscreen. The validation works fine but the issue is that once validated all fields values clears and I have to fill everything in from the start. Am I missing something? Please see .cs code below.

using System;
using Sage.CRM.Controls;
using Sage.CRM.Data;
using Sage.CRM.HTML;
using Sage.CRM.Utils;
using Sage.CRM.WebObject;
using Sage.CRM.UI;

namespace testvalidate
{
public class MyCustomPage : Web
{

//public override bool Validate()
//{ //Always call the base validation method as it checks for required fields

// Boolean ok = base.Validate();

// if (ok)
// { //do my validation here!
// //Check values on screen with Dispatch.ContentField("fieldname");
// string name = Dispatch.ContentField("pers_firstname");
// if (name == "AAA")
// {
// ok = false;
// AddError("The name cannot be aaa");
// }
// }
// return ok;
// }

public override void BuildContents()
{
//Add your content here!
AddContent(HTML.Form());

EntryGroup screenPersonBoxLong = new EntryGroup("PersonBoxLong");
screenPersonBoxLong.Title = ("Persoon");

string hMode = Dispatch.EitherField("HiddenMode");

if (hMode == "Save")
{
if (screenPersonBoxLong.Validate())
{
Record recPerson = new Record("Person");
screenPersonBoxLong.Fill(recPerson);
recPerson.SaveChanges();

string rUrl = Url("220");
string[] split = rUrl.Split(new Char[] { '&' });
string newUrl = split[0] + '&' + split[1] + "&Mode=3&CLk=T&key0=2&key2=" + recPerson.GetFieldAsInt("pers_personid");
Dispatch.Redirect(newUrl);

}
else
{
//Below link does not work
//www.greytrix.com/.../

AddContent(HTML.InputHidden("HiddenMode",""));
VerticalPanel vpMainPanel = new VerticalPanel();
Record recPerson = new Record("Person");
vpMainPanel.AddAttribute("width", "100%");
screenPersonBoxLong.GetHtmlInEditMode();
vpMainPanel.Add(screenPersonBoxLong);
AddContent(vpMainPanel.ToHtml());


//Add Buttons
string sUrl = "javascript:document.EntryForm.HiddenMode.value='Save';";
AddSubmitButton("Save", "Save.gif", sUrl);
AddUrlButton("Cancel", "cancel.gif", Url("200"));
string strHelpUrl = "/Main Menu/wwhelp/wwhimpl/js/html/wwhelp.htm?href=AddingInformation.html";
AddHelpButton(strHelpUrl);

}
}
else
{
AddContent(HTML.InputHidden("HiddenMode", hMode));
VerticalPanel vpMainPanel = new VerticalPanel();
vpMainPanel.AddAttribute("width", "100%");
screenPersonBoxLong.GetHtmlInEditMode();
vpMainPanel.Add(screenPersonBoxLong);
AddContent(vpMainPanel.ToHtml());


//Add Buttons
string sUrl = "javascript:document.EntryForm.HiddenMode.value='Save';";
AddSubmitButton("Save", "Save.gif", sUrl);
AddUrlButton("Cancel", "cancel.gif", Url("200"));
string strHelpUrl = "/Main Menu/wwhelp/wwhimpl/js/html/wwhelp.htm?href=AddingInformation.html";
AddHelpButton(strHelpUrl);

}
}
}

}