Mar 24, 2014

Overview of ASP.NET configuration, security etc on Microsoft support

http://support.microsoft.com/kb/307626

Unauthorized access - Can't browse ASP.NET application with IIS 8.5 on Windows 8.1

I've setup security for ASP.NET site as usual - IIS_IUSRS on folder etc.
I could get ASPX but CSS and images no - unathorized.

Make sure to give your  "Users (MACHINE\Users)" group rights on web application folder.

Mar 17, 2014

ASP.NET WebForms - Client Report Definition - dynamically generate PDF presentation of RDLC from code

using Microsoft.Reporting.WebForms;

....


LocalReport localReport = new LocalReport();

            localReport.ReportPath = @"c:\Users\sbencetic\Documents\Visual Studio 2012\Projects\WebApplication2\Report1.rdlc";
            //ReportDataSource reportDataSource = new ReportDataSource("Customers", Customers.GetAllCustomers());

            //localReport.DataSources.Add(reportDataSource);
            string reportType = "Excel";
            string mimeType;
            string encoding;
            string fileNameExtension;

            //The DeviceInfo settings should be changed based on the reportType
            //http://msdn2.microsoft.com/en-us/library/ms155397.aspx
            string deviceInfo =
            "<DeviceInfo>" +
            "  <OutputFormat>PDF</OutputFormat>" +
            "  <PageWidth>8.5in</PageWidth>" +
            "  <PageHeight>11in</PageHeight>" +
            "  <MarginTop>0.5in</MarginTop>" +
            "  <MarginLeft>1in</MarginLeft>" +
            "  <MarginRight>1in</MarginRight>" +
            "  <MarginBottom>0.5in</MarginBottom>" +
            "</DeviceInfo>";

           
            Warning[] warnings;
            string[] streams;
            byte[] renderedBytes;

            //Render the report
           
            renderedBytes = localReport.Render(
                reportType,
                deviceInfo,
                out mimeType,
                out encoding,
                out fileNameExtension,
                out streams,
                out warnings);
            Response.AddHeader("content-disposition", "attachment; filename=NorthWindCustomers." + fileNameExtension);
           
            Page.Response.BinaryWrite(renderedBytes);                      


JQuery training

http://try.jquery.com/

Windows desktop - where is my appsettings in app.config ?

After long time working with web I got frustrated with trivial thing.
You can not open App.Config and simply write down your appsettings.
In windows desktop trick is to go through project properties then select Setting and use VS editor.

Mar 6, 2014

Windows 8.1 - can't save file to c:\Windows

Microsoft has increased out of the box security of Windows 8.1

By default user even as local admin does not have Full Control on some system folders like c:\Windows.

You can google solution like this:

http://www.thewindowsclub.com/take-ownership-windows-8

Yet this didn't gave me all answers.

Follow these steps:

1. On folder you wish right click
2. Select Security
3. Select Advanced
4. On the top change owner to yourself:     domain\username
5. Apply
6. Repeat step 1.
7. Edit
8. Locate yourself in user list and give Full control