简体   繁体   English

详细信息查看如何在基础数据中保存字段

[英]DetailsView how to save a field in underlying data

I have a DetailsView which I use to edit some Fields. 我有一个DetailsView,用于编辑某些字段。 In my code belove I try to - Find the TextBox where User has left inout - Sanitize using my own class the data inserted Till now all is working just fine. 在我的代码迷中,我尝试-找到用户遗忘的文本框-使用我自己的类对插入的数据进行清理,直到现在一切正常。

My questions is how to SAVE this data in the underlying Data Source using DetailsView? 我的问题是如何使用DetailsView在基础数据源中保存此数据? Thanks for now! 现在谢谢!

    protected void uxAuthorListDetailsView_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
    {
        // Find out Controlls
        TextBox myContentAuthor = (TextBox)uxAuthorListDetailsView.FindControl("uxContentAuthorInput");
        myContentAuthor.Text = UserInputSanitizer.CapitalizeFirstLetterTrim(myContentAuthor.Text);         
    }

Altering the contents of the textbox like this will make the Update command read the new values. 像这样更改文本框的内容将使Update命令读取新值。

did you try to call the datasource.Update method? 您是否尝试调用datasource.Update方法?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM