2014-03-24 111 views
0

我使用TinyMCE爲用戶提供了HTML標籤,因此我將它們存儲在數據庫中,並稍後在頁面的相應部分調用它們。如何使用插件實體框架模型更新數據庫?

一切正常工作,直到我點擊更新按鈕,它告訴我更新成功,但我發現它發回相同的舊數據。

這是更新語法我用

int ID1 = int.Parse(Request.QueryString["titelid"]); 
     webmarketingEntities wme = new webmarketingEntities(); 
     articls ar = new articls(); 
     articls query = (from art in wme.articls 
        where art.id==ID1 
        select art).First(); 
     ar.articalcontent = txtconteny.Text; 
     ar.pagedescription = txtdescription.Text; 
     ar.pagetitle = txttitle.Text; 

     wme.SaveChanges(); 

回答

0

我想出瞭解決方案:

我應該寫select語句如下:

if(!page.postback) 
    { 
     //your select syntax 
    } 
相關問題