Monday, 29 September 2014

What are the different types of Validation controls in ASP.NET

In order to validate user input, ASP.NET provides validation server controls. All validation controls inherits from BaseValidator class which contains the common validation properties and methods like ControlToValidate,EnabledIsValidEnableClientScriptValidationGroup,Validate() etc.

ASP.NET provides a range of validation controls:
  • RequiredFieldValidator validates compulsory/required input.
  • RangeValidator validates the range. Validates that input falls between the given range values.
  • CompareValidator validates or compares the input of a control with another control value or with a fixed value.
  • RegularExpressionValidator validates input value against a defined regular expression pattern.
  • CustomValidator allows to customize the validation logic with respect to our application logic.
  • ValidationSummary displays all errors on page collectively.

What is the difference Grid View and between Data Grid (Windows)


1) GridView Control Enables you to add sorting, paging and editing capabilities without writing any code.
2)GridView Control Automatically Supports paging by setting the ‘PagerSetting’ Property.The Page Setting Property supports four Modles 

a. Numeric(by default)
b. Next Previous
c. NumericFirstLast
d. Next PreviousLast

3)It is Used in asp.net
4)GridView Supports RowUpdating and RowUpdated Events.
5)GidView is Capable of Pre-Operations and Post-Operations.
6)GridView Has EditTemplates for this control
7)It has AutoFormat

DataGrid(Windows) 

1)DataGid Control raises single Event for operations
2)DataGird Supports the SortCommand Events that occur when a column is Soted.
3)DataGrid Supports UpdataCommand Event that occurs when the UpdateButton is clicked for an item in the grid.
4)DataGrid is used in Windows GUI Application.
5)It doesnot have EditTemplates for this control
6)It doesnot have AutoFormat

What is the difference between custom controls and user controls?


Custom controls are basically compiled code i.e. DLLs. These can be easily added to toolbox, so it can be easily used across multiple projects using drag and drop approach. These controls are comparatively hard to create.

But User Controls (.ascx) are just like pages (.aspx). These are comparatively easy to create but tightly couple with respect to User Interface and code. In order to use across multiple projects, we need to copy and paste to the other project as well.




Difference between a CustomControl and a UserControl

So now you have got the difference between a Custom Control and a User Control, I guess. Let's summarize the differences again. Read the comparison below to make things clear:

Custom ControlUser Control
A loosely coupled control w.r.t code and UIA tightly coupled control w.r.t code and UI
Derives from ControlDerives from UserControl
Defines UI in a ResourceDictionaryDefines UI as normal XAML
UI is skinableChild controls are skinable
Has dynamic layoutHas static layout
UI can be changed in different projectsUI is fixed and can't have different looks in different project
Has full toolbox supportCan't be added to the toolbox
Defines a single controlDefines a set of controls
More flexibleNot very flexible like a Custom Control
Requires in-depth knowledge of Silverlight UI ModelDoes not require indepth knowledge of the UI Model
Hope you now have a better understanding from the above comparison table.

ASP.NET Page life Cycle


ASP.NET page passes through a series of steps during its life cycle. Following is the high-level explanation of life cycle stages/steps.
Initialization: Controls raise their Init event in this stage.Objects and variables are initializes for complete lifecyle of request.
LoadViewState: is a post back stage and loads the view state for the controls that enabled its view state property.
LoadPostBackData: is also a post back stage and loads the data posted for the controls and update them.
Load: In this stage page as well as all the controls raise their Load event. Till this stage all the controls are initialized and loaded. In most of the cases, we are coding this event handler.
RaisePostBackEvent: is again a postback stage. For example, it's raise against a button click event. We can easily put our code here to perform certain actions.
SaveViewState: Finally, controls state is saved in this stage before Rendering HTML.
Render: This is the stage where HTML is generated for the page.
Dispose: Lastly, all objects associated with the request are cleaned up.
For very detailed explanation of Page Life Cycle is explained here.

Interview Questions on ASP.NET

13. How do you sign out from forms authentication?
The FormsAuthentication.Signout() method is used to sign out from the forms authentication.
14. What is AutoPostBack?
If you want a control to postback automatically when an event is raised, you need to set the AutoPostBack property of the control to True.
15. What is the function of the ViewState property?
The ASP.NET 4.0 introduced a new property called ViewStateMode for the Control class. Now you can enable the view state to an individual control even if the view state for an ASP.NET page is disabled.
16. Why do you use the App_Code folder in ASP.NET?
The App_Code folder is automatically present in the project. It stores the files, such as classes, typed data set, text files, and reports. If this folder is not available in the application, you can add this folder. One of the important features of the App_Code folder is that only one dll is created for the complete folder, irrespective of how many files it contains.
17. Define a multilingual Web site.
A multilingual Web site serves content in a number of languages. It contains multiple copies for its content and other resources, such as date and time, in different languages.
18. What is an ASP.NET Web Form?
ASP.NET Web forms are designed to use controls and features that are almost as powerful as the ones used with Windows forms, and so they are called as Web forms. The Web form uses a server-side object model that allows you to create functional controls, which are executed on the server and are rendered as HTML on the client. The attribute,runat="server", associated with a server control indicates that the Web form must be processed on the server.
19. What is the difference between a default skin and a named skin?
The default skin is applied to all the Web server controls in a Web form, which are of similar type, and it does not provide a Skin ID attribute. The named skin provides a Skin ID attribute and users have to set the Skin ID property to apply it.
20. What is IIS? Why is it used?
Internet Information Services (IIS) is created by Microsoft to provide Internet-based services to ASP.NET Web applications. It makes your computer to work as a Web server and provides the functionality to develop and deploy Web applications on the server. IIS handles the request and response cycle on the Web server. It also offers the services of SMTP and FrontPage server extensions. The SMTP is used to send emails and use FrontPage server extensions to get the dynamic features of IIS, such as form handler.
21. What is Query String? What are its advantages and limitations?
The Query String helps in sending the page information to the server.

The Query String has the following advantages:
  • Every browser works with Query Strings.
  • It does not require server resources and so does not exert any kind of burden on the server.

The following are the limitations of Query String:
  • Information must be within the limit because URL does not support many characters.
  • Information is clearly visible to the user, which leads to security threats.
22. What is actually returned from server to the browser when a browser requests an .aspx file and the file is displayed?
When a browser requests an .aspx file then the server returns a response, which is rendered into a HTML string.
23. How can you display all validation messages in one control?
The ValidationSummary control displays all validation messages in one control.
24. Which two new properties are added in ASP.NET 4.0 Page class?
The two new properties added in the Page class are MetaKeyword and MetaDescription.
25. What is tracing? Where is it used?
Tracing displays the details about how the code was executed. It refers to collecting information about the application while it is running. Tracing information can help you to troubleshoot an application. It enables you to record information in various log files about the errors that might occur at run time. You can analyze these log files to find the cause of the errors.

In .NET, we have objects called Trace Listeners. A listener is an object that gets the trace output and stores it to different places, such as a window, a file on your locale drive, or a SQL Server.

The System.Diagnostics namespace contains the predefined interfaces, classes, and structures that are used for tracing. It supplies two classes, Trace and Debug, which allow you to write errors and logs related to the application execution. Trace listeners are objects that collect the output of tracing processes.
26. What is the difference between authentication and authorization?
Authentication verifies the identity of a user and authorization is a process where you can check whether or not the identity has access rights to the system. In other words, you can say that authentication is a procedure of getting some credentials from the users and verify the user's identity against those credentials. Authorization is a procedure of granting access of particular resources to an authenticated user. You should note that authentication always takes place before authorization.
27. How can you register a custom server control to a Web page?
You can register a custom server control to a Web page using the @Register directive.
28. Which ASP.NET objects encapsulate the state of the client and the browser?
The Session object encapsulates the state of the client and browser.
29. Differentiate globalization and localization.
The globalization is a technique to identify the specific part of a Web application that is different for different languages and make separate that portion from the core of the Web application. The localization is a procedure of configuring a Web application to be supported for a specific language or locale.
30. What is ViewState?
The ViewState is a feature used by ASP.NET Web page to store the value of a page and its controls just before posting the page. Once the page is posted, the first task by the page processing is to restore the ViewState to get the values of the controls.

ASP.net Interview Basics Questions...

1. What is ASP?
Active Server Pages (ASP), also known as Classic ASP, is a Microsoft's server-side technology, which helps in creating dynamic and user-friendly Web pages. It uses different scripting languages to create dynamic Web pages, which can be run on any type of browser. The Web pages are built by using either VBScript or JavaScript and these Web pages have access to the same services as Windows application, including ADO (ActiveX Data Objects) for database access, SMTP (Simple Mail Transfer Protocol) for e-mail, and the entire COM (Component Object Model) structure used in the Windows environment. ASP is implemented through a dynamic-link library (asp.dll) that is called by the IIS server when a Web page is requested from the server.

2. What is ASP.NET?
ASP.NET is a specification developed by Microsoft to create dynamic Web applications, Web sites, and Web services. It is a part of .NET Framework. You can create ASP.NET applications in most of the .NET compatible languages, such as Visual Basic, C#, and J#. The ASP.NET compiles the Web pages and provides much better performance than scripting languages, such as VBScript. The Web Forms support to create powerful forms-based Web pages. You can use ASP.NET Web server controls to create interactive Web applications. With the help of Web server controls, you can easily create a Web application.

3. What is the basic difference between ASP and ASP.NET?
The basic difference between ASP and ASP.NET is that ASP is interpreted; whereas, ASP.NET is compiled. This implies that since ASP uses VBScript; therefore, when an ASP page is executed, it is interpreted. On the other hand, ASP.NET uses .NET languages, such as C# and VB.NET, which are compiled to Microsoft Intermediate Language (MSIL).

4. In which event are the controls fully loaded?
Page load event guarantees that all controls are fully loaded. Controls are also accessed in Page_Init events but you will see that view state is not fully loaded during this event.
5. How can we identify that the Page is Post Back?
Page object has an "IsPostBack" property, which can be checked to know that is the page posted back.

6. What is the lifespan for items stored in ViewState?
The items stored in ViewState live until the lifetime of the current page expires including the postbacks to the same page.
7. How information about the user's locale can be accessed?
The information regarding a user's locale can be accessed by using the System.Web.UI.Page.Culture property.
8. What is the difference between SQL notification and SQL invalidation?
The SQL cache notification generates notifications when the data of a database changes, on which your cache item depends. The SQL cache invalidation makes a cached item invalid when the data stored in a SQL server database changes.
9. Which is the parent class of the Web server control?
The System.Web.UI.Control class is the parent class for all Web server controls.
10. Can you set which type of comparison you want to perform by the CompareValidator control?
Yes, by setting the Operator property of the CompareValidator control.
11. What is the behavior of a Web browser when it receives an invalid element?
The behavior of a Web browser when it receives an invalid element depends on the browser that you use to browse your application. Most of the browsers ignore the invalid element; whereas, some of them display the invalid elements on the page.
12. What are the advantages of the code-behind feature?
The code-behind feature of ASP.NET offers a number of advantages:
  • Makes code easy to understand and debug by separating application logic from HTML tags
  • Provides the isolation of effort between graphic designers and software engineers
  • Removes the problems of browser incompatibility by providing code files to exist on the Web server and supporting Web pages to be compiled on demand.

Friday, 1 August 2014

Advantages of ASP.net Over Other Languages such as PHP ,JAVA

Advantages of ASP.net Over Other Languages such as PHP ,JAVA Below

  • C# being a .NET language, supports language interoperability, i.e. C# can access code written in any .NET compliant language and can also inherit the classes written in these languages. This is not possible in Java.
  • The code written in C#, on compilation generates an ‘.exe' or ‘.dll' file which is also called Portable Executable file. These files contain MSIL (Microsoft Intermediate Language) code. As against this, the Java code on compilation generates a ‘.class' file, which contains bytecode. 
  • The portable executable file of C# can contain any number of classes, whereas, the ‘.class' file in Java contains only one class.
  • The methods in C# are not virtual by default. On the contrary, methods in Java are virtual by default, which degrades the performance.
  • The classes in C# are grouped in Namespaces, whereas, classes in Java are grouped in Packages.
  • The C# namespaces are not related to the directories. The packages in Java are directly related with the directory names.

  • The variables of primitive data types in C# are more powerful. This is because even though they are not objects functions can be called using them. The variables of primitive data types in Java cannot call functions.
  • C# has features like Properties and Indexers. These features are not available in the Java language.
  • C# supports Structures, Operator Overloading and Preprocessors directives, whereas, Java has none of them.
  • Through C# we can easily call Windows API function and access COM components which is quite difficult in Java.




Some more Advantages of ASP.net Over Other Languages are given Below

asp.net-vs.-php-round-1

1. The code-behind allows you easier to maintain the code when it comes to 

large websites.

2. You have the freedom of choosing from multiple

 languages (C#, VB.NET, C++, etc.)

3. SQL Server is also very fast, secure, and it can

 store extremely large amounts of data; actually, 

there’s no limit;

4. With ASP.NET you get the whole .NET Class Library and the thousands of

 third party components as well. There are definitely much more third party

 components out there for .NET than for PHP.

5. The Visual Studio .NET IDE. makes coding much, much easier. It can

 highlight syntax, let you know when the wrong stuff is commented, do

 command completion, and just plain help you organize better. Visual Studio 

has a really nice debugger.



6. The Compiled Code (vs. PHP

 Interpreted Code) – .NET compiles

 code, such as C#, into what its

 creators have termed MSIL

 (Microsoft Intermediate Language).


7. In ASP.NET it’s easy to use threads and build asynchronous handlers in

 your server-side web code.


8. ASP.NET developers are paid better because of Its better future &

 advantages over other Languages in terms of different issues.

Tuesday, 22 July 2014

ASP.NET different Versions And Their features...

.NET Framework version CLR version Features Included in Visual Studio version ✓ Included in
+ Can be installed on
Windows
✓ Included in
+ Can be installed on
Windows Server
To determine installed .NET version
4.5.2 4
  • New APIs for transactional systems and ASP.NET
  • System DPI resizing in Windows Forms controls
  • Profiling improvements
  • ETW and stress logging improvements
- + 8.1
+ 8
+ 7
+ Vista
+ 2012 R2
+ 2012
+ 2008 R2 SP1
+ 2008 SP2
Use Release DWORD: 379893

4.5.1 4
  • Support for Windows Phone Store apps
  • .NET Native
  • Automatic binding redirection
  • Performance and debugging improvement
2013 ✓ 8.1
+ 8
+ 7
+ Vista
✓ 2012 R2
+ 2012
+ 2008 R2 SP1
+ 2008 SP2
Use Release DWORD:
  • 378675 (Windows 8.1)
  • 378758 (all other)

4.5 4
  • Support for Windows Store apps
  • WPF, WCF, WF, ASP.NET updates
2012 ✓ 8
+ 7
+ Vista
✓ 2012
+ 2008 R2 SP1
+ 2008 SP2
Use Release DWORD: 378389

4 4
  • Expanded base class libraries
  • Cross-platform development with Portable Class Library
  • MEF, DLR, code contracts
2010 + 7
+ Vista
+ 2008 R2 SP1
+ 2008 SP2
+ 2003

3.5 2.0
  • AJAX-enabled websites
  • LINQ
  • Dynamic data
2008 ✓ 7
✓ 8.1*
✓ 8*
+ Vista
✓2008 R2 SP1*
+ 2012 R2
+ 2012
+ 2008 SP2
+ 2003

3.0 2.0
  • WPF, WCF, WF, CardSpace
- ✓ Vista ✓ 2008 R2 SP1*
✓ 2008 SP2*
+ 2003

2.0 2.0
  • Generics
  • ASP.NET additions
2005 - ✓ 2008 R2 SP1
✓ 2008 SP2
✓ 2003

1.1 1.1
  • ASP.NET and ADO.NET updates
  • Side-by-side execution
2003 - ✓ 2003
1.0 1.0 First version of the .NET Framework. Visual Studio .NET - -

Saturday, 12 July 2014

System requirements for Visual studio

Visual Studio 2010, 2012, 2013 System requirements and hardware requirements

There are multiple editions of Visual Studio available and the hardware and system requirements are slightly different for some editions even though most editions have pretty much same requirements.
The Ultimate, Premium, Professional and Test Professional editions of Visual Studio 2012 have the exact same hard requirements and system requirements. The system requirements for these editions are shown below:


System Requirements Visual Studio 2012 Ultimate, Premium, Professional and Test Professional editions


Supported operating systems:


  • Windows 7 SP1 (x86 and x64)

  • Windows 8 (x86 and x64)

  • Windows Server 2008 R2 SP1 (x64)

  • Windows Server 2012 (x64)
  • Supported architectures

  • 32-bit (x86)

  • 64-bit (x64)

  • Hardware requirements

  • 1.6 GHz or faster processor

  • 1 GB of RAM (1.5 GB if running on a virtual machine)

  • 10 GB of available hard disk space

  • 600 MB of available hard disk space (language pack)

  • 5400 RPM hard drive

  • DirectX 9-capable video card running at 1024 x 768 or higher display resolution


  • Here is the system requirements for Visual Studio 2012 Team Foundation Server edition:

    Supported operating systems

  • Windows 7 SP1 (x86 and x64)

  • Windows 8 (x86 and x64)

  • Windows Server 2008 SP2 (x64)

  • Windows Server 2008 R2 SP1 (x64)

  • Windows Server 2012 (x64)


  • Supported architectures

  • 32-bit (x86) (Windows 7 and Windows 8 clients)

  • 64-bit (x64)


  • Hardware requirements

  • 2.2 GHz or faster processor

  • 1 GB RAM – Basic installation

  • 2 GB RAM – Standard installation (no SharePoint)

  • 10 GB RAM – Full installations (includes SharePoint)

  • 8 GB of available hard disk space


  • Some of the optional components as prerequisites for TFS is Microsoft SQL Server 2008 R2 and Windows SharePoint Services 3.0 SP1 or SharePoint 2010 which may be required depending on your installation.

    System and Hardware requirements for Visual Studio 2012 Express Editions


    The hardware requirements for Visual Studio 2012 Express editions are slightly different. See the hardware requirements below:

    - 1.6 GHz or faster processor
    - 1 GB of RAM (1.5 GB if running on a virtual machine)
    - 4 GB of available hard disk space
    - 100 MB of available hard disk space (language pack)
    - 5400 RPM hard drive
    - Direct X 9-capable video card running at 1024 x 768 or higher display resolution

    Friday, 11 July 2014

    basics of ASP.NET .

    Hi, This is REMALA MANOJ, from Lakireddy Balireddy College Of engineering.This Article is give some basics ASP.NET .

    ASP.NET is an open source 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 sitesweb applications and web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language. The ASP.NET SOAP extension framework allows ASP.NET components to process SOAP messages.

             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).