This is a discussion on ASP vs PHP? within the ASP and ASP.NET Programming forums, part of the Web Development category; Hey, I currently do all of my web coding in php because of its ease of use and such. I ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hey, I currently do all of my web coding in php because of its ease of use and such. I was wondering what are the key differences between the languages? as far as I can tell they kind of do the same kind of things when it comes to web programming...is there stuff you can't do in php that you can do in Asp and vice versa? Thanks
__________________ Mario Mayhem - for all your Mario needs, cartoons, downloads, Mario information. |
| Sponsored Links |
| |||
| I think the main thing beihind asp is to seamlessly link all of your pages together as if they were all one page, whereas PHP type sites or more driven by scripting features and calling up info from db's in an automated fashion. |
| |||
| I know much about PHP only but don't know much about ASP. I found good article on the net where you can find difference between those two. http://www.webpronews.com/expertarti.../22/asp-vs-php |
| |||
| I guess i learned it backwards...lol. but most of my ASP experience came in the form of a site that i brought and had to teach myself how to code the pages. BTW SE's love the layout and integration of ASP pages ecause of the linking structure. |
| |||
| Hi Edit,Delete function in Datagrid using Anthem The Anthem project adds AJAX-like features to ASP.NET.It integrates itself into the server-side control model made popular by ASP.NET. This includes full support for view state, server-side events, and everything else the typical ASP.NET developer has grown accustomed to. <%@ Register TagPrefix="anthem" Namespace="Anthem" Assembly="Anthem" %> <%@ Import Namespace="System.Data" %> <script runat="server"> void Page_Load() { dataGrid1.DataSource = DataView1; } void Page_PreRender() { DataBind(); } DataSet TestData { get { DataSet ds = Session["TestData"] as DataSet; if (ds == null) { ds = new DataSet(); DataTable dt = new DataTable(); ds.Tables.Add(dt); dt.Columns.Add("id", typeof(int)); dt.PrimaryKey = new DataColumn[] { dt.Columns["id"] }; dt.Columns.Add("foo", typeof(string)); dt.Columns.Add("bar", typeof(string)); dt.Columns.Add("baz", typeof(string)); dt.Rows.Add(new object[] {1, "a", "k", "j"}); dt.Rows.Add(new object[] {2, "l", "b", "i"}); dt.Rows.Add(new object[] {3, "m", "o", "c"}); dt.Rows.Add(new object[] {4, "n", "d", "h"}); dt.Rows.Add(new object[] {5, "e", "f", "g"}); Session["TestData"] = ds; } return ds; } } DataView DataView1 { get { DataView dv = Session["DataView1"] as DataView; if (dv == null) { dv = new DataView(TestData.Tables[0]); Session["DataView1"] = dv; } return dv; } } void dataGrid1_EditCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { Anthem.DataGrid grid = (Anthem.DataGrid)source; grid.EditItemIndex = e.Item.ItemIndex; grid.UpdateAfterCallBack = true; } void dataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { Anthem.DataGrid grid = (Anthem.DataGrid)source; DataRow row = TestData.Tables[0].Rows.Find(grid.DataKeys[e.Item.ItemIndex]); row["foo"] = ((System.Web.UI.WebControls.TextBox)e.Item.Cells[0].FindControl("_foo")).Text; row["bar"] = ((System.Web.UI.WebControls.TextBox)e.Item.Cells[1].Controls[0]).Text; row["baz"] = ((System.Web.UI.WebControls.TextBox)e.Item.Cells[2].Controls[0]).Text; grid.EditItemIndex = -1; grid.UpdateAfterCallBack = true; } void dataGrid1_CancelCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { Anthem.DataGrid grid = (Anthem.DataGrid)source; grid.EditItemIndex = -1; grid.UpdateAfterCallBack = true; } void dataGrid1_DeleteCommand(object source, DataGridCommandEventArgs e) { Anthem.DataGrid grid = (Anthem.DataGrid)source; TestData.Tables[0].Rows.Remove(TestData.Tables[0].Rows.Find(grid.DataKeys[e.Item.ItemIndex])); // If the row that was just deleted was being edited, turn // editing off. if (grid.EditItemIndex == e.Item.ItemIndex) { grid.EditItemIndex = -1; } if (grid.CurrentPageIndex > 0 && TestData.Tables[0].Rows.Count <= (grid.CurrentPageIndex * grid.PageSize)) { --grid.CurrentPageIndex; } grid.UpdateAfterCallBack = true; } void dataGrid1_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEvent Args e) { Anthem.DataGrid grid = (Anthem.DataGrid)source; // Alternate sorting between ascending and descending. if (((DataView)grid.DataSource).Sort != e.SortExpression) { ((DataView)grid.DataSource).Sort = e.SortExpression; } else { ((DataView)grid.DataSource).Sort += " DESC"; } grid.EditItemIndex = -1; grid.UpdateAfterCallBack = true; } void dataGrid1_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEvent Args e) { Anthem.DataGrid grid = (Anthem.DataGrid)source; grid.CurrentPageIndex = e.NewPageIndex; grid.UpdateAfterCallBack = true; } </script> <asp:Content ContentPlaceHolderID="ContentPlaceHolder" runat="server"> <h2>Example</h2> <anthem ataGrid id="dataGrid1" runat="server" AutoGenerateColumns="False" DataKeyField="ID" Width="100%"AllowSorting="True" AllowPaging="True" PageSize="2" OnEditCommand="dataGrid1_EditCommand" OnUpdateCommand="dataGrid1_UpdateCommand" OnCancelCommand="dataGrid1_CancelCommand" OnDeleteCommand="dataGrid1_DeleteCommand" OnSortCommand="dataGrid1_SortCommand" OnPageIndexChanged="dataGrid1_PageIndexChanged"> <Columns> <asp:TemplateColumn SortExpression="foo" HeaderText="Foo"> <ItemTemplate> <b> <%# DataBinder.Eval(Container.DataItem, "foo") %> </b> </ItemTemplate> <EditItemTemplate> <asp:TextBox id=_foo Text='<%# DataBinder.Eval(Container.DataItem, "foo") %>' Runat="server" /> </EditItemTemplate> </asp:TemplateColumn> <asp:BoundColumn DataField="bar" SortExpression="bar" HeaderText="Bar"></asp:BoundColumn> <asp:BoundColumn DataField="baz" SortExpression="baz" HeaderText="Baz"></asp:BoundColumn> <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" EditText="Edit"></asp:EditCommandColumn> <asp:ButtonColumn Text="Delete" ButtonType="PushButton" CommandName="Delete"></asp:ButtonColumn> </Columns> </anthem ataGrid></asp:Content> |
![]() |
| Thread Tools | |
| Display Modes | |
| |