Posts

Showing posts from April, 2021

Date and Time

  * In Dot Net 'Now' is an object defined under "DateTime" library , is set the current time and date of your computer, general computer time is also set/display  using Now object.   How can we display Time and Date in Dot Net- 1. Firstly, drag a button and a label control [ We will code inside the button click event and the Date & Time will be shown in the Label control ]  ex. - //Date  Label1.Text = DateTime.Now.ToString("dd/MMMM/yyyy"); Label1.Text = DateTime.Now.ToString("dd"); //Day  Label1.Text = DateTime.Now.ToString("dddd"); //Month Label1.Text = DateTime.Now.ToString("MMMM");  //Year Label1.Text = DateTime.Now.ToString("yyyy");  //Time Label1.Text = DateTime.Now.ToShortTimeString();  ADDING Hours/Months/Years to Current Time-  Implementation[We will use this function to show the user that the your subscription will gonna expire on that date]  Let's have a look-  Label1.Text = DateTime.Now.AddHours(5)....

Image Handling

Image handling can be done by two ways- 1. Using controls. 2. Using code. Using controls- a) Image Control- ImageUrl is the property of Image control.   b) ImageButton Control- ImageUrl, PostBackUrl Steps to add image in image control-  i.   Create a directory in your project.  ii.  Add an image in that directory.  iii. Refresh the solution explorer(In dot net).  iv. Now, Go to the properties of Image control> ImageUrl> Click on the dots > Select the image from the dialog box  ======================================   File Upload Control- It allows us to Upload Image to a server or store in web form.  Drag n Drop File Upload Control from tool box, take a button control beside it[Name it as Upload],Image control. When we browse the file and click on Upload button, the image will be stored in the folder we have created earlier and be shown in the Image control.   FileUpload1.SaveAs(Server.MapPath("~") + "//Pho...

State Management

  STATE MANAGEMENT is the process of transferring data from one page to another. When the website go for roundtrip then the data entered in any TextBox will be lost. Then we use this for data to be stored either in client side or in the memory of server. 1.Session- It is used to transfer data reliably or transferring the sensitive data from one page to another. Default time limit for Session is 60 sec. i.   Session is always created inside an event.  ii.  Session data can't be shown in URL. iii. Session is called in the Page_Load event of the next page.   Syntax-  Session["variable_name"] = TextBox1.Text;  Response.Redirect("Page_name.aspx"); This code should be written inside any event of the page from where data is to be transferred to next page.  TextBox1.Text(Control) = Whose data is to be transferred ["variable_name"] = Any variable can be given within inverted quotes.  Next Page- |>Session is called in the Page_load event ...

QnA

Q-why is driver(main) body defined static??  Ans:-application entry point. Q-what is (object sender,EventArgs e)?? Ans:- object is defined as the control defined(like textbox1) and EventArgs is the event of that control.  Q-why doesn't the copied code run in different web form?? Ans:- when we debug the code then the supported file(.config) file runs and supported file can not be copied that's why the copied code doesn't work.  Q- OOPs supported initialisation? Ans-OOPs supports Dynamic initialisation. Q- Which property is used for the implementation of RadioButtonList? Ans-By default,RadioButtonList takes 0 as SelectedIndex(property).[go to Assign 2 in dotnet] Q- concept of IsPostBack?? Q-what are cases of objects,class,methods and etc.??  Q-what is namespace??  Q-what is string[] args??  If you would like to answer these question....COMMENT.

Points To Remember!!

  *   "using" keyword is used to define header file like # is used in c language  * ReadKey() is used to break the screen as it was getch() in c.  * Pink/purple icon defines function.  * c# is purely object oriented programming language.(here program  is written inside a class) * c++ is partially object oriented programming language.(here program can be created without using class, inside main function)  * The name of first web form created in asp.net is Default.aspx which is not meant to be changed]   * When we debug our webform with some text written over the design mode then it will show an error [to include the config file  ,we have to say 'yes' here]    * In dot net ,Config is supported file which actually runs.     (like in C .obj is supported file which is run during the time of execution )  * ['*' symbol says that your file is not yet saved.] * Our web form will be run in local server (local host)...

ASP.NET Controls

📘 ASP.NET Controls 🔹 ASP.NET Controls (the common property of every control is Text ) 🔹 Controls and Their Properties / Events Button → Text Link Button → Text, PostBackUrl Hyperlink → Text, NavigateUrl Image Button → ImageUrl, PostBackUrl 🔹 5) Radio Button List Property → SelectedIndex Used to select one option at a time Implementation: [QUIZ] It has index system The first option is assigned 0th position 🔹 6) MultiView Property → ActiveViewIndex (by default -1) MultiView Control is used to display multiple content in a single page. Using Control: Drag and drop MultiView control from toolbox By default ActiveViewIndex = -1 (blank memory) Insert required number of View controls Change ActiveViewIndex to 0 🔹 7) DropDownList Event → IndexChanged We can add data using two methods: 1) Using Controls Select DropDownList Control Click on Mastertag Dialog box opens → Add items Note: Index starts from 0 2) Using Code DropDownList1.Items.Add(TextBox1.Text); Items → It is an array (wo...

Object,Class and Inheritance

📘 Object, Class & Inheritance in C# 🔹 Object Object is basically used to bridge a communication between class body and main body. Objects are always created inside the main body. 🔹 Syntax className objName = new className(); objName.function(); // it could be any function inside the class new → new keyword is known as Memory allocation operator dot (.) → Member access operator used to access functions 🔹 Example class Program { public void display(int a1) { Console.WriteLine("I am a function "); } static void Main(string[] args) { int a; Program p1 = new Program(); p1.display(); Console.ReadKey(); } } 🔹 Class Class is defined as the collection of data members and member functions. Data members → all the variables inside the class Member functions → all the functions 🔹 Inheritance Inheritance is the reusability of class. 🔹 Types of Classes Base Class (top class of the program) Derived Class 🔹 Rule...

Function

📘 Functions in Programming 🔹 Function Function is a small job program. 🔹 Types of Functions Built-in functions (intransic) User defined functions (extransic) 🔹 Function Separator Function separator → ( ) 🔹 Terminology 1) Function Definition When the function is defined. void function() { statements; } The function is defined under the class body, not inside main body. 2) Function Calling When the function is called. function(); The function is called inside the main body. 3) Function Parameters Parameters are defined in function separator. Example: void func(parameters) { } 🔹 Types of Parameters / Arguments 1) Actual Parameters When the function is called. They are also called Sender Parameters . 2) Formal Parameters When the function is defined. They are also called Receiver Parameters .

Website Development Basics

📘 Website Working Technology & Web Basics 🔹 Website Working Technology Round Trip Technology (request and response occur in the same page) 🔹 Professional Texting Professional texting can be done using font awesome (icon toolkit based on css) 🔹 Types of Website Static (only informative and no user interface) Dynamic (information and user interface both) Fuzion (Algorithms based website) - based on calculations Ex. If user want to see website of furniture in which he/she can look 3d view of the furniture or other measurement parameters 🔹 Types of Webpage Single window webpage (About us, contact us) Multi window webpage (Registeration, login) 🔹 Web Structure http://www.domain_name.com 🔹 HTTP Http - it is responsible for the communication between web browser and web server. 🔹 Colon (:) :(Colon) - Server finder operator. 🔹 Types of Server Linux server (Java, php and etc) Directory (publichtml/www) Windows server (dotnet, Salesforce) Directory (httpdocs) Cloud (both direc...

Dot Net Navigation

📘 Navigation in .NET 🔹 Navigation To visit from one place to another. 🔹 Navigation Using Controls We can use Navigation using: Controls: i. Link button (text, postbackurl) ii. hyperlink (text, NavigateUrl) iii. Imagebutton (ImageUrl, NavigateUrl) 🔹 Code In button if we want to set the navigation, we need to double click on it to open the code window. 🔹 Types of Navigation 1) Onpage Navigation It will show the page name in URL in which we are gonna navigate. Example: Response.Redirect("any.aspx"); 2) Offpage Navigation The page name will still be shown as the previous page in URL. It is basically used for security purposes. Example: Server.Transfer("any.aspx");

Dot Net Basics

📘 .NET Framework – Basics & Concepts 🔹 .NET dot net is a framework. 🔹 Framework Framework- which supports all form based applications. 🔹 Types of Code Logical code (dot net - in which tools are dragged and dropped, they are not created using code, only code will be applied logically) Design code (c++, Java - in which no drag and drop option will be available) 🔹 Dot Net Supported Languages Java C# [mostly used] Python VB 🔹 Dot Net Supported Environment Console application (basic) Web application (runs everywhere) Windows application (local software) 🔹 Basics of .NET int x; // blue words are data types x = int.Parse(Console.ReadLine()); // parsing // int.Parse - for integer input // float.Parse - for float input // no conversion for string variable Console.WriteLine(" the value of x is " + x); // Cascading operator 🔹 Cascading Operator CASCADING OPERATOR- MESSAGE + VARIABLE It is a feature of dot net which separates message and variable Example: Console.WriteL...

Introduction To JavaScript

📘 JavaScript – Basics & Concepts 🔹 JavaScript JavaScript is event driven language and case sensitive language. Let us see how JavaScript can overcome the drawbacks of CSS- 🔹 Drawbacks of CSS CSS can not handle events,it is only used to style the webpage. Events can not be performed with the help of CSS. e.g- EVENTS means if i click in any button so some action has to be performed. Instead JAVASCRIPT is event handler language. 🔹 Where do we apply JavaScript? JavaScript is applied in HEAD section within script tag. <head> <script language="JavaScript"> /*......*/code </script> </head> 🔹 JavaScript Popup Boxes document.write(" ") alert(" ") confirm(" ") prompt(" ") 🔹 Modal Window The mini-window with the message is called a modal window. The word “modal” means that the visitor can’t interact with the rest of the page, press other buttons, etc, until they have dealt with the window. In this case – until...

Introduction To CSS

📘 CSS (Cascading Style Sheets) 🔹 CSS CSS (Cascading Style Sheets):- CSS is the skin of HTML skeleton. HTML was unable to do SCREEN ARRANGEMENT and CODE SHARING (we cannot use a piece of code from one HTML doc to another). But with the help of CSS we can do both. SCREEN can be managed with the help of div tag and the code can be shared. 🔹 Types of CSS Inline CSS Internal CSS External CSS 🔹 Inline CSS Inline CSS in which CSS is used within the HTML tag in the style attribute. File extension → .html Example: <font style="color:blue;"></font> Note:- We never use "=" for properties in CSS, instead we use ":" 🔹 Internal CSS Defined inside <head> tag using <style> tag. File extension → .html Example: <html> <head> <style type="text/css"> p{ color:green; text-align:center; } body { background-color:yellow; } </style> </head> <body> <p>this is internal CSS</p> ...