Bharathiar University ASP.Net Notes for MCA 2nd year Students(Reference Notes Only)

Bharathiar University ASP.Net Notes  for MCA  2nd year Students

Note: Reference Notes Only

                           For Other Units Download the Below Document

 



To Download This Program as a Document Click the below Download button to download.  

https://app.box.com/s/p2472hrk6db32asnyxu6




ASP. NET

Unit I
Getting Setup - what is ASP.NET- Setting up for ASP.NET- The development environment –ASP & ASP.NET. An overview – ASP.NET Programming Languages. Programming Basics: Basics of Programming - Program Flow – Effective Coding Techniques –Designing Applications.

Unit II
How Dynamic Website Applications work- Processing ASP.NET with Visual basic.
NET:VB.NET Programming Language Structures –Built in ASP.NET objects & Interactivity-The response object –The ASP Server object.

Unit III
Web forms & ASP.NET: Web forms- ASP.NET Configuration, Scope and State: ASP.NET and configuration-ASP.NET and state –The application object –ASP sessions – The session object.

Unit IV
ASP.NET objects and components: The Scripting Object Model- Active Server Components and Controls –More Active Server Components.

Unit V
Web services & ASP. NET –WSDL & SOAP- Web services Background – ASP.NET &SQL server- using SQL server –using databases in ASP.NET applications- ActiveX data objects- the ADO.NET objective model –coding structured query language.





ASP. NET

Unit-I
1)Getting Setup :




ASP.NET is a server-side Web application framework designed for Web development to produce dynamic Web pages. It was developed by Microsoft to allow programmers to build dynamic web sites, web applications and web services.
          How Dose Asp.net Fit.in
                   Asp.net is a part of the .net framework new computing platform From Microsoft optimized for creating Application that Are highly distributed across the internet.
What is .net Framework
                   .net is Microsoft name dor a platform for xml web service .xml is a standard way for developing mark-up language that can describe any kind of data or functionality.
What ate Active Server Page
          Active server pages (asp) is the name Microsoft uses for a Technology that is Convenient for Building Dynamic web page. Dynamic Web Page Contain Content that may Change from Second to second based on the data & Condition that may Change as Time progresses.  

2) What is ASP.NET

ASP.NET is a server-side Web application framework designed for Web development to produce dynamic Web pages. It was developed by Microsoft to allow programmers to build dynamic web sites, web applications and web services. ASP.NET is a development framework for building web pages and web sites with HTML, CSS, JavaScript and server scripting. ASP.NET supports three different development models: Web Pages, MVC (Model View Controller), and Web Forms:

3)Setting up for ASP.NET

Step-1: Go To Control Panel -> Programs
Step-2:Then Click Turn Windows Features On and Off .
Step-3: A Small Window Will Open In Then Click Internet Information Services Check Box.                                                                                        

Step-4: Then Click World Wide Services Then Click Plus Button Then Click Application Development  Features Then Click Plus Button Then Click ASP Check Box.                                                                                                                      
Step-5: Then Go to Control Panel  Then Go to  All Control Panel Items Then Click Administrative Tools.
Step-6: Then a Small Window Will Open in that Click Directory Browsing.
Step-7: Then Click The Enable Button To Enable The Directory Browsing.
Step-8: Then Open Any Web Browser Type http://localhost/ in Your URL Box.
Step-9: Now Your IIS is activated in your system.
Step-10: now open Your Control panel In that Click Administrative Tool then Click Internet Information Services (IIS) Manager then Click the server name (Computer name) then Click site then Right Click Default Website then Click add Virtual Directory then Enter Alice name and the path of the asp program then press ok.
Step-11: Now open any browser and   type http://localhost/ (with your alice name) 
Example: http://localhost/hari

4) The development environment
                         In ASP.Net, you can accomplish an include that appears on every page by creating a Master Page. Then, you basically inherit from that page everywhere that you want its contents to appear.
Example: with one Master Page, you can accomplish the same thing as you could do with two includes -- the Master Page could have both a header and a footer.
However, you can take Master Pages much further if you wish. For example, the universal navigation is often included on a Master Page -- the horizontal menu at the top and/or a vertical menu on the left. Basically anything you want to show on many pages.
Also, you can include common server-side code in the Master Page code-behind, such as authentication.
Step 1: Select the “Tools->External Tools” menu option in VS or Visual Web Developer. This will allow you to configure and add new menu items to your Tools menu.
Step 2: Click the “Add” button to add a new external tool menu item. Name it “Webserver on Port 8010” (or anything else you want).
Step 3: For the “Command” textbox setting enter this value: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\WebDev.WebServer.EXE (note: this point to the web-server that VS usually automatically runs).
Step 4: For the “Arguments” textbox setting enter this value: /port:8010 /path:$(ProjectDir) (or any port you like)
Step 5: Select the “Use Output Window” checkbox (this will prevent the command-shell window from popping up.
Once you hit apply and ok you will now have a new menu item in your “Tools” menu called “WebServer on Port 8010”. You can now select any web project in your solution and then choose this menu option to launch a web-server that has a root site on port 8010 (or whatever other port you want) for the project. You can then connect to this site in a browser by simply saying http://localhost:8010/. All root based references will work fine.
Step 6: The last step is to configure your web project to automatically reference this web-server when you run or debug a site instead of launching the built-in web-server itself. To-do this, select your web-project in the solution explorer, right click and select “property pages”. Select the “start options” setting on the left, and under server change the radio button value from the default (which is use built-in webserver) to instead be “Use custom server”. Then set the Base URL value to be: http://localhost:8010/

5)ASP & ASP.NET.

Active Server Pages (ASP), also known as Classic ASP or ASP Classic, was Microsoft's first server-side script engine for dynamically generated web pages. Initially released as an add-on to Internet Information Services (IIS) via the Windows NT 4.0 Option Pack , it was subsequently included as a free component of Windows Server. ASP.NET, first released in January 2002, has superseded ASP.
ASP.NET is a server-side Web application framework designed for Web development to produce dynamic Web pages. It was developed by Microsoft to allow programmers to build dynamic web sites, web applications and web services.

·        The most important difference between ASP and ASP.Net is that ASP uses interpreted VBScript or JScript, and ASP.net uses any .Net language (including VB.Net, C#, J#, etc.) compiled.
·        ASP 3.0 left all its code in the front of the application. There was no way for a programmer to "hide" the sensitive code which he or she may not want anybody to see. The fact that the code was interpreted also slowed performance. ASP.NET allows the programmer to create dynamic link libraries containing the sensitive code. This may be a disadvantage from an open-source perspective but compiling code into dll's greatly improves performance.
·        ASP is mostly written using VB Script and HTML intermixed. Presentation and business logic is intermixed while ASP.NET can be written in several .NET compliant languages such as C# or VB.NET.
·        ASP has maximum of 4 built in classes like Request, Response, Session and Application whereas ASP.NET using .NET framework classes which has more than 2000 in built classes.
·        ASP does not have any server based components whereas ASP.NET offers several server based components like Button, TextBox etc. and event driven processing can be done at server.
·        ASP doesn't support Page level transactions whereas ASP.NET supports Page level transactions.
·        ASP.NET offers web development for mobile devices which alters the content type (wml or chtml etc.) based on the device.
·        ASP.NET allows separation of business and presentation logic because the code need not be included directly in the *.aspx page.
·        ASP.NET uses languages which are fully object oriented languages like C# and also supports cross language support.
·        ASP.NET offers support for Web Services and rich data structures like DataSet which allows disconnected data processing.

6)An overview – ASP.NET Programming Languages.

Classic ASP - Active Server Pages
Active Server Pages (ASP), also known as Classic ASP, was introduced in 1998 as Microsoft's first server side scripting engine.
ASP is a technology that enables scripts in web pages to be executed by an Internet server.
ASP pages have the file extension .asp, and are normally written in VBScript.

ASP.NET Programming Languages

  • Visual Basic (VB.NET)
  • C# (Pronounced C sharp)
An ASP.NET page is restricted to code written in a single programming language. Currently, ASP.NET supports Visual Basic, C#, and J#. The default language is Visual Basic, but any other language can be declared as the default language for the page by placing a directive at the top of the page, such as the following:
<%@Page Language="C#"%>
The language can also be declared in a <script language = …> block, as in the example provided in Code Blocks in ASP.NET. If different languages are declared in separate script blocks on the same page, an error will be raised.
Although only one language can be used on a single page, any user controls that you use on a page can be written in different languages, including Visual C++. This allows applications to take advantage of function libraries in different languages.
Visual Basic Scripting Edition (VBScript) is not supported, but VBScript syntax is very similar to Visual Basic 2005 syntax, so any required changes to existing code should be minor.

7) Programming Basics: Basics of Programming

1.     Application Program Requirement

2.     Object Oriented Programming

3.     Processing Data

4.     Writing Pseudocode

5.     Exception Handling  

8)Program Flow



9) Effective Coding Techniques

1. How to get rich UI controls with the CodePlex AJAX Toolkit
             Visual Studio's built-in Ajax controls are fairly rudimentary. But
CodePlex has a rich set of 40 Ajax controls available for free.

2. How to highlight validation errors
             After performing input validation, you might want to position the cursor to the input control that generated the validation error, highlighting the values in that control. Using the document object’s select method, I select and highlight the contents of the TextBox named TextBox1:

document.getElementById('TextBox1').select();

3. How to set the default focus to a control
             Another handy technique is setting a given control on a web page to have the focus when a user first opens the page. Using the form’s DefaultFocus property, I set the focus to a TextBox control named TextBox1:
<form id="form1" DefaultFocus="TextBox1" runat="server"></form>
4. How to set a web page's default button
               Sometimes you need a specific button to handle the events when a user presses Enter. To set the default button on a web page, use the form’s DefaultButton property. Here I set a default button, Button1, for form1:
<form id="form1" DefaultButton="Button1" runat="server"></form>

5. How to display a blank item on the DropDownList
                The DropDownList control lets users select friendly display values. But by default, when the control is databound it displays the value of the first item from the database. To display a blank item instead, add a value to the Items collection with an empty string in the Text property. Then set the AppendDataBoundItems property of the DropDownList to True. This inserts the blank value into the DropDownList when it's initially displayed.

6. How to turn off the display of non-visual controls
                When you’re using data binding or many non-visual Ajax controls, the designer can get cluttered. To toggle off the display of ASP.NET non-visual controls, use Ctrl+Shift+N.
7. How to get your connection string                  When developing ASP.NET applications, you can choose where to store your application’s connection string. The best place is almost always in the web.config file. The web.config file is in XML format and the appSettings key can hold multiple connections strings. Below, I use the appSetting key to store connection information:
<appSettings><addkey="MyConnectionString"value="server=MyServer;uid=MyUsername;pwd=MyPassword;database=MyDB" /></appSettings>
To use the values from the web.config file in your applications, include the System.Configuration namespace in your code and use the ConfigurationManager object:
SqlConnectioncn = new SqlConnection(ConfigurationManager.ConnectionStrings\\["MyConnectionString"\\].ConnectionString);


10)Designing Applications.

Security:
             When designing your ASP.NET application, think about security, especially the type of authentication that will be used (Forms, Windows, or Passport), and how sensitive information is stored (username and password). A good reference is Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication, available in the ASP.NET SDK.

Scalability
              It is possible to combine HTML and script on a single page as with previous versions of ASP.NET (called a single-file page) but for all but the simplest pages, the code-behind model should be used. With code-behind, the ASP.NET executable code is placed in a separately compiled DLL, called the code-behind class file, and the .aspx page contains only HTML and ASP.NET server controls. Code-behind design is much more scalable and is much easier to maintain. See the topic titled Introduction to Web Forms Pages in the ASP.NET SDK. Converting ASP Applications to ASP.NET Applications Please see the articles titled Migrating ASP Pages to ASP.NET and Microsoft .NET/COM Migration and Interoperability in the ASP.NET SDK. Converting ISAPI Applications to .NET HTTP Modules
                            HTTP Modules are equivalent to ISAPI filters. They enter the execution pipeline before any handler sees the request and just after all handlers have done their work. HTTP Handlers are equivalent to ISAPI extensions. HTTP module classes must inherit the IHTTPModule interface. HTTP handlers must inherit IHttpHandler. IIS executes an ISAPI filter by calling the HttpFilterProc() method in the filter. ASP.NET executes code in a module in response to an event in the execution pipeline such as Application_OnStart, Session_OnStart or Session_OnEnd. When IIS issues a request to ASP.NET, ASP.NET examines the <HTTPMODULES> and <HTTPHANDLERS> section of all configuration files that apply to the application in order to find modules and handlers that apply to the file name extension (.aspx, for example). If modules or handlers are found, the request is routed to the appropriate code.

                         For Other Units Download the above Document

SHARE

Milan Tomic

Hi. I’m Designer of Blog Magic. I’m CEO/Founder of ThemeXpose. I’m Creative Art Director, Web Designer, UI/UX Designer, Interaction Designer, Industrial Designer, Web Developer, Business Enthusiast, StartUp Enthusiast, Speaker, Writer and Photographer. Inspired to make things looks better.

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

1 comments:

  1. Exсellent piеces. Keep pοsting such kinԁ of
    infοrmation on уouг sіte.

    Im really іmpгeѕseԁ by іt.

    Нello therе, Yоu havе done an incrediblе job.
    Ι'll ceгtаinly dіgg it and peгsοnally recommend to my friends.
    I am suгe they'll bе bеnefited from thіs site.


    My web page; printer sales

    ReplyDelete