1.Difference
between Invoke() and BeginInvoke()
Sample Code For Master Page
Sample Code For Content Page
-
S.No Invoke()BeginInvoke()1Delegate.Invoke:Executes synchronously, on the same thread.Delegate.BeginInvoke:Executes asynchronously, on a threadpool thread.2 Control.Invoke:Executes on the UI thread, but calling thread waits for completion before continuing.Control.BeginInvoke:Executes on the UI thread, and calling thread doesn’t wait for completion.
-
S.No BuildRelease1BUILD is still running in testing that is released to testers for testingRELEASE is no longer with testing and release to Customers/Clients.2 BUILD occur more frequentlyRELEASE occur less frequently.3 BUILD is process of converting source code in to executablecode (.exe)RELEASE is a process of delivering the project to client
-
S.No Windows formsWeb forms1They do not need a web browser or web server to execute.They need a web browser as well as a web server(on the server machine only).2 They execute through their respective exe filesThey execute through the dll of the web application which is then processed by IIS and the .net framework.3 They run on the same machine they are displayed on.They run on a remote server and are displayed remotely on the clients4 Their single instance exists until we close them or dispose them through codingEvery time they are submitted, their new instance is created.5 Used for developing games, inventory management, system utiltites etc.Used in web site development.6 They run under Code Access Security.They use role based security
-
S.No Master PageContent Page1Files with .Master extension. Introduced in ASP.NET 2.0.Example:Files with .aspx extension.Example:2 These have a control known as the Content Placeholder which reserves a storage location in which we can place the contents of a .aspx page.These do not have any Content Placeholder control which makes it somewhat difficult in providing proper layout and alignment for large designs.3 MasterPageFile attribute is added in the Page directive of the .aspx page when a Master Page is referenced in .aspx page. The .aspx page that uses the Master page i known as Content Page.Register Tag is added when we drag and drop a user control onto the .aspx page.4 Can be referenced using Web.Config file also or dynamically by writing code in PreInit event.Can be attached dynamically using Load Control method. PreInit event is not mandatory in their case for dynamic attachment.5 More suitable for large designs(ex: defining the complete layout of .aspx page)Suitable for small designs(Ex:1) logout button on every .aspx page.
Sample Code For Master Page
<%@
Master Language="C#"
AutoEventWireup="true"
CodeFile="MasterPage.master.cs"
Inherits="MasterPage"
%>
<!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>Untitled
Page</title>
<asp:ContentPlaceHolder
id="head"
runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form
id="form1"
runat="server">
<div>
<asp:ContentPlaceHolder
id="ContentPlaceHolder1"
runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
Sample Code For Content Page
<%@
Page Language="C#"
MasterPageFile="~/MasterPage.master"
AutoEventWireup="true"
CodeFile="Default2.aspx.cs"
Inherits="Default2"
Title="Untitled
Page" %>
<asp:Content
ID="Content1"
ContentPlaceHolderID="head"
Runat="Server">
</asp:Content>
<asp:Content
ID="Content2"
ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
</asp:Content>
No comments:
Post a Comment