Once you have customised a page in Sharepoint designer using data views the list id etc are embeded into the page.
If you the export and import the site, all id become invalid, the code below is how to restamp the customised page with the new Id.
try
{
//using (SPSite site = new SPSite(SPContext.Current.Site.ID))
using (SPSite site = new SPSite(SiteURL))
{
using (SPWeb Web = site.OpenWeb(WebURL))
{
//This bit of code restamps all the list guid that SPD
//put into the page source for our customised project home page.
//When the site is exported and re-imported all lists get new ID hence the page is
//broken this fixes it for the new site.
byte [] bfile = Web.Files["default.aspx"].OpenBinary();
System.Text.Encoding enc = System.Text.Encoding.ASCII;
string myString = enc.GetString(bfile);
//re-stamp the guids from the default projector site with the new ones that
//have been created in this site.
SPList list = Web.Lists["List Name"];
myString = myString.Replace("69D01208-49F1-43BC-ABF9-550A75BD1A54", list.ID.ToString());
bfile = enc.GetBytes(myString.Replace("???",""));
Web.Files["default.aspx"].SaveBinary(bfile);Web.Files[
"default.aspx"].Update();
}
catch (Exception ex)
{
Console.WriteLine("Exception " + ex.ToString());
}