The requested page cannot be accessed because the related configuration data for the page is invalid.

1. Hôm nay cài IIS 7.5 trên Windows 7 để chạy Website (trước đây toàn dùng II6 trên Windows server 2003) nên gặp lỗi này

Error Summary
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.

Detailed Error Information
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x80070021
Config Error This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".
Config File \\?\C:\inetpub\Web\HaNoiBus\web.config

2. Tìm một hồi trên mạng thì có nhiều ý kiến khác nhau nhưng vẫn chưa giải quyết được vấn đề.
Ví dụ:
http://www.themidnightcoders.com/forum/Default.aspx?g=posts&t=3635
http://support.microsoft.com/kb/942055
3. Cuối cùng mới nhớ ra là mình cài IIS sau khi cài .NET Framework nên phải register nó với .NET
– Mình dùng lệnh này:

C:\Windows\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis.exe -i

– Sau khi register xong thì dùng

C:\Windows\Microsoft.NET\Framework\v2.0.50727>iisreset
4. Chạy ngon luôn, lần sau gặp phải lỗi này sẽ không bị bỡ ngỡ nữa :)

WCF Certificates

1. 9 simple steps to enable X.509 certificates on WCF

http://www.codeproject.com/KB/WCF/9StepsWCF.aspx

2. Securing WCF Services with Certificates

http://www.codeproject.com/KB/WCF/wcf_certificates.aspx

3. Simple WCF – X509 Certificate

http://www.codeproject.com/KB/WCF/Senthil.aspx

4. An easy way to use certificates for WCF security

http://www.codeproject.com/KB/WCF/wcfcertificates.aspx

WCF in CodeProject

1.  Windows Communication Foundation (Trang chủ tìm kiếm)

http://www.codeproject.com/KB/WCF/

2. Using WCF with Automatic Client Proxies

http://www.codeproject.com/KB/WCF/WCF_auto_client_proxies.aspx

3. Asynchronous Communication in a WCF Service

http://www.codeproject.com/KB/WCF/WCFAsynchronous.aspx

4. WCF Cache

http://www.codeproject.com/KB/WCF/WCFCache.aspx

5. Setting up a Project-framework for a WCF Solution

http://www.codeproject.com/KB/WCF/WCFProjectStructure.aspx

6. Pattern for Creating Generic WCF Services

http://www.codeproject.com/KB/WCF/Generic_WCF_Services.aspx

7. Demo WCF thực tế
http://210.245.87.182:9000/News.svc

WCF (Windows Communication Foundation) – WCF Test Client

1. WCF Test Client
http://msdn.microsoft.com/en-us/library/bb552364.aspx

2. WCF Load Test
http://wcfloadtest.codeplex.com/

3. Using the WCFTestClient Tool to Test Service Operations

http://community.microsoftadvertising.com/blogs/api/archive/2010/02/01/using-the-wcftestclient-tool-to-test-service-operations.aspx

4. Using the WCF Test Client to Test Your Workflow Service

http://blogs.msdn.com/b/rjacobs/archive/2011/09/23/using-the-wcf-test-client-to-test-your-workflow-service.aspx

5. WCF Test Client in VS 2010
http://christopherdeweese.com/blog2/post/wcf-test-client-in-vs-2010

ASPxGridView – header rowspan and colspan

1. Để nhóm các column vào một nhóm trên Header ta dùng GridViewBandColumn

<dxwgv:GridViewBandColumn Caption="Lượt thực hiện" VisibleIndex="4">
<HeaderStyle HorizontalAlign="Center" />
<Columns>
<dxwgv:GridViewDataTextColumn Caption="hoàn chỉnh <br /> (A-B)" FieldName="VPXB"
Name="VPXB" VisibleIndex="5" Width="60">
<HeaderStyle HorizontalAlign="Center" />
<CellStyle HorizontalAlign="Center">
</CellStyle>
</dxwgv:GridViewDataTextColumn>
<dxwgv:GridViewDataTextColumn Caption="quay đầu" FieldName="VPGiamTocDotNgot" Width="60"
Name="VPGiamTocDotNgot" VisibleIndex="6">
<HeaderStyle HorizontalAlign="Center" />
<CellStyle HorizontalAlign="Center">
</CellStyle>
</dxwgv:GridViewDataTextColumn>
</Columns>
</dxwgv:GridViewBandColumn>

2. Chi tiết tại đây

http://demos.devexpress.com/ASPxGridViewDemos/Columns/Bands.aspx

linked servers trong SQL Server

1. Sử dụng Linked Server để trao đổi dữ liệu

--Link toi con 179
EXEC sp_addlinkedserver @server = N'DataCenter179',
@srvproduct = N' ',
@provider = N'SQLNCLI',
@datasrc = N'192.168.1.2\datacenter_v2',
@catalog = N'DatabaseName'
GO
--Dang nhap voi cac thong tin sau.
EXEC sp_addlinkedsrvlogin @rmtsrvname = 'DataCenter179', @useself=N'False', @locallogin = NULL, @rmtuser = 'userName',@rmtpassword = 'password'

--Thu test du lieu xem co ok ko?
SELECT TOP 100 * FROM DataCenter179.DatabaseName.dbo.users
SELECT COUNT(*) FROM DatabaseName.dbo.users
SELECT COUNT(*) FROM DataCenter179.DatabaseName.dbo.users

--Link toi con 179
EXEC sp_addlinkedserver @server = N'DataCenter231',
@srvproduct = N' ',
@provider = N'SQLNCLI',
@datasrc = N'192.168.1.2',
@catalog = N'DatabaseName'
GO
--Dang nhap voi cac thong tin sau.
EXEC sp_addlinkedsrvlogin @rmtsrvname = 'DataCenter231', @useself=N'False', @locallogin = NULL, @rmtuser = 'userName',@rmtpassword = password'

--Thu test du lieu xem co ok ko?
SELECT TOP 100 * FROM 'DatabaseName.dbo.users
SELECT COUNT(*) FROM DatabaseName.dbo.users
SELECT COUNT(*) FROM DatabaseName.dbo.users

2. Chi tiết tại đây

http://www.techrepublic.com/blog/datacenter/how-do-i-query-foreign-data-using-sql-servers-linked-servers/133

PopupControl trong devexpress và UpdateProgress

<asp:UpdateProgress runat=”server” ID=”UpdateProgress” AssociatedUpdatePanelID=”PanelSearch” DisplayAfter=”0″ DynamicLayout=”false”>
<ProgressTemplate>
<div id=”progressBackgroundFilter”></div>
<div id=”processMessage”>Loading…<br /><img alt=”Loading” src=”Images/progress.gif” /></div>
</ProgressTemplate>
</asp:UpdateProgress>

<dxpc:ASPxPopupControl ID=”ASPxPopupReport” runat=”server” HeaderText=”Báo cáo”

Modal=”True” PopupHorizontalAlign=”WindowCenter” PopupVerticalAlign=”WindowCenter”
ContentUrl=”~/WebUI/Bus/reportMergeColumn.aspx” CloseAction=”CloseButton”
Width =”900px” Height =”570px” AllowDragging=”True” >
</dxpc:ASPxPopupControl>

<asp:UpdatePanel ID=”UpdatePanel_FilerReport” runat=”server”>
<ContentTemplate>
<div style=”text-align: center;”>
<dxpc:ASPxPopupControl ID=”ASPxPopupReport” runat=”server” HeaderText=”Report” Modal=”True”
AllowDragging=”true” PopupHorizontalAlign=”WindowCenter” PopupVerticalAlign=”WindowCenter”
ContentUrl=”~/WebUI/BaoCao/rptReportViewBasicLandscape.aspx” Height=”600px” Width=”1200px” CloseAction=”CloseButton”>
</dxpc:ASPxPopupControl>
</div>
</ContentTemplate>
</asp:UpdatePanel>

<TotalSummary>
<dx:ASPxSummaryItem FieldName = “STT” ShowInColumn= “STT” SummaryType =”Sum” DisplayFormat= “Tổng” />
<dx:ASPxSummaryItem FieldName = “NoOfFlights” ShowInColumn= “NoOfFlights” SummaryType =”Sum” DisplayFormat=”{0:0.##}”/>
<dx:ASPxSummaryItem FieldName = “AirConditionerOff” ShowInColumn= “AirConditionerOff” SummaryType =”Sum” DisplayFormat=”{0:0.##}” />
<dx:ASPxSummaryItem FieldName = “NoOfSpeedOver” ShowInColumn= “NoOfSpeedOver” SummaryType =”Sum” DisplayFormat=” {0:0.##}”/>
<dx:ASPxSummaryItem FieldName = “NoVisitStation” ShowInColumn= “NoVisitStation” SummaryType =”Sum” DisplayFormat=”{0:0.##}”/>
<dx:ASPxSummaryItem FieldName = “XBSom” ShowInColumn= “XBSom” SummaryType =”Sum” DisplayFormat=”{0:0.##}”/>
<dx:ASPxSummaryItem FieldName = “XBMuon” ShowInColumn= “XBMuon” SummaryType =”Sum” DisplayFormat=”{0:0.##}”/>
<dx:ASPxSummaryItem FieldName = “VBSom” ShowInColumn= “VBSom” SummaryType =”Sum” DisplayFormat=”{0:0.##}”/>
<dx:ASPxSummaryItem FieldName = “VBMuon” ShowInColumn= “VBMuon” SummaryType =”Sum” DisplayFormat=”{0:0.##}”/>
<dx:ASPxSummaryItem FieldName = “NoOfWrongRoute” ShowInColumn= “NoOfWrongRoute” SummaryType =”Sum” DisplayFormat=”{0:0.##}”/>
</TotalSummary>

protected void ResetControl()
{
btnTimKiem.Enabled = true;
btnBaoCao.Enabled = false;
GridViewAL.DataSource = null;
GridViewAL.DataBind();

}