IT Community - Software Programming, Web Development and Technical Support

ASP vs PHP?

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 ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 02-18-2007, 09:44 AM
Timby Timby is offline
D-Web Trainee
 
Join Date: Feb 2007
Posts: 37
Timby is on a distinguished road
Default ASP vs PHP?

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.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-19-2007, 02:14 AM
sfod223 sfod223 is offline
D-Web Programmer
 
Join Date: Feb 2007
Posts: 51
sfod223 is on a distinguished road
Default Re: ASP vs PHP?

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.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-19-2007, 02:59 AM
webmaster webmaster is offline
D-Web Trainee
 
Join Date: Feb 2007
Posts: 45
webmaster is on a distinguished road
Default Re: ASP vs PHP?

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
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-20-2007, 07:52 AM
sfod223 sfod223 is offline
D-Web Programmer
 
Join Date: Feb 2007
Posts: 51
sfod223 is on a distinguished road
Default Re: 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.
__________________
245+ SE's | 113 Directory | Agloco - Own the Internet and Get in Early!!!!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-30-2007, 04:29 AM
shaalini shaalini is offline
D-Web Analyst
 
Join Date: Apr 2007
Posts: 342
shaalini is on a distinguished road
Default Edit,Delete function in Datagrid using Anthem

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>
<anthemataGrid 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>
</anthemataGrid>
</asp:Content>
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 06:30 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0