Basic 'What can ASP do' question

D

dgk

I'm trying to persuade my company to use ASP.NET for a development
effort but I'm pretty weak in both ASP.NET and web development. I've
explained that ASP.NET works by turning the controls on the page into
html and java script so we don't have to write html and javascript
ourselves but clearly we need to write some js anyway since I have to
do that just to set the focus to the first control on the webpage.

As an example, how can I do this in ASP.Net:
1) user enters some text in a textbox on part of a form
2) whole form is submitted? or just a service is called?
2) the server responds with a list of names matching the text
3) the user is given a list of matches (on a subform or listbox?) and
selects one which is inserted into a list, and the user returns to
enter more text for another lookup until done.

I can set autopostback and the whole form is submitted when the user
presses enter. Seems wasteful. How would I just call a webservice that
would update a listbox without a trip to the server each time?

In general, how much can actually be done directly using server-side
controls (including third-party ones) without having to write our own
code once we want to do more than "hello world"?
 
H

Hans Kesting

dgk said:
I'm trying to persuade my company to use ASP.NET for a development
effort but I'm pretty weak in both ASP.NET and web development. I've
explained that ASP.NET works by turning the controls on the page into
html and java script so we don't have to write html and javascript
ourselves but clearly we need to write some js anyway since I have to
do that just to set the focus to the first control on the webpage.

As an example, how can I do this in ASP.Net:
1) user enters some text in a textbox on part of a form
2) whole form is submitted? or just a service is called?
2) the server responds with a list of names matching the text
3) the user is given a list of matches (on a subform or listbox?) and
selects one which is inserted into a list, and the user returns to
enter more text for another lookup until done.

I can set autopostback and the whole form is submitted when the user
presses enter. Seems wasteful. How would I just call a webservice that
would update a listbox without a trip to the server each time?

In general, how much can actually be done directly using server-side
controls (including third-party ones) without having to write our own
code once we want to do more than "hello world"?

You still need to write/know html. The main point (as I see it) is not
"not writing html", but having an object-model that you can work with
(random access) where design and code are separated, as opposed to the
asp (php, jsp, ..) method of builing an html-file as you progress
through the code.
Plus you have the whole .net framework full of classes to do all sorts
of things.

The output is designed to work with any browser (which is not the same
as "works identically on any browser"!) and uses only html and
javascript. So a fancy IE-only client-server interaction is not standard.
 
K

Kevin Spencer

I don't think you really understand ASP.Net. First, if you think that you
don't need to write HTML any more, you're sadly mistaken. Second, if in fact
you think that ASP.Net is simpler to use in general than ASP, you're way off
track. The biggest advantage of ASP.Net over ASP is programming power, and
that is by an exponential factor. ASP.Net is powerful, as powerful as a
programming technology can be. It is also quite a learning curve, expecially
if your only experience is writing VBScript for ASP. So, if you're looking
at migrating to ASP.Net, expect to spend a long time learning the object
model, acquainting yourself with OOP practices and techniques, and retooling
your way of programming in general.

But is it worth it? Absolutely, if you plan to write a web application of
any size, extensibility, and/or complexity.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
D

dgk

I don't think you really understand ASP.Net. First, if you think that you
don't need to write HTML any more, you're sadly mistaken. Second, if in fact
you think that ASP.Net is simpler to use in general than ASP, you're way off
track. The biggest advantage of ASP.Net over ASP is programming power, and
that is by an exponential factor. ASP.Net is powerful, as powerful as a
programming technology can be. It is also quite a learning curve, expecially
if your only experience is writing VBScript for ASP. So, if you're looking
at migrating to ASP.Net, expect to spend a long time learning the object
model, acquainting yourself with OOP practices and techniques, and retooling
your way of programming in general.

But is it worth it? Absolutely, if you plan to write a web application of
any size, extensibility, and/or complexity.

I'll second the learning curve phase. I'm an app developer (VB6,
Fortan, Cobol, Vax Basic) and any Web stuff is quite different. I
certainly expect to need Javascript but I'm not sure why I need to
write HTML. Unless I'm writing controls. Well, I know enough HTML to
get by at the moment and I'll be learning more. I know a lot of the
Net framework and VB.Net. So far the big problem is just figuring out
how to do simple things, like determining what control caused submit
in the PageLoad event. That fires before the click event of the
control it seems. Oh well, time to dive into some books.

Luckily my newserver has about a two year retention on this group so
many questions have already been asked and answered.
 
K

Kevin Spencer

Luckily my newserver has about a two year retention on this group so
many questions have already been asked and answered.

Bravo, dgk! It encourages me tremendously to meet someone who can feed
themselves!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
H

Hans Kesting

dgk said:
So far the big problem is just figuring out
how to do simple things, like determining what control caused submit
in the PageLoad event. That fires before the click event of the
control it seems. Oh well, time to dive into some books.

Page_Load does indeed fire before click, but you can assign
a click-event handler to handle the click. No need to write logic
into Page_Load for this.
In the designer, just double-click on the button and the (empty)
handler is created and hooked up.
 
D

dgk

Page_Load does indeed fire before click, but you can assign
a click-event handler to handle the click. No need to write logic
into Page_Load for this.
In the designer, just double-click on the button and the (empty)
handler is created and hooked up.

Right, I found that out. But since the page_load fires first I would
like to know at that point what triggered it. I checked the Sender
argument but that is just the aspx page. Maybe it's in Session
somewhere.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,085
Latest member
cryptooseoagencies

Latest Threads

Top