CariDotMy

 Forgot password?
 Register

ADVERTISEMENT

View: 2409|Reply: 6

ASP.Net Programming Techniques

[Copy link]
Post time 30-11-2006 12:52 PM | Show all posts |Read mode
Baru blajar nak guna ASP.Net.
Nak tanya
1. Yang mana lagi baik, tulis code sebagai script dalam html atau tulis dalam *.aspx.vb ?
2. Apa kelebihan dan kekurangan dua cara di atas?

Thanks.
Reply

Use magic Report


ADVERTISEMENT


Post time 30-11-2006 03:59 PM | Show all posts
kalu baby lebih suka masukkan code dalam html sebab mcm cerewet jer nak masukkan dalm aspx.vb..
tapi terpulang..dari segi security tak pastilah plak....:?
Reply

Use magic Report

Post time 1-12-2006 02:15 PM | Show all posts
kalau tulis script dalam code html, baik buat pakai ASP aje, takpayah buat pakai ASP.NET

yang bagus buat *.aspx.vb is that nanti dia akan compile as dll file, (macam u buat java classes untuk JSP la), maknanya org tak boleh nak curik your code behind, and (purpotedly) the code runs faster and more efficient if it is compiled in dll. furthermore, this promotes object-oriented programming practices in ASP.NET as you can distribute common libraries if you wish to develop another web application (eg: save data to database, open database connection etc etc...)

script dalam ASP.NET within usually untuk handle request (POSTDATA) and session variables mostly.
Reply

Use magic Report

Post time 7-12-2006 04:05 AM | Show all posts
agree with shanaz,  
a good practise is to separate your logic from the presentaton layer(html).
code behind serves as  the business layer. and you shoud also consider the data layer(like stored procedures) . just like any other 3tier rmodel  app.
Btw some scripts can be put in the html as the client processes such as simple validation, functions etc.This can be faster and save server resources.
regards

Rate

1

View Rating Log

Reply

Use magic Report

Post time 6-1-2007 02:31 AM | Show all posts
So maknanya, server cuma akan compile aspx.vb jer laaa eekk?? Actually apa beza yg plg ketara antara ASP ngan ASP.NET.
Reply

Use magic Report

Post time 16-1-2007 12:20 PM | Show all posts

Advantages of Using Code-Behind

豙/size]      Clean separation of HTML and code
Allows designers and developers to do what they do best independently.

豙/size]      Easier reuse
The code that isn抰 mixed with HTML (like in ASP classic) can be more easily reused in other projects.

豙/size]      Simpler maintenance
Because the code separated from HTML, it is easier for you to read and maintain.
Reply

Use magic Report

Follow Us
Post time 16-1-2007 12:27 PM | Show all posts
Originally posted by aks_berhad at 6-1-2007 02:31 AM
So maknanya, server cuma akan compile aspx.vb jer laaa eekk?? Actually apa beza yg plg ketara antara ASP ngan ASP.NET.


Classic ASP developers (users of version of ASP before ASP.NET) named all their ASP files with the extension .asp instead of .aspx. You can continue to name your ASP files with the extension .asp, but they do not gain any of the new functionality of ASP.NET.

Files with the .asp extension continue to be executed as classic ASP files.

By default, files with the extension .asp are mapped by IIS to asp.dll, and .aspx are mapped to _aspnet_isapi.dll. So both classic ASP files and ASP.NET files can happily live and work together on the same Web server.

[ Last edited by  ng58339 at 16-1-2007 12:30 PM ]
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

 

ADVERTISEMENT



 

ADVERTISEMENT


 


ADVERTISEMENT
Follow Us

ADVERTISEMENT


Mobile|Archiver|Mobile*default|About Us|CariDotMy

15-1-2025 02:55 PM GMT+8 , Processed in 0.070970 second(s), 20 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

Quick Reply To Top Return to the list