Once I was looking for this for hours..
http://stackoverflow.com/questions/1710301/what-is-a-predicate-in-c
Aug 28, 2014
Aug 19, 2014
C# online compiler
When having free time on bus ride :)
http://csharppad.com/
http://www.compileonline.com/compile_csharp_online.php
http://csharppad.com/
http://www.compileonline.com/compile_csharp_online.php
Aug 13, 2014
ASP.NET why Page_PreRender ?
So what's the purpose of Page_PreRender in ASP.NET webforms?
Easiest answer for me is through simple example.
Run web and observe that in browser Tab Title is reflecting change from WebUserControl2.ascx Page_Load.
Now add Page_PreRender event in first one WebUserControl1.ascx:
protected void Page_Load(object sender, EventArgs e)
{
Page.Title = "WebUserControl1";
}
protected void Page_PreRender(object sender, EventArgs e)
{
Page.Title = "PreRender_WebUserControl1";
}
}
Run and observe that now text from WebUserControl1's Page_PreRender event is shown instead of previous from WebUserControl2 Page_Load.
Same idea if you have filled Page_PreRender of ASPX.
Bottom line is to use Page_PreRender on only one place in your page elements (ASPX,ASCX) when you need to make sure that code in PreRender is the last modification to common page elements that are shared among all controls.
Easiest answer for me is through simple example.
- Create classic ASP.NET webforms with single ASPX
- Create 2 ASCX web user controls
Place in each code in Page_Load:
WebUserControl1.ascx
public partial class WebUserControl1 : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
Page.Title = "WebUserControl1";
}
WebUserControl2.ascx
public partial class WebUserControl1 : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
Page.Title = "WebUserControl1";
}
Register both on ASPX like this:
<%@ Page Title="About" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="About.aspx.cs" Inherits="WebApplication6.About" %>
<%@ Register Src="~/WebUserControl2.ascx" TagPrefix="app" TagName="web2" %>
<%@ Register Src="~/WebUserControl1.ascx" TagPrefix="app" TagName="web1"%>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
<app:web1 id="ctrl1" runat="server" />
<app:web2 id="ctrl2" runat="server" />
</asp:Content>
Run web and observe that in browser Tab Title is reflecting change from WebUserControl2.ascx Page_Load.
Now add Page_PreRender event in first one WebUserControl1.ascx:
protected void Page_Load(object sender, EventArgs e)
{
Page.Title = "WebUserControl1";
}
protected void Page_PreRender(object sender, EventArgs e)
{
Page.Title = "PreRender_WebUserControl1";
}
}
Run and observe that now text from WebUserControl1's Page_PreRender event is shown instead of previous from WebUserControl2 Page_Load.
Same idea if you have filled Page_PreRender of ASPX.
Bottom line is to use Page_PreRender on only one place in your page elements (ASPX,ASCX) when you need to make sure that code in PreRender is the last modification to common page elements that are shared among all controls.
Jul 29, 2014
DotNetNuke - ver 6 for Developers - quick start
It's hard to google out consistent and encompassing info when learning DNN module development so here is one :
http://www.dnnsoftware.com/wiki/page/dotnetnuke-6-2-developer-quick-start
https://www.packtpub.com/article/understanding-dotnetnuke-core-architecture-1
http://www.dnnsoftware.com/community-blog/cid/134683/authorization-in-the-new-dnn-services-framework
http://www.dnnsoftware.com/wiki/page/dotnetnuke-6-2-developer-quick-start
https://www.packtpub.com/article/understanding-dotnetnuke-core-architecture-1
http://www.dnnsoftware.com/community-blog/cid/134683/authorization-in-the-new-dnn-services-framework
Jul 7, 2014
ASP.NET - Inside look - IIS Thread pool - Request per Thread - Static life cycle
How IIS handles incoming requests in low .NET application level?
Is each Request dedicated its own Thread?
What about static class and members? What's their life span and who can see and use them?
http://stackoverflow.com/questions/194999/are-static-class-instances-unique-to-a-request-or-a-server-in-asp-net
http://stackoverflow.com/questions/8084143/does-an-asp-net-http-request-translate-to-1-thread
What happens with static members if you create "Web garden" with more than one worker process?
http://stackoverflow.com/questions/5583470/does-a-webapplication-run-faster-when-maximum-worker-processes-is-more-than-one
Is each Request dedicated its own Thread?
What about static class and members? What's their life span and who can see and use them?
http://stackoverflow.com/questions/194999/are-static-class-instances-unique-to-a-request-or-a-server-in-asp-net
http://stackoverflow.com/questions/8084143/does-an-asp-net-http-request-translate-to-1-thread
What happens with static members if you create "Web garden" with more than one worker process?
http://stackoverflow.com/questions/5583470/does-a-webapplication-run-faster-when-maximum-worker-processes-is-more-than-one
Jul 4, 2014
DotNetNuke / module development / manifest
When developing DNN module extensions in your Visual Studio DNN Module project template there is manifest of your module with extension DNN.
Here is more:
http://www.dnnsoftware.com/wiki/page/manifests
Excerpts:
It should also be made known that each package equals one extension that can be managed in the DotNetNuke Extensions module, where they are grouped by extension type.
Although DNN does not expose a way to take a dependency on a particular .NET framework version, this can easily be emulated by taking a type dependency on a class that does not exist in prior framework versions. For example, to require .NET 4 as a precondition to installation, one may depend instead on the System.Tuple class (which was introduced with .NET 4.0):
There are a few things to be aware of when installing multiple packages within a single install (and thus, using a single manifest). First, packages are installed in the order they are declared in the manifest file (top to bottom). . This means, if you are installing a skin extension that also contains a skin object, you need the skin object to be installed prior to the skin being installed (thus, placing the skin object package towards the top, above the skin package). In this example, the skin object was used by the skin being installed and therefore it needed to be available prior to the skin being installed (otherwise, the skin object would not be rendered properly).
Here is more:
http://www.dnnsoftware.com/wiki/page/manifests
Excerpts:
It should also be made known that each package equals one extension that can be managed in the DotNetNuke Extensions module, where they are grouped by extension type.
Although DNN does not expose a way to take a dependency on a particular .NET framework version, this can easily be emulated by taking a type dependency on a class that does not exist in prior framework versions. For example, to require .NET 4 as a precondition to installation, one may depend instead on the System.Tuple class (which was introduced with .NET 4.0):
<dependency type="type">System.Tuple</dependency>
There are a few things to be aware of when installing multiple packages within a single install (and thus, using a single manifest). First, packages are installed in the order they are declared in the manifest file (top to bottom). . This means, if you are installing a skin extension that also contains a skin object, you need the skin object to be installed prior to the skin being installed (thus, placing the skin object package towards the top, above the skin package). In this example, the skin object was used by the skin being installed and therefore it needed to be available prior to the skin being installed (otherwise, the skin object would not be rendered properly).
Subscribe to:
Posts (Atom)