Skip to main content


Showing posts from July, 2010

Google Search

Custom Search

Live Search

Yahoo Search

Search the web Search this site

Error Accessing Path

Today is a day full of errors, when I fixed one error another error came while trying to run my hosted application. This time it was “Access to the path 'C:\inetpub\wwwroot\……’ is denied.Full error is as follows,Access to the path 'C:\inetpub\wwwroot\Mining2 Setup\Images\temp\tempImage.png' is denied.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access to the path 'C:\inetpub\wwwroot\Mining2 Setup\Images\temp\tempImage.png' is denied. The issue here was generated by a code written in my application which tries to access an image named tempImage.png in the said folder (Images\temp).The reason for this is when you install IIS 7 the account used by the application pool (IIS_IUSRS) is not given access to the folder Images\temp. Since it is created by the applica…

Error when Installing MSI

Recently when trying to install a setup I made for a project on a new server having Windows Server 2008 R2 I continuously encountered an error as of below.“The installer was interrupted before “Application” could be installed. You need to restart the installer to try again.”The server had IIS 7, .Net Framework 3.5 and 4 installed. After putting in some time onto this I found out that this is because the II6 Management Compatibility services was not installed for the Web Server role.To fix it simply open the Server Manager and open up Web Server role and click on Add Role Services. Then select IIS 6 Management Compatibility node and all the child nodes below in under the Management Tools parent node and press next. When the installation is complete the setup will work as desired.

Changing the Control Style at Runtime using the ASPX

Recently I changed the style of some controls in my ASPX page at runtime based on the values set on another control in my page. For example the color of the table is changed based on the radio button that was selected and the color of the button is changed according to the text that was typed in the textbox. Hope this is helpful.

<htmlxmlns=""><headrunat="server"><title>Changing the Control Style</title><styletype="text/css">.Style1        {background-color: Red;        }.Style2        {background-color: Blue;        }</style></head><body><formid="form1"runat="server"><asp:RadioButtonID="RadioButton1"runat="server"Text="Red"GroupName="1"Checked="True"AutoPostBack="True"/><asp:RadioButtonID="RadioButton2"runat="server"Text="Blue"GroupName="1"AutoPost…

Cure for HIV/AIDS

Even though very little publicity was given a great medical finding was done by an American Doctor working in Berlin to find a cure for HIV/AIDS or Human Immunodeficiency Virus / Acquired Immune Deficiency Syndrome. As per the articles a stem cell transplant from a donor who had a gene mutation known as “CCR-5 Delta- 32” cured a patient with HIV infection with no traces of HIV after two years of the transplant.At the moment a transplant is much riskier thing to do since it involves of destroying and rebuilding the patients’ immune system. But this case of success will open up new ways to think and will help finding more safe and solid cures for HIV/AIDS in the near future.Read more,

Firing TreeView TreeNodeCheckChanged Event

Normally in ASP.Net TreeView you can enable it to show checkboxes in its node levels. So if you need to do any actions when a node is checked or unchecked you need to use the TreeNodeCheckChanged event. But the problem is TreeNodeCheckChanged event will not fire when a checkbox is clicked. The cause for this is because the TreeNode class which represents a node in the TreeView will not add onClick event on the checkbox.But if you carefully check it the event is getting fired at the next page postback. Since I needed to do some actions when the checkbox statuses are changed I made the page post back when a checkbox is checked or unchecked by the following java script. What it does is simply it will check the element which caused the event is a checkbox and do a postback of the page.

<scripttype="text/javascript">     function TreeViewCheckBoxClicked(Check_Event) {         var objElement;         try {    // Get the element which fired the event.objElement = window.event.…

Changing GridView Column Headers

If you are wondering a way to change the column header appearing in the .Net GridView control in run time then this post will help you to get it done.For example think that you need to change the normal grid headers shown in Screen A into something like shown in Screen B.Screen AScreen BI have removed few columns from the grid header and then I did add few customized column headers. The added “Edit” column and “Id” column are spanning to 2 rows, the “Temp Columns” column is spanning to 2 columns. I think the code is self explanatory. This way you will be able to create complex gridview headers.

protectedvoid GridView1_RowCreated(object sender, GridViewRowEventArgs e) {if (e.Row.RowType == DataControlRowType.Header)     {// Remving the first two colummn headers.         e.Row.Cells.RemoveAt(0);         e.Row.Cells.RemoveAt(0);// Creating the gridview row object.GridViewRow headerGridRow = newGridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Selected);         headerGridRo…