Is it possible to strictly use this type of programming for web forms ?

T

Tony Girgenti

Hello.

When i develop a web form program using VS.NET 2003(VB), ASP.NET 1.1, i can
put a statement like this in my VB code-behind source file:

Me.btnGetArchivedTrips.Attributes.Add("onMouseOver", "alert('mouse over')")

When i do a search on the internet or wherever for ASP.NET client-side
javascript examples, 99% of the time, i get examples in javascript that are
coded in the HTML file for the web form.

Is it possible to do all of the things that can be done(or even most things)
in ASP.NET on a web form, using the above type of statements in the VB
code-behind file ? In other words, to not have to go into the HTML file to
do "javascript"(or whatever name you use for it).

Along with that, is there a name for that type of programming ?

I hope i explained that correctly.

Any help would be gratefully appreciated.

Thanks,
Tony
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

Tony said:
Hello.

When i develop a web form program using VS.NET 2003(VB), ASP.NET 1.1, i can
put a statement like this in my VB code-behind source file:

Me.btnGetArchivedTrips.Attributes.Add("onMouseOver", "alert('mouse over')")

When i do a search on the internet or wherever for ASP.NET client-side
javascript examples, 99% of the time, i get examples in javascript that are
coded in the HTML file for the web form.

Is it possible to do all of the things that can be done(or even most things)
in ASP.NET on a web form, using the above type of statements in the VB
code-behind file ? In other words, to not have to go into the HTML file to
do "javascript"(or whatever name you use for it).

Yes, it's possible, but it's also a waste of execution time. Also, every
element that you want to add attributes to has to be turned into a
server object.

You really should learn a bit about the page markup, and the html code
that is produced. It's very good for getting a grasp on what's really
going on. Myself, I hardly ever use the design mode, I only edit the
page markup.
Along with that, is there a name for that type of programming ?

Inefficient. ;)
 
T

Tony Girgenti

Hello Goran.

You sound pretty adamant about avoiding that type of programming. I'm not
sure i understand yet, why it is so inefficient, but from what i am reading,
i think you are right. I should try to learn the html side of it.

I can't believe you totally work on the html side.

Thanks,
Tony
 
G

Guest

Hi Tony,

The problem with code-behind files is that they contain server-side coding
only. If you want to implement an event in a code-behind file, this means
that every execution of such an event needs a round-trip to the server, which
makes your web application very slow. So it is much more efficient to let
mouse events be handled at the client.

I hope this clarifies things a little for you.

Greetings, Vera
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top