Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,161,442 members, 7,846,815 topics. Date: Saturday, 01 June 2024 at 01:33 AM

'.php' And '.aspx'-lets Compare Both Scripting Langs - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / '.php' And '.aspx'-lets Compare Both Scripting Langs (2809 Views)

PHP And Aspx Are Server Side. / Aspx Help Please / Aspx Programming Clues And News (2) (3) (4)

(1) (Reply) (Go Down)

'.php' And '.aspx'-lets Compare Both Scripting Langs by dawizkid: 4:16pm On Jun 03, 2009
asp.net and php, which is better in the long run?
Re: '.php' And '.aspx'-lets Compare Both Scripting Langs by AjaraEwuro: 4:40pm On Jun 03, 2009
the one you know best.
Re: '.php' And '.aspx'-lets Compare Both Scripting Langs by Nobody: 4:44pm On Jun 03, 2009
AjaraEwuro:

the one you know best.
that is the bitter truth.


My view:

they both have their pluses and minuses.
ask those who are asp.net pros and they will tell u breathtaking stuffs u can do with the language.
same here, with php.
Re: '.php' And '.aspx'-lets Compare Both Scripting Langs by AjaraEwuro: 4:49pm On Jun 03, 2009
In classic ASP, you can pass form values to another page for validation and processing by using the atribute action = ", aspx". The ", aspx" page will process the form content from the first page, the page holding the form.

However, in asp.net - i think the action = ", aspx" attribute is no longer supported, often ignored when used. What is the best way to pass the form content to another page then, because as a default, the form contents are passed and validatable on the same page where the form is, but I want them passed to another page, any one here can help?

On the receiving page, I want to validate the values and use them as values in an ado.net query to search a database on the second receiving page.
Re: '.php' And '.aspx'-lets Compare Both Scripting Langs by Kobojunkie: 7:09pm On Jun 03, 2009
AjaraEwuro:

In classic ASP, you can pass form values to another page for validation and processing by using the atribute action = ", aspx". The ", aspx" page will process the form content from the first page, the page holding the form.

However, in asp.net - i think the action = ", aspx" attribute is no longer supported, often ignored when used. What is the best way to pass the form content to another page then, because as a default, the form contents are passed and validatable on the same page where the form is, but I want them passed to another page, any one here can help?

On the receiving page, I want to validate the values and use them as values in an ado.net query to search a database on the second receiving page.

If you are already working on aspx, why not handle the validating and the ado.net query and all in the codebehind? Why do you need to pass the information to another webform?

By the way, I am not sure why your form action does not take .aspx extension as forms do post back to themselves even in ASP.NET.

If you must use another form for the processing of your data, then here are some ways to pass data between pages

http://www.dotnetbips.com/articles/c585b4d3-93c5-4c66-9d49-8e1946f4d311.aspx

http://msdn.microsoft.com/en-us/library/6c3yckfw.aspx

You can also use the PREVIOUSPage property of the new page to your advantage.
Re: '.php' And '.aspx'-lets Compare Both Scripting Langs by AjaraEwuro: 8:14pm On Jun 03, 2009
@kobo

OK- in classic ASP, this appication of mine works perfect - no error, no problem, nice and steady. I am converting to .net, hence my predico.

Ok, its like this. I have a page, where i have to server controls, an input button, a select list and a submit button. in classic ASP, the form is submitted by post method and on the action page, the Request.Form(variables) were used to capture the variables on the action page. Now, on the action page, I have variables representing values selected and input by the user from the calling page. These variables then form part of an ado.net contruct to retrieve some values and passed on that same page.

However, I read strongly everywhere that in ASP.net, you can not use the action attribute, hence you can not post form elements to another page, but to itself. This is my predico, meaning predicament.

I have been able to structure the two pages in asp.net, but the issue is how do I make the second page catch the variables as input and selected from the first page by the user. I have to pass the data to the second page becasue that is where they wil be procesed and validated.
Re: '.php' And '.aspx'-lets Compare Both Scripting Langs by AjaraEwuro: 8:37pm On Jun 03, 2009
Re: '.php' And '.aspx'-lets Compare Both Scripting Langs by Kobojunkie: 11:10pm On Jun 03, 2009
AjaraEwuro:

@kobo

OK- in classic ASP, this appication of mine works perfect - no error, no problem, nice and steady. I am converting to .net, hence my predico.

Ok, its like this. I have a page, where i have to server controls, an input button, a select list and a submit button. in classic ASP, the form is submitted by post method and on the action page, the Request.Form(variables) were used to capture the variables on the action page. Now, on the action page, I have variables representing values selected and input by the user from the calling page. These variables then form part of an ado.net contruct to retrieve some values and passed on that same page.

However, I read strongly everywhere that in ASP.net, you can not use the action attribute, hence you can not post form elements to another page, but to itself. This is my predico, meaning predicament.
I am not sure where you read that from but that is erroneous thinking. An ASP.NET Form postsback to itself and if you run your page and view the source, you should see that the page is essentially POSTing back to itself, the action attribute is set to the page itself.

AjaraEwuro:
I have been able to structure the two pages in asp.net, but the issue is how do I make the second page catch the variables as input and selected from the first page by the user. I have to pass the data to the second page becasue that is where they wil be procesed and validated.

QueryString is one way, but I still think what you need here is not TWO FORMS but simply one form with codebehind where you can capture all the data entered in your aspx in code and do what you need with it.
Re: '.php' And '.aspx'-lets Compare Both Scripting Langs by AjaraEwuro: 11:22pm On Jun 03, 2009
All is well now - used the code behind to trap the values defined as session in one form and passing the values to the other page using response.redirect and the Page Load event of the new page then reads the sessiona values from the previous page.

Nice one. But the link you gave me also attests to the fact that you cant use the action attribute to post to another page but to itself. However, you have helped .

I want to marry you now!!!!!!!!!!!!
Re: '.php' And '.aspx'-lets Compare Both Scripting Langs by Nobody: 7:02am On Jun 04, 2009
any reason why aspx will only allow u to post back to itself?
Re: '.php' And '.aspx'-lets Compare Both Scripting Langs by AjaraEwuro: 12:49pm On Jun 04, 2009
sledjama:

any reason why aspx will only allow u to post back to itself?

Make we ask Bill Gates o.
Re: '.php' And '.aspx'-lets Compare Both Scripting Langs by AjaraEwuro: 12:51pm On Jun 04, 2009
@koboko


Helppppppppppppppp

I ant to pass the result of my ado.net connection into a list box. I managed to do it, but only the list box shows, no content. Biko, na something wey u fiti helep? Make I post my own code here?
Re: '.php' And '.aspx'-lets Compare Both Scripting Langs by Kobojunkie: 4:46pm On Jun 04, 2009
OH!!!

Well, you have to access the instance of the listbox on the page and bind your resultset to it

something like this

MyListbox.DataSource = DatasetReturnedfromAdoNetoperation
MyListbox.Databind()
Re: '.php' And '.aspx'-lets Compare Both Scripting Langs by AjaraEwuro: 4:52pm On Jun 04, 2009
@kobo

Why is the below not working!


Dim ftname, fttown As String
ftname = Session("town")
fttown = Session("street")

Dim conn, rs1, sql, dbread
conn = CreateObject("ADODB.Connection")
conn.Provider = "Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.MapPath("maps1_old.mdb"))
rs1 = Server.CreateObject("ADODB.recordset")
sql = "SELECT DISTINCT a, x, y FROM maps111 where name LIKE '" & ftname & "%' AND town ='" & fttown & "' "
rs1.Open(sql, conn)



Dim rname, rx, ry As String


On Error Resume Next
rs1.MoveFirst()
Do While Not rs1.eof
rname = rs1("a")
rx = rs1("x")
ry = rs1("y")



dlist.Items.Add(rname)

rs1.MoveNext()


Loop

conn.Close()
rs1.Close()
conn = Nothing
rs1 = Nothing

End Sub
Re: '.php' And '.aspx'-lets Compare Both Scripting Langs by Kobojunkie: 4:59pm On Jun 04, 2009
Try adding

dlist.Databind() right after the loop to see.

I am unable to run it here to figure out if there is anything else wrong with the code
Re: '.php' And '.aspx'-lets Compare Both Scripting Langs by seyz4all: 4:47pm On Jun 06, 2009
i believe php is better than asp cos of its flexibity and security features,
and one can develop php driven sites on any operating system, yes, its platform independent,
PHP, any time
Re: '.php' And '.aspx'-lets Compare Both Scripting Langs by Beaf: 2:40am On Jun 18, 2009
First things first; ASP.NET is not a scripting language. It is compiled.
ASP.NET is by far superior in design, security and performance to PHP (like comparing molue and hummer).  shocked

You should be comparing classic ASP (VbScript, JavaScript) and PHP - both employ spaghetti style coding.

(1) (Reply)

Displaying Images Horizontally With Php / a / Help A Beginner Using Python

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 34
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.