0
我想使用jQuery對話框WIDGET在我的SQL Server數據庫中插入數據。在jQuery小部件中,我有多個字段和一個提交按鈕,如果用戶按提交,記錄將被輸入到數據庫中,對話框會自動關閉。 Reference Link的代碼可以幫助很多,但我想將它插入到我的數據庫中。請讓我通過這個問題,我真的堅持了這從幾天。我甚至不具有示例代碼張貼在這裏,但我已經做了,直到爲:在jQuery對話框小部件中插入更新刪除
function linkbtnTest(abc) {
$(abc).dialog({
modal: true,
buttons: { "OK": function() { $(this).dialog("Close") } },
open: function (type, data) { $(this).parent().appendTo("form") },
height: 600,
width: 800
});
}
<div id='<%# Eval("LCID") %>' style="display: none;">
<table>
<tr>
<td>
<asp:Label ID="lblInvoiceNumber" runat="server" Text="Invoice Number">
</asp:Label>
</td>
<td>
<asp:Label ID="lblInvoiceDate" runat="server" Text="Invoice Date">
</asp:Label>
</td>
<td>
<asp:Label ID="lblBLNumber" runat="server" Text="B/L Number">
</asp:Label>
</td>
<td>
<asp:Label ID="lblBLDate" runat="server" Text="B/L Date">
</asp:Label>
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="txtInvoiceNumber" runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="txtInvoiceDate" runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="txtBLNumber" runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="txtBLDate" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblVesselName" runat="server" Text="Invoice Number">
</asp:Label>
</td>
<td>
<asp:Label ID="lblVoyageNumber" runat="server" Text="Invoice Date">
</asp:Label>
</td>
<td>
<asp:Label ID="lblDueDate" runat="server" Text="B/L Number">
</asp:Label>
</td>
<td>
<asp:Label ID="lblShipmntSchedule" runat="server" Text="B/L Date">
</asp:Label>
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="txtVesselName" runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="txtVoyageNumber" runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="txtDueDate" runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="txtShipmntSchedule" runat="server"></asp:TextBox>
</td>
</tr>
</table>
</div>
上面顯示的代碼只顯示一個按鈕,但假設我將在對話框和提交按鈕上有多個輸入文件。另一個我忘記提到的問題是,我該如何將一個文本框字段添加到對話框中。 –
你能否提一下你已經寫過的更多的代碼/標記。您提供的引用鏈接具有模態形式的jq對話框,其中包含文本字段以及驗證,您是否仍然在向對話框添加文本框時遇到問題? – Rohit416
這是一個ASP.NET MVC應用程序嗎?是否有限制,您至少不能使用*** MVC的Web API部分?你需要能夠使用4.0框架。 –