23 Sep
Posted by Jayce as Programming, Web - 832 views
CS0016: Could not write to output file ‘c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files… ‘Access is denied.’
Do you face this problem lately? I did. I have problem to run ASP.NET web application on a fresh installed server. It cannot run ASP.NET even I install .NET Framework 3.5. Web application can be loaded after I register ASP.NET into IIS by using “aspnet_regiis.exe -i -enable“.
However, I faced the problem statement above. So what is the solution? It have something to do with file permission. Just follow below steps to fix it.
Grant full control to two users of your system “Network Service” and “YourComputerName\IIS_IUSERS” on the following folders.
1. C:\Windows\Temp
2. C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
Restart IIS and try run your web application again.
Hope this guide will help. ![]()
How to change GridView HeaderText? I have been looking for this solution for days. Finally, I got the answer. Yeah… ![]()
Here is the code…
GridView01.Columns[0].HeaderText = “HeaderName”;
This will change the GridView’s first column to “HeaderName”.
Why ASP.NET Master Page Name Mangling is important? I did not know about it before I encounter some issue with JavaScript ID naming. I cannot run the JavaScript code due to wrong ID name.
For example, you create a button with ‘Button1′ as its ID. Its name will still be ‘Button1′ under normal HTML. However, its name changes if you use ASP.NET MasterPage. It will change to ‘ctl00$Button1′ from ‘Button1′. You can find that out when you see its source code using Internet Explorer / Firefox view source function.
Here are some source code to pass DateTime JavaScript value to ASP.NET in C#. It is used to get client side date and time. It is useful for those who need to display client date and time instead of hosting server date and time.
Put these codes at HTML
<input type=”hidden” id=”hdClient” runat=”server” />
Put these codes at ASP.NET code behind
At Page_Load
Page.RegisterClientScriptBlock(”1″,
“<script type=’text/javascript’>
function goforit()
{var now = new Date();
var offset = now.getTimezoneOffset();
document.forms[0].hdClient.value = -offset}
</script>”);ClientScriptManager manager = Page.ClientScript;
manager.RegisterStartupScript(this.GetType(), “CallSomething”, “goforit();”, true);
And…
Label1.Text =
DateTime.Now.ToUniversalTime().AddMinutes(double.Parse(Request.Form[”hdClient”])).ToString();
Hope this will help. ![]()
30 Jan
Posted by Jayce as Programming, Web - 825 views
System.Configuration.ConfigurationErrorsException: Could not load file or assembly ‘Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified.
Do you ever see this problem when you try to load ASP.NET web application? Well, based on the error code. It should have something related to ReportViewer. It seem like the ReportViewer component is not found.
I don’t have the problem during development at my development server. However, I faced this problem when I deploy to another machine. Why is this happening?
Here is the solution…
This should do the trick. ![]()