473,723 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Questions about asp 3.0 and aspnet's differences

Hi, i have decent experience with asp 3.0 (classic), and downloaded web
developer express to see what's the fuzz over it. I have lots of
questions, mostly regarding the use of forms and database use.

1) Why should i use the asp:label, asp:textbox, asp:submit instead of
plain old html input type="...", form action="..."

2) What's up with all those javascript:__do postback links when using
some controls? Does it mean text browsers and such couldn't use the
site?

3) Code-behind files. Can i use code-behind files when posting to the
same page? I have some pages on asp 3.0 that are like this:

example.asp

<%if request.form="" then%>
Enter your login and password (show input and submit, post to the same
page)
<%else%>
<connect to database, if successfull show links or other stuff, else
redirect to error page
<%end if

I wouldn't know how to use code behind files for that behaviour, since
i wouldn't know how to insert the "if not ispostback.. then... end if"
code and printing the bunch of labels...

My guess is that i should only use code behind files if posting to a
different page.

4) How to do database queries programatically ?

In asp 3, i had this code:

set conn= server.createob ject("adodb.con nection")
conn.open application("co nnectionstring" )
sql="select * from something"
set rs=conn.execute (sql)
if not rs.eof then
<table>
do while not rs.eof
<tr><td><%=rs(0 )%></td></tr>
rs.movenext
loop
rs.close
set rs=nothing
conn.close
set conn=nothing

in asp.net, i have ported that code to this:

Dim dbconn = New
SqlConnection(C onfigurationMan ager.Connection Strings("Connec tionString").Co nnectionString)

dbconn.open()
Dim sql = "select * from something"
Dim dbcomm = New SqlCommand(sql, dbconn)
Dim dbread = dbcomm.executeR eader()
customers.DataS ource = dbread
customers.DataB ind()
%>
<asp:Repeater id="customers" runat="server">

<HeaderTemplate >
<table border="1" width="100%">
<tr bgcolor="#b0c4d e">
<th>id</th>
</tr>
</HeaderTemplate>

<ItemTemplate >
<tr bgcolor="#f0f0f 0">
<td><%#Containe r.DataItem("id" )%</td>
</tr>
</ItemTemplate>

<FooterTemplate >
</table>
</FooterTemplate>

</asp:Repeater>
<%dbread.Close( )
dbconn.Close()

I need way too more code in asp net to do what i do in asp classic. For
the record, i have used the new controls that you just drag and drop
and you just modify the sql and parameters. Am i using the proper way
to do this in aspnet programatically ?

5) If i migrate to asp net, i would like to have almost all code in the
code behind files, and use the aspx files mainly as templates. The code
in 4) is far from this. Is there a way to do this cleanly ? I can't see
myself loosing my ties with the old form of development, it may be
messy but it is very flexible.

6) THe new login controls. How do they work by default? I have a
"dummies" book and it says that it creates a database by default for
the users. I went to the asp configuration pages and created some
users, but don't see where those users are getting stored. The book
says i can implement a membership provider by implementing a class. I
guess that is powerful but a little cumbersome comparing to having a
username and password being asked, reading the values, doing a query
with them and reacting for the result.

All right, i can't think of anything else for now. Thanks in advance

Aug 13 '06 #1
2 1356
Seguros,
Rather than spending lots of time going back and forth in the group over all
your questions, since you are just starting out, I'd recommend that you
invest an hour or so working your way through the ASP.NET QUICKSTART. This is
online at the asp.net site, and they've really invested a tremendous amount
of effort in providing explanations and examples of how most everything you
could ask about ASP.NET works. Trust me: It can save you weeks of time.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Seguros Catatumbo" wrote:
Hi, i have decent experience with asp 3.0 (classic), and downloaded web
developer express to see what's the fuzz over it. I have lots of
questions, mostly regarding the use of forms and database use.

1) Why should i use the asp:label, asp:textbox, asp:submit instead of
plain old html input type="...", form action="..."

2) What's up with all those javascript:__do postback links when using
some controls? Does it mean text browsers and such couldn't use the
site?

3) Code-behind files. Can i use code-behind files when posting to the
same page? I have some pages on asp 3.0 that are like this:

example.asp

<%if request.form="" then%>
Enter your login and password (show input and submit, post to the same
page)
<%else%>
<connect to database, if successfull show links or other stuff, else
redirect to error page
<%end if

I wouldn't know how to use code behind files for that behaviour, since
i wouldn't know how to insert the "if not ispostback.. then... end if"
code and printing the bunch of labels...

My guess is that i should only use code behind files if posting to a
different page.

4) How to do database queries programatically ?

In asp 3, i had this code:

set conn= server.createob ject("adodb.con nection")
conn.open application("co nnectionstring" )
sql="select * from something"
set rs=conn.execute (sql)
if not rs.eof then
<table>
do while not rs.eof
<tr><td><%=rs(0 )%></td></tr>
rs.movenext
loop
rs.close
set rs=nothing
conn.close
set conn=nothing

in asp.net, i have ported that code to this:

Dim dbconn = New
SqlConnection(C onfigurationMan ager.Connection Strings("Connec tionString").Co nnectionString)

dbconn.open()
Dim sql = "select * from something"
Dim dbcomm = New SqlCommand(sql, dbconn)
Dim dbread = dbcomm.executeR eader()
customers.DataS ource = dbread
customers.DataB ind()
%>
<asp:Repeater id="customers" runat="server">

<HeaderTemplate >
<table border="1" width="100%">
<tr bgcolor="#b0c4d e">
<th>id</th>
</tr>
</HeaderTemplate>

<ItemTemplate >
<tr bgcolor="#f0f0f 0">
<td><%#Containe r.DataItem("id" )%</td>
</tr>
</ItemTemplate>

<FooterTemplate >
</table>
</FooterTemplate>

</asp:Repeater>
<%dbread.Close( )
dbconn.Close()

I need way too more code in asp net to do what i do in asp classic. For
the record, i have used the new controls that you just drag and drop
and you just modify the sql and parameters. Am i using the proper way
to do this in aspnet programatically ?

5) If i migrate to asp net, i would like to have almost all code in the
code behind files, and use the aspx files mainly as templates. The code
in 4) is far from this. Is there a way to do this cleanly ? I can't see
myself loosing my ties with the old form of development, it may be
messy but it is very flexible.

6) THe new login controls. How do they work by default? I have a
"dummies" book and it says that it creates a database by default for
the users. I went to the asp configuration pages and created some
users, but don't see where those users are getting stored. The book
says i can implement a membership provider by implementing a class. I
guess that is powerful but a little cumbersome comparing to having a
username and password being asked, reading the values, doing a query
with them and reacting for the result.

All right, i can't think of anything else for now. Thanks in advance

Aug 13 '06 #2
THe first tip i would give you is forget absolutely everything you learned to
program in classic asp. asp.net and classic asp are so different i
personally beleive it is easier to learn asp.net having never programmed
before than it is to learn it after having lots of experience with classic
asp. classic ASP is much closer to PHP than it is to asp.net. asp.net is
more like programming windows forms applications than it is like classic asp.

"Seguros Catatumbo" wrote:
Hi, i have decent experience with asp 3.0 (classic), and downloaded web
developer express to see what's the fuzz over it. I have lots of
questions, mostly regarding the use of forms and database use.

1) Why should i use the asp:label, asp:textbox, asp:submit instead of
plain old html input type="...", form action="..."

2) What's up with all those javascript:__do postback links when using
some controls? Does it mean text browsers and such couldn't use the
site?

3) Code-behind files. Can i use code-behind files when posting to the
same page? I have some pages on asp 3.0 that are like this:

example.asp

<%if request.form="" then%>
Enter your login and password (show input and submit, post to the same
page)
<%else%>
<connect to database, if successfull show links or other stuff, else
redirect to error page
<%end if

I wouldn't know how to use code behind files for that behaviour, since
i wouldn't know how to insert the "if not ispostback.. then... end if"
code and printing the bunch of labels...

My guess is that i should only use code behind files if posting to a
different page.

4) How to do database queries programatically ?

In asp 3, i had this code:

set conn= server.createob ject("adodb.con nection")
conn.open application("co nnectionstring" )
sql="select * from something"
set rs=conn.execute (sql)
if not rs.eof then
<table>
do while not rs.eof
<tr><td><%=rs(0 )%></td></tr>
rs.movenext
loop
rs.close
set rs=nothing
conn.close
set conn=nothing

in asp.net, i have ported that code to this:

Dim dbconn = New
SqlConnection(C onfigurationMan ager.Connection Strings("Connec tionString").Co nnectionString)

dbconn.open()
Dim sql = "select * from something"
Dim dbcomm = New SqlCommand(sql, dbconn)
Dim dbread = dbcomm.executeR eader()
customers.DataS ource = dbread
customers.DataB ind()
%>
<asp:Repeater id="customers" runat="server">

<HeaderTemplate >
<table border="1" width="100%">
<tr bgcolor="#b0c4d e">
<th>id</th>
</tr>
</HeaderTemplate>

<ItemTemplate >
<tr bgcolor="#f0f0f 0">
<td><%#Containe r.DataItem("id" )%</td>
</tr>
</ItemTemplate>

<FooterTemplate >
</table>
</FooterTemplate>

</asp:Repeater>
<%dbread.Close( )
dbconn.Close()

I need way too more code in asp net to do what i do in asp classic. For
the record, i have used the new controls that you just drag and drop
and you just modify the sql and parameters. Am i using the proper way
to do this in aspnet programatically ?

5) If i migrate to asp net, i would like to have almost all code in the
code behind files, and use the aspx files mainly as templates. The code
in 4) is far from this. Is there a way to do this cleanly ? I can't see
myself loosing my ties with the old form of development, it may be
messy but it is very flexible.

6) THe new login controls. How do they work by default? I have a
"dummies" book and it says that it creates a database by default for
the users. I went to the asp configuration pages and created some
users, but don't see where those users are getting stored. The book
says i can implement a membership provider by implementing a class. I
guess that is powerful but a little cumbersome comparing to having a
username and password being asked, reading the values, doing a query
with them and reacting for the result.

All right, i can't think of anything else for now. Thanks in advance

Aug 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1306
by: Gabriel Zachmann | last post by:
I am relatively new to python, but i know some other languages, such as C++, fairly well. After reading up a little bit in the reference manual, section 4.1, and searching this NG, i still have 2 questions about python's scoping rules. 1. Exactly what are the major differences between python's and C++ scoping rules? 2. Why is it that 'while', 'for', etc., don't introduce a new block?
2
8231
by: Andrew J Fortune | last post by:
Hello all, I am trying to ascertain the difference, in terms of access and privileges, between the Internet Guest User Account (IUSR_machinename, where machinename is the name of your computer) vs. the ASPNET user (ASP.NET machine account). If you write a web application, you can configure it via its web.config file. One of the things you can do is set the impersonate attribute in the <identity> tag. If you set it (impersonate) to...
27
3036
by: Jatinder | last post by:
I 'm a professional looking for the job.In interview these questions were asked with some others which I answered.But some of them left unanswered.Plz help. Here are some questions on C/C++, OS internals? Q1 . What is the use of pointer to an array? Q2 . What is the use of array of pointers? Q3 . What is the use of pointer to function ? Q4 . How to print through serial port? What is Flow Control(Xon,Xoff) ?
7
1967
by: Johnny | last post by:
June 2, 2005 Greetings, I have a whole lot of questions that all have to do with the same topic: Width. By "width" I mean how wide a particular Web page is, how wide a table is, how wide a particular cell or column is, how wide a particular font is, and so on.
11
1398
by: cooltech77 | last post by:
hi all, I was curious to know as to which language is used more for the codebehind files in aspnet is it VB.net or C#?I want to prepare for certification and wanted to decide wehther i want to go for the vb.net track or C#. I like C# more than VB.net but I would like to know whats popular in the industry before making my choice. Thanks for your inputs in advance.
2
1095
by: JIM.H. | last post by:
Hello, I have to questions about ASP.NET, I heard that APS.NET is platform independent and it can run in any browser. Here are my questions: 1. Doesn’t ASP.Net require .NET framework, if yes how is it not platform dependent, can I install .NET framework to a UNIX, IBM, VAX machines? 2. If I start my development with asp.net, can I securely assume that whatever I do with my C# language, if it runs in IE, it will run in any other...
8
1631
by: Old VB6 Guy | last post by:
First of all, sorry if crossposting bothers you -- I don't normally do it, but both of these groups seem relavant to my questions. Alright, the time has finally come to make an investment in time and money to jump start my career again. I am currently a VB6/ASP programmer, but worse yet, I am in a company that has me doing (yuch!) support work mostly and I get extremely limited programming "bones" thrown to me these days. In short, I...
6
1396
by: Phil Sandler | last post by:
All, I am designing a system that will involve an IIS/ASP.Net application server. The main purpose of the application server will be to load large amounts of static data into memory and do fast lookups on it. The total cache size at the time of first installation will be roughly 350MB, but may grow to as large as 10GB over the next five years. My questions:
0
2227
by: Free PDF | last post by:
..NET , SQL Server interview questions websites.... http://www.questpond.com http://www.geocities.com/dotnetinterviews/ http://msdotnetsupport.blogspot.com/2007/01/net-interview-questions-by-dutt-part-2.html http://msdotnetsupport.blogspot.com/2006/08/net-windows-forms-interview-questions.html http://msdotnetsupport.blogspot.com/2006/08/net-remoting-interview-questions.html...
0
8868
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8741
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9388
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9241
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9160
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9090
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6685
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3209
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2612
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.