A form is used to pass information from a web browser to
a web server.There are two different ways that a form can be submitted from
your browser to the webserver. In HTML, this is how one would define the
opening form tags for both submission methods: <form
method="GET"> and <form method="POST">.
If a "GET" request is used, the form parameters
are encoded in the URL in what is called a query string.
www.example.com/?login=usetricks@email.com&password=xxyz
In the GET request above, you can see that the form
parameters (login and password) are attached to the end of the URL itself.
A POST request, unlike a GET request, passes the form
parameters in the body of the HTTP request, not in the URL.
Here i am showing the Comparison chart between GET and POST
methods
GET
Method ():
1.form parameters is appended to the URL.
2.Data is not secret it is public.
3.It is a single call system
4.GET is less secure compared to POST because data sent
is part of the URL. So it's saved in browser history and server logs in
plaintext.
5.GET method is visible to everyone (it will be displayed
in the browser's address bar) and has limits on the amount of information to
send.
6.7607 character maximum size.
7.Can be cached.
POST
Method ():
1.form parameters is not appended to the URL.Post Method
passes the form parameters in the body of the HTTP request, not in the URL.
2.Data is secret it is not public in post method.
3.It is a two call system .
4.POST is a little safer than GET because the parameters
are not stored in browser history or in web server logs.
5.POST method variables are not displayed in the URL.
6.8 Mb max size for the POST method.
7.Can not be cached.
Definition -
What does .NET Framework (.NET) mean?
The .NET
framework is a software development framework from Microsoft. It provides a
controlled programming environment where software can be developed, installed
and executed on Windows-based operating systems.
NET
Framework is a complete environment that allows developers to develop, run, and
deploy the following applications:
1-Console
applications
2-Windows
Forms applications
3-Windows
Presentation Foundation (WPF) applications
4-Web
applications (ASP.NET applications)
5-Web services
6-Windows
services
7-Service-oriented
applications using Windows Communication Foundation (WCF)
8-Workflow-enabled
applications using Windows Workflow Foundation (WF)
The .NET Framework has two main components: the
common language runtime (CLR) and .NET Framework class library. The CLR is the
foundation of the .NET framework and provides a common set of services for
projects that act as building blocks to build up applications across all tiers.
It simplifies development and provides a robust and simplified environment
which provides common services to build application. The .NET framework class
library is a collection of reusable types and exposes features of the runtime.
It contains of a set of classes that is used to access common functionality.
The .NET Framework Interview Questions will give you an insight to the .NET platform.Here i tried to cover the whole .NET Framework Interview Questions which form the basis of an interview and the interviewer asks them to check your familiarity with the platform .
.NET Framework Interview Questions & Latest .net technical interview questions asked by interviewer. The Q&A mentioned over here have been taken from forums, my colleagues.
.NET Framework Interview Questions & Latest .net technical interview questions asked by interviewer. The Q&A mentioned over here have been taken from forums, my colleagues.
All .NET Framework Interview Questions with Answer.
1- What is .NET Framework?
2. What are the main components of .NET Framework?
2. What are the main components of .NET Framework?
3. List the new features added in .NET Framework 4.0.
4. What is an IL?
5. What is Manifest?
6. What are code contracts?
7. Name the classes that are introduced in the System.Numerics namespace.
10. What is Common Type System (CTS)?
Difference between MVC2, MVC3 and MVC4
View Engine :
·
View Engine is responsible for rendering of the HTML code from
your views to the browser.
·
MVC 2 uses only Web Forms view engine (.aspx) as a default View
Engine.
·
MVC3 uses Razor View Engine (.cshtml for c# and .vbhtml for Visual
Basic) and Web Forms view engine (.aspx).
·
MVC4 also uses Razor View Engine as a default view engine with
some new features like condition attribute and ‘Tilde slash’.
Chart, WebGrid, Crypto,WebImage, WebMail Controls :
·
All these are not available in MVC2.
·
All these are available in MVC3 and in MVC4.
Syntex :
·
(HTML Syntax) Web Forms view engine syntax: <%=Html code %>
in MVC2.
·
(Razor Syntax) Razor View Engine syntax: @Html code in MVC3.
·
MVC4 has the same Razor View Engine Syntax but with the addition of
new features like conditional attribute and ‘Tilde Slash’ i.e. URL resolution.
Objects available for sharing of data between View and Controller :
·
TempData, ViewData are available in MVC2.
·
TempData, ViewData ,ViewBag are available in MVC3.
·
TempData, ViewData ,ViewBag are available in MVC4.
·
TempData is used with current and subsequent request i.e. when you
know the next view to be redirected.
·
In ViewData, dictionary of objects are accessible via strings as
keys.
·
ViewBag was added in the C# 4.0 which uses the dynamic feature
that allows to add properties of an object dynamically . We can say that
ViewBag = ViewData + dynamic feature around the ViewData dictionary.
Jquery Support :
·
Jquery support is Good in MVC2.
·
Jquery support is Better in MVC3.
·
MVC4 provides better support for Jquery like Jquery Mobile.
Dependency Injection Support :
·
Dependency injection is Good in MVC2.
·
It provides powerful hooks with Dependency Injection and Global
Action Filters in MVC3.
·
Better support in MVC4.
Layout Support :
·
Supports only Master Page in MVC2.
·
Supports not only Master Page but also Layout Page in MVC 3 and in
MVC4.
Validation :
·
Client-side Validation and Asynchronous controllers is there in
MVC2.
·
Unobtrusive Ajax and Client side Validation, Jquery Validation and
JSON binding support is in MVC3.
·
Client side validation, Jquery validation and enhanced support for
asynchronous methods in MVC4.
Project Templates :
·
MVC3 supports project templates enabled by HTML 5.
·
MVC4 supports many new features for mobile apps and also provides
new mobile project template and default templates are refreshed and modernized.
Is using try catch is good experience in coding practice
here is a detailed answer .
Best practice is that exception handling should never
hide issues. This means that try-catch blocks should be extremely rare.
There are 3 circumstances were using a try-catch makes
sense.
1. Always deal with known exceptions as low-down as you
can. However, if you're expecting an exception it's usually better practice to
test for it first. For instance parse, formatting and arithmetic exceptions are
nearly always better handled by logic checks first, rather than a specific
try-catch.
2. If you need to do something on an exception (for
instance logging or roll back a transaction) then re-throw the exception.
3. Always deal with unknown exceptions as high-up as you
can - the only code that should consume an exception and not re-throw it should
be the UI or public API.
Below is the use of JIT.
1. JIT is a compiler which converts MSIL code to Native
Code (ie.. CPU-specific code that runs on the same computer architecture).
2. Because the common language runtime supplies a JIT
compiler for each supported CPU architecture, developers can write a set of
MSIL that can be JIT-compiled and run on computers with different
architectures.
3. However, your managed code will run only on a specific
operating system if it calls platform-specific native APIs, or a
platform-specific class library.
4. JIT compilation takes into account the fact that some
code might never get called during execution.
5. Rather than using time and memory to convert all the
MSIL in a portable executable (PE) file to native code, it converts the MSIL as
needed during execution and stores the resulting native code so that it is
accessible for subsequent calls.
6. The loader creates and attaches a stub to each of a
type's methods when the type is loaded.
7. On the initial call to the method, the stub passes
control to the JIT compiler, which converts the MSIL for that method into
native code and modifies the stub to direct execution to the location of the
native code.
8. Subsequent calls of the JIT-compiled method proceed
directly to the native code that was previously generated, reducing the time it
takes to JIT-compile and run the code.
1. GUID is Short form of Globally Unique Identifier, a unique 128-bit number that is produced by the Windows OS or by some Windows applications to identify a particular component, application, file, database entry, and/or user.
2. For instance, a Web site may generate a GUID and assign it to a user's browser to record and track the session.
3. A GUID is also used in a Windows registry to identify COM DLLs.
4. Knowing where to look in the registry and having the correct GUID yields a lot information about a COM object (i.e., information in the type library, its physical location, etc.).
5. Windows also identifies user accounts by a username (computer/domain and username) and assigns it a GUID.
6. Some database administrators even will use GUIDs as primary key values in databases.
7. GUIDs can be created in a number of ways, but usually they are a combination of a few unique settings based on specific point in time (e.g., an
IP address, network MAC address, clock date/time, etc.).
Here i am showing how to create a GUID in c#?
2. For instance, a Web site may generate a GUID and assign it to a user's browser to record and track the session.
3. A GUID is also used in a Windows registry to identify COM DLLs.
4. Knowing where to look in the registry and having the correct GUID yields a lot information about a COM object (i.e., information in the type library, its physical location, etc.).
5. Windows also identifies user accounts by a username (computer/domain and username) and assigns it a GUID.
6. Some database administrators even will use GUIDs as primary key values in databases.
7. GUIDs can be created in a number of ways, but usually they are a combination of a few unique settings based on specific point in time (e.g., an
IP address, network MAC address, clock date/time, etc.).
Here i am showing how to create a GUID in c#?
Guid id
= Guid.NewGuid();
Console.WriteLine(id); // Outputs
"8c1d1c4b-df68-454c-bf30-953e5701949f"
you can rename a table in SQL Server 2005,2008 and 2012 by using SQL Server Management Studio or Transact-SQL.
Renaming a table will not automatically rename references to that table. You must manually modify any objects that reference the renamed table. For example, if you rename a table and that table is referenced in a trigger, you must modify the trigger to reflect the new table name.
Here i am describe all the ways to rename a table databse and column.
1-Rename Database:
Renaming a table will not automatically rename references to that table. You must manually modify any objects that reference the renamed table. For example, if you rename a table and that table is referenced in a trigger, you must modify the trigger to reflect the new table name.
Here i am describe all the ways to rename a table databse and column.
1-Rename Database:
1-sp_renameDB 'oldDB','newDB'
2-ALTER DATABASE Test
MODIFY NAME =
NewTest
2-Rename column name
Now, we see how to
change the Column Name the below script will change table column name from “OldName”
to “NewNameChange”
USE yourdatabasename
GO
sp_RENAME 'TableName.OldName', 'NewNameChange' , 'COLUMN'
GO:
GO
sp_RENAME 'TableName.OldName', 'NewNameChange' , 'COLUMN'
GO:
3.Renaming database table to new name.
We can also change the table name too with using the same
command.
sp_RENAME
'oldname'
,
'newname'
GO
To rename a table
- In Object Explorer, right-click the table you want to
rename and choose Design from the shortcut menu.
- From the View menu,
choose Properties.
- In the field for the Name value
in the Properties window, type a new name for the table.
- To cancel this action, press the ESC key before leaving
this field.
- From the File menu
choose Save table
name.
you can rename a database in SQL Server 2005,2008 and 2012 by using SQL Server Management Studio or Transact-SQL.
Here i am describe all the ways to rename a Database .
Rename Database using Transact-SQL.:
Using SQL Server Management Studio To rename a Database:
1-In Object Explorer, right-click the database you want to rename and choose Design from the shortcut menu.
2-From the View menu, choose Properties.
3-In the field for the Name value in the Properties window, type a new name for the database.
4-To cancel this action, press the ESC key before leaving this field.
5-From the File menu choose Save name.
Here i am describe all the ways to rename a Database .
Rename Database using Transact-SQL.:
1-sp_renameDB 'oldDB','newDB'
2-ALTER DATABASE Test
MODIFY NAME =
NewTest
Using SQL Server Management Studio To rename a Database:
1-In Object Explorer, right-click the database you want to rename and choose Design from the shortcut menu.
2-From the View menu, choose Properties.
3-In the field for the Name value in the Properties window, type a new name for the database.
4-To cancel this action, press the ESC key before leaving this field.
5-From the File menu choose Save name.
Here i am showing an example to Insert a date into a textbox and then that date would be selected in the calendar control in asp.net.And also the selected date in calendar will fill in textbox control.
This is .aspx page code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Calender.aspx.cs" Inherits="Calender" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD
XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<div>
<asp:Calendar ID="Calendar1" runat="server" Visible="False" OnSelectionChanged="Calendar1_SelectionChanged"></asp:Calendar>
</div>
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
<asp:LinkButton ID="LinkButton1"
runat="server"
onclick="LinkButton1_Click">PickDate...</asp:LinkButton>
</div>
</form>
</body>
</html>
This is code behind page code
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
public partial class Calender : System.Web.UI.Page
{
protected void Page_Load(object
sender, EventArgs e)
{
}
protected void LinkButton1_Click(object
sender, EventArgs e)
{
Calendar1.Visible = true;
}
protected void Calendar1_SelectionChanged(object sender, EventArgs
e)
{
TextBox1.Text =
Calendar1.SelectedDate.ToLongDateString();
Calendar1.Visible = false;
}
protected void TextBox1_TextChanged(object
sender, EventArgs e)
{
Calendar1.SelectedDate = Convert.ToDateTime(TextBox1.Text);
}
}