我有一个简单的问题。extjs/c#是保存到数据库
我有一个FormView,一个保存按钮。点击按钮后,它会保存到数据库。
我已经添加了一个EXT消息框来确认用户是否想要保存数据。当他在messagebox的yes按钮上点击yes时,它应该保存数据。
我找不到在哪里写分机的按钮逻辑。
这里是我的代码:
<asp:FormView ID="myform" runat="server" DataSourceID="mydatasource" DefaultMode="Edit" DataKeyNames="Id" >
<EditItemTemplate>
<asp:TextBox ID="myText" runat="server" TextMode="MultiLine" ClientIDMode="Static"
Text='<%#Bind("xx") %>' />
<ext:Button ID="btn_Update" runat="server" AutoPostBack="false" CausesValidation="false" CommandName="Update" Text="Speichern" StyleSpec="float: left; margin-left:10px;"> <DirectEvents>
<Click OnEvent="btnUpdateClick"></Click>
</DirectEvents>
</ext:Button>
<script type="text/javascript">
function showResult(btn)
{
Ext.example.msg('Button Click', 'You clicked the {0} button', btn);
};
function showResultText(btn, text)
{
Ext.example.msg('Button Click', 'You clicked the {0} button and entered the text "{1}".', btn, text);
}
var showResult = function (btn) {
Ext.Msg.notify("Button Click", "You clicked the " + btn + " button");
};
var showResultText = function (btn, text) {
Ext.Msg.notify("Button Click", "You clicked the " + btn + 'button and entered the text "' + text + '".');
};
</script>
protected void btnUpdateClick(object sender, DirectEventArgs e)
{
X.Msg.Confirm("Confirm", "Are you sure you want to save?", new JFunction { Fn = "showResult" }).Show();
}
请提供一个示例/更改您的问题。消息框无法更新任何内容。所以你不清楚你在问什么。 – sra
消息框有和没有按钮(你想要保存数据),当用户单击是时,它应该保存数据,我只是不知道我怎么能做到这一点,现在我将提供代码。 – Mark