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-   (the common property of every control is Text)     Controls                                                 Property/Event 1. Button                                                 Text  2. Link Button                                         Text,PostBackUrl   3. Hyper link                                           Text,NavigateUrl 4. Image Button                                   ...

Object,Class and Inheritance

  Object-  Object is basically used to bridge a communication between class body and main body. Object 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.     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();       ...

Function

  Function  is a small job program.   Types of Functions- 1.Built-in functions (intransic)  2.User defined functions (extransic)  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  ex-    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 P...

Website Development 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:-    1.Static(only informative and no user interface)  2.Dynamic(information and user interface both)  3.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-    1.Single window webpage   ( About us , contact us)   2.Multi window webpage (Registeration,login)  Web Structure-  http://www.domain_name.com  Http- it is responsible for the communication between web browser and web server.  :(Colon)- Server finder operator.   Types of server -  1. Linux server-(Java,php and etc )  Directory (publi...

Dot Net Navigation

  Navigation -  To visit from one place to another.  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.  1. Onpage Navigation - It will show the page name in URL in which we are gonna navigate. Ex:- 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. Ex:- Server.Transfer("any.aspx"); 

Dot Net Basics

  dot net is a framework.   Framework - which supports all form based applications.  Types of code-  1) Logical code(dot net -in which tools are dragged and dropped .they are not created using code , only code will be applied logically)  2) Design code(c++,Java- in which no drag and drop option will be available)  Dot net support languages-  1. Java 2. c# [mostly used]  3. python  4. vb  Dot net support Environment-  1. console application (basic) 2. web application (runs everywhere) 3. windows application (local software) Basics of dot 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- MESSAGE+VARIABLE it is a feature of dot net which separates message and variable   console.writ...

Introduction To JavaScript

 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 imply/apply JavaScript /In what section-  JavaScript is applied in HEAD section within script tag. <head>  <script language="JavaScript">   /*......*/code </script>  </head> JavaScript popup boxes- 1) document.write(" ")  2) alert(" ")  3)  confirm(" ") 4) prompt(" ")  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 c...

Introduction To 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 the both. SCREEN can be managed with the help of div tag and the code can be shared.  TYPES OF CSS:-  1. Inline CSS 2. Internal CSS 3. External CSS  INLINE CSS-   Inline CSS in which CSS is used within the HTML tag in the style attribute. here the file extension will be .html . e.g- <font style="color:blue; "></font>  [here, first thing to note down is we never use"=" equals to sign for the properties to be defined in CSS instead we use ":" colon ] INTERNAL CSS-  We have alre...