我正在學習jquery.I想要一步步執行所有的事情。 我不得不給gridview將包含所有控件來更新,刪除記錄。什麼將是在.net而不是jqgrid中實現gridview的簡單方法。什麼是jqgrid的簡單替代?
回答
既然你不需要使用ASP.net網格控制器或jq網格這裏有一些例子jQuery網格可用的網格插件。
http://www.aspdotnet-suresh.com/2014/08/7-jquery-grid-plugin-examples-or.html http://www.jquerybyexample.net/2012/04/jquery-grid-plugins-for-aspnet.html
如果您需要使用Asp.net GridView的控制器爲。這很簡單。
這是一個基本的樣本
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</div>
</form>
</body>
</html>
你的C#代碼將是在GridView綁定
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string strSQLconnection = (@"Data Source=.;Initial Catalog=new;Integrated Security=True");
SqlConnection sqlConnection = new SqlConnection(strSQLconnection);
SqlCommand sqlCommand = new SqlCommand("select * from persons", sqlConnection);
sqlConnection.Open();
SqlDataReader reader = sqlCommand.ExecuteReader();
GridView1.DataSource = reader;
GridView1.DataBind();
}
}
正如你所說,你需要插入,修改,刪除,你可以參考網格視圖的列這些鏈接
http://www.aspneto.com/gridview-inline-add-insert-edit-update-delete-data-in-asp-net-c-vb.html
asp:GridView是一個asp控件。我不想要任何asp控件。 – user1838502
我已經更新了答案,請參閱答案的頂部 – tarzanbappa
- 1. 什麼是替代(替代())?
- 2. 我的簡單代碼/類是什麼
- 3. 簡單替代
- 4. 什麼是Oracle.Connection的替代?
- 5. 什麼是Session.ReauthorizeRequest的替代?
- 6. 什麼是UDID的替代?
- 7. 什麼是file_column的替代?
- 8. 什麼是Sets.newConcurrentHashSet()的替代?
- 9. 什麼是CFRelease的替代
- 10. 是否有簡單的替代MonoTouch.UIKit.UIKeyboard.BoundsFromNotification?
- 11. 什麼是簡單的JavaScript做什麼
- 12. 什麼是HttpRuntime緩存的生命週期(任何簡單的替代?)
- 13. 簡單的RichTextEditor替代flex?
- 14. 簡單的libtool替代?
- 15. 什麼是iframe替代品?
- 16. 什麼是APC替代品?
- 17. 是什麼了session_register替代
- 18. 什麼是替代http.request()
- 19. 什麼是Erlang替代品?
- 20. 什麼是替代PackageAdmin.getFragments
- 21. 什麼是替代在C + +
- 22. 什麼是替代@RunWith(JMock.class)?
- 23. 什麼是ocamlyacc/menhir解析簡單表達式的輕量級替代方案?
- 24. SQL簡單和替代?
- 25. 簡單替代密碼
- 26. 什麼是ReadWriteTimeout替代的HttpClient的
- 27. 這個簡單的代碼是做什麼的?
- 28. 這個簡單的PHP代碼是做什麼的?
- 29. 什麼是錯我的簡單的MATLAB代碼
- 30. 爲什麼這個簡單的代碼是錯誤的?
在互聯網上有很多jQuery網格視圖可用。你使用MVC或ASP.Net – tarzanbappa
謝謝,ASP。淨 – user1838502
如果你不需要jQuery,你可以使用ASP.Net gridview爲 – tarzanbappa