Change Global DateTime Format of asp.net web application using webconfig

24. March 2020

In order to change the global setting of Date Time Format from webconfig, you will have to include the globalization tag with culture being the country and language you want to set . For complete list of culture values please follow this link
https://www.basicdatepicker.com/samples/cultureinfo.aspx

<system.web>

  <globalization culture="en-GB"/>

ASP.NET, ASP.NET MVC, webconfig

HTTP Error 500.19 - Internal Server Error. Error Code 0x8007000d . When Creating a new website or converting a virtual directory to application.

27. June 2015

HTTP Error 500.19 - Internal Server Error. Error Code    0x8007000d . When Creating a new website or converting a virtual directory to application.

Module    CustomErrorModule
Notification    SendResponse
Handler    Not yet determined
Error Code    0x8007000d
Config Error    Configuration file is not well-formed XML
Config File    \\?\C:\inetpub\temp\apppools\DefaultAppPool\DefaultAppPool.config
Requested URL    http://localhost:80/umbracotest
Physical Path   
Logon Method    Not yet determined
Logon User    Not yet determined

 

 

 

 

Solution which worked for me :

1. Goto C:\inetpub\temp\appPools\DefaultAppPool and find DefaultAppPool.config file , you will see 

<!-- ERROR: There's been an error reading or processing the applicationhost.config file.  -->

in it .

2. Delete this file .

3. Restart Your website from IIS Manager and check

4. Your website will start working now . If it doesnot and IIS gives again the error but a different one like httperror tag is not configured then you just have to enter a line in your website web.config file

<httpErrors errorMode="DetailedLocalOnly"></httpErrors>

5. Now restart your website from IIS manager and it will work .

 

IIS ,

Unknown: The object identifier does not represent a valid object. (Exception from HRESULT: 0x800710D8) When creating a new website and using umbraco

25. June 2015

Unknown: The object identifier does not represent a valid object. (Exception from HRESULT: 0x800710D8) When creating a new website and using umbraco

Solution which worked for me was

1. Remove the website which shows this error .

2. Now open command prompt

3. Goto C:\Windows\Microsoft.NET\Framework64\v4.0.30319> and run this command aspnet_regiis.exe -i  ( If it gives some administrator rights error then you will have restart command prompt with run as administrator option.)

4. After installation is finished , try again adding a new website and run the umbraco after copying the code in that website .

 

umbraco , ,

Virtual Directory looking at parent web.config

11. October 2014

Virtual Directory looking at parent web.config

Web Application inside a virtual directory refers web.Config of parent directory and error related to that configuration file encountered .

Solution for this is to include a statement : 

<location path="." inheritInChildApplications="false"> 
<system.web>
 ...
</system.web>
</location>

You have to insert the <location> tag as mentioned above in the parent web.Config .

For Reference : http://forums.asp.net/t/1164283.aspx?Virtual+Directory+looking+at+parent+web+config

 

IIS , ,

How to read raw http request in ASP.NET MVC ?

19. August 2014

How to read raw http request in ASP.NET MVC ?

Below are the codes you can use to read the raw request in parts .

Read the Request Headers :

string originalHeader = HttpHandler.Request.ServerVariables["ALL_RAW"];

For reference http://stackoverflow.com/questions/1038466/logging-raw-http-request-response-in-asp-net-mvc-iis7

Read the Request body :

Request.InputStream.Position = 0;
var input = new StreamReader(Request.InputStream).ReadToEnd();

For reference http://stackoverflow.com/questions/12696506/getting-the-raw-request-in-mvc3

ASP.NET MVC , , , ,

Code for resizing your images before saving them in C#

19. August 2014

Code for resizing your images before saving them in C#

Here is the link to that page http://www.codeproject.com/Tips/552141/Csharp-Image-resize-convert-and-save

C# , ,

ASP Page not reading Form POST information PLESK PANEL Godaddy

17. June 2014

I am a GoDaddy customer and I'm incredibly frustrated with the Plesk platform. GoDaddy no longer offers its former Windows hosting platform, which I had finally learned to use. With Plesk I am very much lost again.

My current problem has to do with an incredibly simple ASP page that simply writes out the values it receives from another HTML file with a form on it. The form posts 3 values and the ASP page is supposed to write them out. This file WORKS on my old Godaddy Windows accounts that do not use Plesk. It works on 3 non-plesk sites. It does not work on 3 plesk sites. so the thing in common here is clearly Plesk. It seems somehow that something is stripping off POSTED header information. The ASP runs - there are no errors. It simply doesn't retrieve any values and if I ask it to write the number of Request.Form.Count items, it spits out zero. 



What setting do I need to change? Or did I need to leave GoDaddy and find a host that doesn't use Plesk?

By the way, Godaddy support won't help me.

Also by the way, I'm not sure which version of Plesk Godaddy is using

Tim

I purchased this ultimate windows hosting from godaddy which comes with plesk panel and i am trying to run an MVC 4 application in which a simple post to a page with form values is not working . On the destination page Request.Form["values"] doesnot work it is empty and doesnot read any form values . 

Apart this frustrating problem to top it all godaddy has removed email ticketing system for support and there is hell lot of waiting time on phone support , i couldn't get through there waiting time till now . I guess i made a mistake by investing my money in it . Shame on it .

Anuj Chauhan

After nine hours of banging my head against a wall trying to figure this out and soliciting the paid help of another .NET developer, I finally did figure this out. It may not be your issue, but it fixed mine.

Go to your Godaddy administration.
go to WEb Hosting
Launch your particular site.
Go to Hosting Settings
Near the top of the page there's a dropdown for Preferred Domain. the default choice, "domain.tld", redirects incoming www urls to this url and the redirect strips off header information. Change the setting in the dropdown to either www.domain.tld or "none".

This solved it for me. I hope it works for you as well.

Plesk sucks. Why would anyone choose something by default that strips off POST information?

Tim

Thanks a lot Tim i really appreciate your help , i also wasted my whole day searching on internet and 1 hour call to godaddy support who were clueless about what i was talking about exactly . These plesk guys should see this post and do the needful . 
Once again Thanks a lot , your solution worked like a charm .

 

OMG!!!! I actually wasn't sure if I would be able to help you. I'm so glad I did.

Yes, it would be nice if Plesk understood how AWFUL this stripping of POST information is. Non one seems to get it.

And believe me, I wrote six times to Godaddy support telling them that they should put this in their knowledge base and they kept replying that I should learn how to program or hire someone who knows what they were doing. Like it's all my fault. Unbelievable. What happened to "the customer is always right" or at least might have a valid point?

BTW, Godaddy still seems to have email support, but it's not available on their site. Somehow they contacted me!!!! It was shortly after I wrote this post, so maybe Godaddy was actually responding to my post or Plesk told them. Dunno. But in the end they acted like I was a bad programmer. 

Glad to help.

Tim

 

For Reference : http://forum.sp.parallels.com/threads/asp-page-not-reading-form-post-information.304235/

Windows Hosting , , , ,

Enabling Server Side Includes (SSI) in IIS Web Server

22. July 2013

Enabling Server Side Includes (SSI) in IIS Web Server is a very simple to follow procedure

Step 1 : Goto Start->Control Panel 

Step 2 : Click on Programs and Features

Step 3 : Click on Turn Windows features on or off

Step 4 : Check the option Server-Side Includes under the Internet Information Services , please check the image for reference .

 

Step 5 : You are good to go , click ok and use your Server Side Includes ( SSI ) codes in html files and host under IIS Web Server . Thanks !

 

IIS ,

Enabling Server Side Includes (SSI) in Apache Web Server

22. July 2013

Enabling Server Side Includes (SSI) in Apache Web Server

You can go on this link to find the apache documentation for the same .

If you have any confusion in the apache documentation then you can follow the below steps with which i was able to enable SSI in Windows environment using WAMP 

1. First open the httpd.conf file of apache

2. Find the directory you want to enable SSI for

3. Include statement "Includes" in "Options" Directive of the directory you want SSI in, check below image for reference.

 

4. Not just any file is parsed for SSI directives. You have to tell Apache which files should be parsed. You can tell Apache to parse any file with a particular file extension, such as .shtml, with the following directives:

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

Check the below image where you have to add above code :

5. We are done with configuration , now restart the apache web server and from now onwards use extension .shtml to all the files you want to have SSI code .

6 Now you can try accessing your index.shtml in web browser and it will run all the SSI codes . Thanks !

Apache ,

How to keep header,footer and other common content in separate files while using HTML

22. July 2013

How to keep header,footer and other common content in separate files while using HTML

Consider this example - you have 20 pages in your website and you have same header and footer in all of them , then what will you do ? Instead of copying and pasting the same code in all the pages , i suggest we should keep the common content in separate file and include these files to all the pages , by doing this we can modify the common content at on place and result will updated to all the pages automatically . To do this we will have to enable Server Side Includes ( SSI ) in web server .

You can check my posts to do so in Apache and IIS .

Now i presume that you have enabled the SSI in your web server . Let us code . We will keep all the content of common code in one file named header.shtml ( you must thing why shtml , shtml is to declare that this file may contain server side includes , i m declaring this so that if in future you want to add some SSI in header file also ) and will include this file in index.shtml , *.shtml so on to all the files where you want this code . 

Now we will add the following code to index.shtml ( .shtml extension is here to tell web server that it contains SSI ) where you want the header code to be included .

<!--#include virtual="header.shtml" -->

Remember 

1. <!-- #include virtual="header.shtml" --> is wrong because you gave a space in between <!-- & #include 

2. <!--#include virtual ="header.shtml" --> is wrong because you gave a space in between virtual & = 

3. <!--#include virtual="header.shtml"--> is wrong because you dint gave space in between .shtml" & -->

4. Keep in mind all the spaces as specified above before the remember heading .

 

Now as you will open the index.shtml all the content of header.shtml will be there in your file automatically.

HTML5 , , , ,