Have you experienced coding and all of a sudden when on windows 10 you experienced that MM/dd/yyyy is not a valid date? This is because of the culture that is default implemented on your device, in this case on my device with Windows 10 Pro. To cause of this is the machine is by default is using dd/MM/yyyy and in this case apps that we are developing is having this kind of issue.
Thank fully the fastest way to fix is via the web.config with the following code:
Recently I was instructed to create an application that will be able to replace an array of words and replace them with an array of corresponding words on an MS Word document. With this I’ve searched the following:
ELMAH (Error Logging Modules and Handlers) is an application-wide error logging facility that is completely pluggable. It can be dynamically added to a running ASP.NET web application, or even all ASP.NET web applications on a machine, without any need for re-compilation or re-deployment.
Once ELMAH has been dropped into a running web application and configured appropriately, you get the following facilities without changing a single line of your code:
Logging of nearly all unhandled exceptions.
A web page to remotely view the entire log of recoded exceptions.
A web page to remotely view the full details of any one logged exception, including colored stack traces.
In many cases, you can review the original yellow screen of death that ASP.NET generated for a given exception, even with customErrors mode turned off.
An e-mail notification of each error at the time it occurs.
An RSS feed of the last 15 errors from the log.
How to Install ELMAH on your MVC Project?
Open Nuget Package Manager on the MVC Project
Search for ELMAH and Install it.
Then configure it.
It will already add some configuration under your web.config but we need to include some configuration so that it will point to a database.
<add name=”elmahConnectionString” connectionString=”Data Source=Server;Initial Catalog=ELMAH_DEV;uid=user;pwd=user;Pooling=true;Min Pool Size=0;Max Pool Size=999;” providerName=”System.Data.SqlClient” />
See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for
more information on remote access and securing ELMAH.
We are glad to invite you to our first Free service product, OpenCast. OpenCast is an online broadcasting websites that aim to help people broadcast freely and openly. The website is created using ASP.Net MVC, Entity Framework, SignalR, & OpenTok.
Then you should also know that this error is persisting because the values given above might be an XSS attack. If you are sure that you want to accept this type of values on your dabatase you may explicitly remove this validation by adding this tag to your page’s masterpage or 1st line of tag.
If you are on ASP .NET MVC you can add this to your model, assuming that your model has the content variable.
[AllowHtml] public string content = String.Empty;
Thanks hope it help you allot. Also if you are not familiar with XSS attacks, I will try to make an article for that so you can create your own script that is hack-able, be able to prevent it, and know what are it’s crons.
Have you’ve been missing some pool in your IIS for your ASP .Net?
The this article entitle IIS Missing ASP .Net 4.0 Pool will help you.
Chances are, you need to install .NET 4 (Which will also take care of a new AppPool for you)
Open your command prompt (Windows + R) and type cmd and press ENTER You may need to start this as an administrator if you have UAC enabled. To do so, locate the exe (usually you can start typing with Start Menu open), right click and select “Run as Administrator”
Type cd C:\Windows\Microsoft.NET\Framework\v4.0.30319\ and press ENTER.
Type aspnet_regiis.exe -ir and press ENTER again.
at this point you will see it begin working on installing .NET’s framework in to IIS for you
Close the DOS prompt, re-open your start menu and right click Computer and select Manage
Expand the left-hand side (Services and Applications) and select Internet Information Services
You’ll now have a new applet within the content window exclusively for IIS.
Expand out your computer and locate the Application Pools node, and select it. (You should now see ASP.NET v4.0 listed)
Expand out your Sites node and locate the site you want to modify (select it)
To the right you’ll notice Basic Settings… just below the Edit Site text. Click this, and a new window should appear
Select the .NET 4 AppPool using the Select… button and click ok.
Restart the site, and you should be good-to-go.
(You can repeat steps 7-on for every site you want to apply .NET 4 on as well)
I have been wondering today on how to make your website created on ASP .Net perfect to all timezone so that if a user view your website on another country the date and time of your website is set to their timezone. So lets start to Timezone your DateTime!
First create a Website Project on your Visual Studio
Have ever wondering on how can you handle a Single Login Per User on your website? Yes may be you will need to disable multiple login due to some security reasons. So here is the only perfect way that you can do it:
When the user login flag on the database either an IP(for single login on a network) or Session Id of the user (for single login across all network).
Then every time the user visit a page in your website check if the flag has been change.
If the flag has been change then log off the current user
That way you can manage only one login per account depending on what situation you want it to happen. If you are thinking that you don’t want to logoff the current user but disable other login that will be impossible to happen. Because you can’t stop a user from closing the browser or shutting down the computer. In such cases you can’t handle on your script.
Both extensions utilizes the creation of custom helper to make jQuery development quite easier but abstracted. Abstracted because you are learning how the extensions should be use to produce jQuery but your not really coding jQuery.
I have been searching the web on how to easily send email thru ASP .NET MVC 3 and finally found the right code for it, its called WebMail. Look at the code below and insert it to one of your Controller’s Action:
Time to remember an old friend on creating a report on ASP .Net, the Sql Server Report Service also known as SSRS. SSRS utilizes the MS SQL Server that simplifies the creation of report. The Concept is that you separate the location where your report is located so that even if your website is down you can still provide report and use it on other web programming language by putting it in an iFrame.
Upon reviewing here are the sites that made me remember:
An index.html, in some cases default.html, is the main page of our website. It is the default file that our browser/server look for to view our website. The file extension(.html) also varies to what programming language we are using.
PHP -> index.php
ASP -> index.asp
JSP -> index.jsp
It can also be set on some programming language on what specific file should the browser/server look for.
So be reminded that if you are developing a website that you should set the main page’s file name of your website to index.