SOLID Principles are coding standards that all developers should have a clear concept for developing software in a proper way to avoid a bad design. S - Single Responsibility Principle (SRP): A class should have one, and only one, a reason to change In Single Responsibility Principle Each class and module should focus on a single task at a time Everything in the class should be related to that single purpose There can be many members in the class as long as they related to the single responsibility With SRP, classes become smaller and cleaner Code is less fragile Here UserAccount class created which have below operations like, Login, Register, LogError and Send Mail. According to SRP, ideally, LogError and SendEmail are should not be part of UserAccount operations. public class UserAccount { public bool Login( string username, ...
Overview of the ASP.NET MVC - Introduction to ASP.NET MVC - ASP.NET MVC Version History - Life Cycle of MVC request - Role of Model, View, and Controller - Works Behaviour of ASP.NET MVC - Benefits MVC Architecture - Razor View Engine - Essential Language Features & Helpers - Basic Helpers - Strongly-Typed Helpers - Creating Custom Helpers - Declarative Helpers The MVC Pattern - The MVC Design Pattern - Working with Controllers - Model Templates - MVC State Management - Working with URLs and Routing (URL Routing) - Bundling and Minification Working with Controllers - Controller Actions - Controller and ActionResult Types - Passing Data from View to Controller - Action Filters & Custom Action Filter - Action Selectors HttpGet and HttpPost Razor Views - Razor View Engines and Syntax - Working with Layout Pages - Views & Partial Vi...
Method 1: Response.AddHeader To Refresh Web page After every 5 Seconds You can add following code, Response.AddHeader("Refresh", "5"); Cricket Sites, Stock Exchange sites use similar logic :) Method 2: In body Tag, window.setTimeout The 1000 = 1 Second... < body onload ="window.setTimeout('window.location.reload()',1000);" > Method 3: In Meta Tag Theres also a meta tag that you can define on the head, but not sure wheter it refreshes even if the content has not finished loading or if it starts counting when the head section loaded. Code would be something like that: < meta content ="600" http-equiv ="refresh" > Method 4: Timer Control : Microsoft ASP.NET 2.0 AJAX Extensions server control In following example, the timer interval is set to 10 seconds <%@ Page Language="C#" AutoEventWireup="true" %> <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN...
Polymorphism means having more than one form. Overloading and overriding are used to implement polymorphism. Polymorphism Examples Method Overloading Method Overriding There are two type of Polymorphism 1. Compile time polymorphism (Early binding or static binding) Examples: overloaded methods, overloaded operators and overridden methods that are called directly by using derived objects. 2. Run time polymorphism (Late binding or dynamic binding) Example: overridden methods that are called using base class object.
I face one problem in Mozilla but with other browser it works fine. The problem was like... the page get called twice!!! There is case when the server side code called twice, not lient side. After doing some good work found the solution, and was simpley good. The following line was causing the problem. <asp:image id="imgTest" runat="Server"/> In first look you can see there is no problem with it. But there is still problem; the missing ImageUrl. Mozilla send request to current page asking for an image, which we havent set yet; as the value get assign from server side, by this reason the only server side code is get executed twice!!!! Interesting, isn't it!! So here is the solution: <asp:image id="imgTest1" runat="Server" imageurl="abc.jpg"></asp:image>
1. Clas s is Reference types and Structure is Value type. 2. Clas s supports an Inheritance where as Structure not. 3. Classes are usually used for large amounts of data, whereas Structure are usually used for smaller amount of data. 4. When we instantiate a class, memory will be allocated on the heap and when Structure gets initiated it gets memory on the stack. 5. Classes can have explicit parameter less constructors. But Structure doesn't have this. 6. Classes can be garbage collector because garbage collector works on heap memory . structures can not be garbage collector so no memory management.
Back to Home Execution Stages: For web: HTTP request for Application Incoming request routed to Controller (Perform Routing) The controller processes request and create presentation Model The controller also selects appropriate result (view) Model is passed to View View transforms Model into an appropriate output format (HTML) The response is rendered (HTTP response) Image Courtesy: SlideShare.net Back to Home
i want create a Procedure that behave like this: declare @cnt int set @cnt =10 select top @cnt * from sw_user Where sw_user contains 20 records, and i want the variable to be the criteria of Top statement. so i can use this for a solution for this type of problem CREATE PROC Top10 @cnt int AS SET ROWCOUNT @cnt SELECT * FROM sw_user but some cases ROWCOUNT might not be work... so what, Note : This statement however is possible in SQL 2005, just add "()" in your variable like so: declare @cnt int set @cnt =10 select top (@cnt) * from sw_user
I was facing some issue to update excel cell which was depended on some formula, I need to change 'Comparison_Rate_Calculator' by Programming and need to read Calculated value by formula '=+HLOOKUP(C3,Workings!$D$1:$AJ$2,2,FALSE)' over 'Comparison_Rate_Calculator_Values' column. I didn't get calculated value even i was able to change 'Comparison_Rate_Calculator' column's value. So I got solutions by refreshing Excel WorkSheet and Here is the Solutions. File: Web.Config < connectionstrings > < add name = " xls " connectionstring = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\AshvinWorkspace\POCs\ReadExcelSheet\ReadExcelSheet\Files\HLComparisonRateCalculator.xls;Extended Properties=Excel 8.0 " > </ add > </ connectionstrings > File: Default.aspx.cs public partial class _Default : System.Web.UI. Page { protected void ...
Comments