Asp.Net Web Forms Projects
Components of .Net Framework | |
There are many articles are available in the web on this topic; I just want to add one more article over the web by explaining Components of .Net Framework. Components of .Net Framework Net Framework is a platform that provides tools and technologies to develop Windows, Web and Enterprise applications. It mainly contains two components, 1. Common Language Runtime (CLR) 2. .Net Framework Class Library. .Net Framework provides runtime environment called Common Language Runtime (CLR).It provides an environment to run all the .Net Programs. The code which runs under the CLR is called as Managed Code. Programmers need not to worry on managing the memory if the programs are running under the CLR as it provides memory management and thread management. Programmatically, when our program needs memory, CLR allocates the memory for scope and de-allocates the memory if the scope is completed. Language Compilers (e.g. C#, VB.Net, J#) will convert the Code/Program to Microsoft Intermediate Language (MSIL) intern this will be converted to Native Code by CLR. See the below Fig. 2. .Net Framework Class Library (FCL) This is also called as Base Class Library and it is common for all types of applications i.e. the way you access the Library Classes and Methods in VB.NET will be the same in C#, and it is common for all other languages in .NET. The following are different types of applications that can make use of .net class library. 1. Windows Application. 2. Console Application 3. Web Application. 4. XML Web Services. 5. Windows Services. In short, developers just need to import the BCL in their language code and use its predefined methods and properties to implement common and complex functions like reading and writing to file, graphic rendering, database interaction, and XML document manipulation.Below are the few more concepts that we need to know and understand as part of this .Net framework. 3. Common Type System (CTS) It describes set of data types that can be used in different .Net languages in common. (i.e), CTS ensures that objects written in different .Net languages can interact with each other. For Communicating between programs written in any .NET complaint language, the types have to be compatible on the basic level. The common type system supports two general categories of types: Value types: Value types directly contain their data, and instances of value types are either allocated on the stack or allocated inline in a structure. Value types can be built-in (implemented by the runtime), user-defined, or enumerations. Reference types: Reference types store a reference to the value's memory address, and are allocated on the heap. Reference types can be self-describing types, pointer types, or interface types. The type of a reference type can be determined from values of self-describing types. Self-describing types are further split into arrays and class types. The class types are user-defined classes, boxed value types, and delegates. 4. Common Language Specification (CLS) It is a sub set of CTS and it specifies a set of rules that needs to be adhered or satisfied by all language compilers targeting CLR. It helps in cross language inheritance and cross language debugging. Common language specification Rules: It describes the minimal and complete set of features to produce code that can be hosted by CLR. It ensures that products of compilers will work properly in .NET environment. Sample Rules: 1. Representation of text strings 2. Internal representation of enumerations 3. Definition of static members and this is a subset of the CTS which all .NET languages are expected to support. 4. Microsoft has defined CLS which are nothing but guidelines that language to follow so that it can communicate with other .NET languages in a seamless manner. Below mentioned the .Net Architecture stack for easy understanding. https://www.c-sharpcorner.com/article/bitwise-operations-in-C-Sharp/ --------------------------------------------------- |
int | 4 byte | -2,147,483,648 to -2,147,483,647 |
long | 8 byte | ?9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
Data Type | Size | Description |
---|---|---|
int | 4 bytes | Stores whole numbers from -2,147,483,648 to 2,147,483,647 |
long | 8 bytes | Stores whole numbers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
float | 4 bytes | Stores fractional numbers. Sufficient for storing 6 to 7 decimal digits |
double | 8 bytes | Stores fractional numbers. Sufficient for storing 15 decimal digits |
bool | 1 bit | Stores true or false values |
char | 2 bytes | Stores a single character/letter, surrounded by single quotes |
string | 2 bytes per character | Stores a sequence of characters, surrounded by double quotes |
Console.WriteLine();
Console.ReadLine();
Debug
https://vasanthrv.blogspot.com/2022/08/aspnet-web-interface-and-abstract.html
All Projects
C:\Users\vasan\source\repos\WebApplication6
RedirectsAnd PageLifeCycle & File Upload
C:\Users\vasan\source\repos\RedirectsAndPageLifeCycle
Continue - C:\Users\vasan\OneDrive\Desktop\Online Class\AspNetProjects\Asp_Sp_Sql
1. Demo Sql & session , redirect etc - C:\Users\vasan\OneDrive\Desktop\Online Class\Demo
2.Web service -
https://www.c-sharpcorner.com/UploadFile/1d42da/web-service-basics/
C:\Users\vasan\OneDrive\Desktop\Online Class\Projects\Web service\WebApplication3
<system.webServer>
<defaultDocument>
<files>
<add value="insertion.aspx" />
</files>
</defaultDocument>
<directoryBrowse enabled="false" />
</system.webServer>
3.IFrame & Application object - C:\Users\vasan\OneDrive\Desktop\Online Class\rajesh\deleteproj\deleteproj
c# - https://www.tutorialspoint.com/asp.net/asp.net_custom_controls.htm
4.page life cycle - https://www.c-sharpcorner.com/UploadFile/8911c4/page-life-cycle-with-examples-in-Asp-Net/
C:\Users\vasan\OneDrive\Desktop\Online Class\AspNetProjects\PageLifecycle\PageLifecycle
5.net_validators - https://www.tutorialspoint.com/asp.net/asp.net_validators.htm
C:\Users\vasan\OneDrive\Desktop\Online Class\AspNetProjects\aspValidation\AspNetValidation\AspNetValidation
C:\Users\vasan\OneDrive\Desktop\Online Class\AspNetProjects\DemoControls_Validation
Validations - https://drive.google.com/file/d/1bsqpCjQc1R-001XKIKIb0HqPPoCrVWRy/view
6.State , cookie , session, redirect C:\Users\vasan\source\repos\Insert_view_Asp_net\Insert_view_Asp_net
7.File Upload - https://www.c-sharpcorner.com/article/Asp-Net-2-0-fileupload-control/
C:\Users\vasan\OneDrive\Desktop\Online Class\Projects\@asp\ASPNetControls
8.MasterPage - https://www.c-sharpcorner.com/article/how-to-create-master-page-in-asp-net/
C:\Users\vasan\OneDrive\Desktop\Online Class\AspMasterPage\masterpage
9.Insert & View From Sp and cookies - C:\Users\vasan\source\repos\Insert_view_Asp_net
ExecuteReader ExecuteNonQuery ExecuteScalar
https://www.aspdotnet-suresh.com/2012/09/executescalar-example-in-aspnet-using-c.html
https://www.aspdotnet-suresh.com/2012/09/executereader-executenonquery.html
10.validation and state management -
https://www.aspdotnet-suresh.com/2011/05/what-is-use-of-globalasax-file-in.html
i)C:\Users\vasan\OneDrive\Desktop\Online Class\AspNetProjects\StateManagement\StateManagement
https://github.com/vasanth32/AspNetStateManagement
ii)C:\Users\vasan\OneDrive\Desktop\Online Class\Projects\validation and state management
--------------------------------------------------------
- protected void Button1_Click(object sender, EventArgs e)
- {
- Response.Redirect("SecondPage.aspx");
- }
- protected void Button2_Click(object sender, EventArgs e)
- {
- Server.Transfer("SecondPage.aspx");
- }
- protected void Button3_Click(object sender, EventArgs e)
- {
- Response.Redirect("http://www.mcnsolutions.net");
- }
- protected void Button4_Click(object sender, EventArgs e)
- {
- Server.Transfer("http://www.mcnsolutions.net");
- }
- protected void Button5_Click(object sender, EventArgs e)
- {
- Server.Execute("http://www.mcnsolutions.net");
- }
Server.Execute
----------------------------------------------------------
11.Encrypt & Decrypt
public class HelloWorld
{
public static void Main(string[] args)
{
string encryptedString = HelloWorld.EnryptString("sourceString");
string encryptedString1 = HelloWorld.DecryptString(encryptedString);
Console.WriteLine (encryptedString1);
}
public static string EnryptString(string strEncrypted)
{
byte[] b = System.Text.ASCIIEncoding.ASCII.GetBytes(strEncrypted);
string encrypted = Convert.ToBase64String(b);
return encrypted;
}
public static string DecryptString(string encrString)
{
byte[] b;
string decrypted;
b = Convert.FromBase64String(encrString);
decrypted = System.Text.ASCIIEncoding.ASCII.GetString(b);
return decrypted;
}
}
-------------------------------
ExecuteScalar (select single value)
Execute Scalar will return first row first column value i.e. it will return single value and ignore other values on execution of SQL Query or Stored procedure using command object. It’s very fast to retrieve single values from database.
ExecuteNonQuery(update / insert / delete)
ExecuteNonQuery method will return number of rows effected with INSERT, DELETE or UPDATE operations.
ExecuteReader (select all rows)
Execute Reader will be used to return the set of rows, on execution of SQL Query or Stored procedure using command object. This one is forward only retrieval of records and it is used to read the table values from first to last.
--------------------------------
Delegates
// Online C# Editor for free
// Write, Edit and Run your C# code using C# Online Compiler
using System;
delegate void Procedure();
public class DelegateDemo
{
public static void channel1()
{
Console.WriteLine("channel 1");
}
public static void channel2()
{
Console.WriteLine("channel 2");
}
public static void channel3()
{
Console.WriteLine("channel 3");
}
public static void Main(string[] args)
{
Procedure someProcs = null;
someProcs += new Procedure(channel1);
someProcs += new Procedure(channel2); // Example with omitted class name
someProcs();
}
}
https://www.javatpoint.com/events-in-c-sharp
--------------------------------
----------------------------
Page Life Cycle
* When a page is requested, it is loaded into the server memory, processed, and sent to the browser. Then it is unloaded from the memory
* At each of these steps, methods and events are available, which could be overridden according to the need of the application. In other words, you can write your own code to override the default code.
ASP.NET Page Life Cycle Events
At each stage of the page life cycle, the page raises some events, which could be coded. An event handler is basically a function or subroutine, bound to the event, using declarative attributes such as Onclick or handle.
Following are the page life cycle events:
PreInit - PreInit is the first event in page life cycle. It checks the IsPostBack property and determines whether the page is a postback. It sets the themes and master pages, creates dynamic controls, and gets and sets profile property values. This event can be handled by overloading the OnPreInit method or creating a Page_PreInit handler.
Init
- This event fires after each control has been initialized.
- Each control's UniqueID is set and any skin settings have been applied.
- Use this event to read or initialize control properties.
- The "Init" event is fired first for the bottom-most control in the hierarchy, and then fired up the hierarchy until it is fired for the page itself.
Comments
Post a Comment