Jayce Ooi’s Paradise

Photography, programming, technology, finance, anything =)
Subscribe to Jayce Ooi's Paradise feeds

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. :D

How to change GridView HeaderText?

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”.

ASP.NET C# Master Page Name Mangling

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.

(more…)

Pass DateTime JavaScript value to ASP.NET C#

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. :D

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…

  • Get the required files from your development server - C:\Program Files\Microsoft Visual Studio 8\ReportViewer (default path for Visual Studio 2005).
  • Copy Microsoft.ReportViewer.Common.dll, Microsoft.ReportViewer.WebForms.dll, Microsoft.ReportViewer.WebForms.xml, Microsoft.ReportViewer.WinForms.dll and Microsoft.ReportViewer.WinForms.xml.
  • Paste it at your web application bin folder.

This should do the trick. :D

« Older Entries  

Page 1 of 212»

Sponsored links

Archives

Chat Chat Chat...





Isabell Online Penang Florist

Isabell Online Penang florist

Recent Comments

Top Commentators