Friday 2 November 2012

File Upload Max Lenght exeeded Error


The default setting for thr file upload control is 4MB we can overwrite in web.config.
If you are using IIS7 use both else  maxRequestLength is enough.

In system.web
<httpRuntime maxRequestLength="1048576" executionTimeout="3600" />

And in system.webServer
<security>
    <requestFiltering>
        <requestLimits maxAllowedContentLength="1073741824" />
    </requestFiltering>
</security>
IMPORTANT: Both of these values must match. In this case, my max upload is 1024 megabytes.
maxRequestLength has 1048576 KILOBYTES, and maxAllowedContentLength has 1073741824 BYTES.
I know it's obvious, but it's easy to overlook.

Wednesday 3 October 2012

Create fake certificate in IIS 6

Every time I need to enable https / ssl for a development or staging server I spend 30 minutes googling for instructions. Now I'm blogging just to remind myself how it's done:

Install the IIS 6 Resource Kit referenced at:
http://support.microsoft.com/kb/840671 from:
http://www.microsoft.com/downloads/details.aspx?FamilyID=56fc92ee-a71a-4c73-b628-ade629c89499

Obtain the site Id of the website you want to install the certificate for by clicking on the Web Sites major heading in the left hand side of the IIS admin tool and view the "Identifier" on the right hand side for whichever site you need. This is the site ID. further instructions at: http://weblogs.asp.net/owscott/archive/2005/07/29/421058.aspx

Run the following command replacing www.example.com with the host header of your site and 123456 with the site id obtained in the previous step (the /V:365 indicates that the certificate should be valid for 365 days, adjust accordingly):
"C:\Program Files\IIS Resources\SelfSSL\selfssl.exe" /T
/N:CN=www.example.com /V:365 /S:123456

Wednesday 19 September 2012

SOAP Background

 
Such a nice article on Soap have a try very interesting......
 
 

Monday 17 September 2012

Tuesday 4 September 2012

IIS's Overlapping App Pools





Good one.........



Category does not exist' error when viewing IIS Worker Processes in IIS Manager


I ran into an interesting problem recently when using the new Worker Processes feature in the Internet Information Services (IIS) Manager for IIS 7.0. The Worker Processes feature is a great addition to IIS, and it's used to view practical information about the worker processes that are currently in use on your system; for example: the names of application pools that are associated with worker processes, worker process PIDs, CPU and byte usage statistics, etc.
So it's understandable that I was a little taken aback when I double-clicked the feature recently and I was greeted with an error dialog that stated "There was an error while performing this operation. Details: Category does not exist."
The last time that I saw that error dialog was a couple of years ago during the early days of the Windows Server 2008 beta when some of the IIS features had not been fully-written, so I emailed Carlos Aguilar Mares like I always do when I have a question about why I think something in the UI isn't behaving as expected. Carlos asked me to take a look at the performance counters on my server, and it was missing the "Process" counters. Armed with this knowledge, Carlos put me in touch with Matt E. and Wedson F. here at Microsoft, and the two of them worked with me to troubleshoot what was going on.
First of all, Matt had me take a look in the Windows Application log for any events with "Perflib" as the source, and I found the following two events:

Event #1

Log Name:
Application
Source:
Microsoft-Windows-Perflib
Date:
9/28/2008 5:19:26 PM
Event ID:
1010
Task Category:
None
Level:
Error
Keywords:
Classic
User:
N/A
Computer:
webserver.domain.local
Description:
The Collect Procedure for the "PerfProc" service in DLL "C:\Windows\system32\perfproc.dll" generated an exception or returned an invalid status. The performance data returned by the counter DLL will not be returned in the Perf Data Block. The first four bytes (DWORD) of the Data section contains the exception code or status code.
Binary Data:
050000C0

Event #2

Log Name:
Application
Source:
Microsoft-Windows-Perflib
Date:
9/28/2008 5:19:27 PM
Event ID:
1017
Task Category:
None
Level:
Error
Keywords:
Classic
User:
N/A
Computer:
webserver.domain.local
Description:
Disabled performance counter data collection from the "PerfProc" service because the performance counter library for that service has generated one or more errors. The errors that forced this action have been written to the application event log. Correct the errors before enabling the performance counters for this service.
The binary data ("050000C0") for the first error was obviously the HRESULT for an access violation in little-endian format (e.g. "0xC0000005"), and the second error explained why my counters were missing - something went wrong at some point and Windows disabled the process performance counters. Wedson had me run the following command:
lodctr /q:PerfProc
Which returned the following output:
Performance Counter ID Queries [PERFLIB]:
    Base Index: 0x00000737 (1847)
    Last Counter Text ID: 0x00001E86 (7814)
    Last Help Text ID: 0x00001E87 (7815)

[PerfProc] Performance Counters (Disabled)
    DLL Name: perfproc.dll
    Open Procedure: OpenSysProcessObject
    Collect Procedure: CollectSysProcessObjectData
    Close Procedure: CloseSysProcessObject
This showed that the PerfProc performance counters were disabled, and to remedy the problem I just needed to run the following command:
lodctr /e:PerfProc
After running this command, my process performance counters showed up in the Windows Performance Monitor and the IIS Worker Processes feature started working again.

Parting Thoughts and Such

Matt sent me a recap email later explaining that the crux of the problem was that the provider for the "Process" performance counter had been disabled on my server because that performance counter's collect procedure had caused an access violation ("0xC0000005") at some point in the past; this is usually due to some other performance counter misbehaving and corrupting the memory heap. In a general situation, checking the event viewer for errors with "Perflib" as the source will let you know if something has caused an error, and you can use "lodctr /q:<provider name>" to query the status of a provider or "lodctr /e:<provider name>" to enable a provider. In this particular situation, after the "PerfProc" provider was re-enabled the Worker Processes feature in IIS Manager resumed working.

Saturday 1 September 2012

JavaScript for post backs

I really don't know why people still use JavaScript in the websites. As browsers are updated day by day they are not compatible with all the browsers.

I found a serious problem in one of our websites yesterday, because of the Mozilla Firefox updated their browser.

Need to figure this out.


ASP.NET 4.5

Check this link for the new asp.net 4.5 features and visual studio 2012.

http://www.asp.net/web-forms/tutorials/aspnet-45/getting-started-with-aspnet-45-web-forms/introduction-and-overview

Hope you guys like it.