Saturday, December 13, 2008

Could not load file or assembly 'System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35' or one of its dependencie

I got this error when i was deploying site on web server. My application was working fine in my local. I was getting this error:-

Server Error in '/' Application.

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
..
.
..

I installed there AspNetMVCBeta-setup.msi. It worked for me.

HTTP Error 500.19 - Internal Server Error

When i was trying to deploy a website on iis 7,I was getting this error.

HTTP Error 500.19 - Internal Server Error
Description: The requested page cannot be accessed because the related configuration data for the page is invalid.

Error Code: 0x8007000d

Notification: BeginRequest

Module: IIS Web Core

Requested URL: http://localhost:8080/

Physical Path: E:\addressverket

Logon User: Not yet determined

Logon Method: Not yet determined

Handler: Not yet determined

Config Error: Unrecognized attribute 'allowOverride'

Config File: \\?\E:\addressverket\web.config

Config Source: 13:
.
.
.



I am using windows Vista. I never deployed any site from that system.
I found in program and feature , i had forgotten to on iis and other asp.net services.It worked for me , might be this will also help you.
Here is the steps to on services:

- Control Panel
- Program and Features
- Turn Windows Features On or Off
Here you will find different - different services. checked those services whatever services you need to run your site.
That worked for me, hope it will also work for you

Friday, December 12, 2008

Publish Failed

Hi friend,

If you don't have any error on your build and still you are getting publish failed error and you have no idea what is happening. Just Check the output window of your visual studio. Output window you can find in view menu.


Thanks,
jaydeep vishwakarma

Saturday, April 19, 2008

Check Box in GridView

GridView is very power fool control in .NET. Whatever the control we want to add we can add very easily.

Here is the simple Example of ad a check box in GridView:-



Just Double Click on image and see only bold text. I am using here ItemTemplate By the Item Style tag we can set style of a control which i am using inside the ItemTemplate . After this i am placing check box control. We can place any control whatever we want . After this i am taking a hidden control which i will use at the time of fetch the value corresponding to selected check box.

Here is the code for accessing the value of check box control:-


foreach (GridViewRow row in GridView1.Rows)
{
if (((CheckBox)(row.Cells[0].FindControl("RowLevelCheckBox"))).Checked)
{

string id = ((HtmlInputHidden)(row.Cells[0].FindControl("RowLevelIdHidden"))).Value.Trim() ;
sendValue(siteiId,adIdStr, "activated");
}
}

By this code snippet i am sending selected check box's id to sendvalue function.

I hope this blog is useful for you.

Jaydeep Vishwakarma.
jaydeepmailv@gamil.com

Thursday, February 14, 2008

DataGrid Validation

There is nothing tough stuff to validate Data Grid.

here is the code snippet which u can use to validate ur Data Grid.

protected void CarrierGridView_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
lblErrorMessage.Visible = false;
System.Collections.Specialized.IOrderedDictionary disc;
disc = e.NewValues;

try
{
float value = float.Parse(disc["price"].ToString()); //checking float value if it is not , it will //give exception and control goes to the //catch block
}
catch (FormatException ex)
{
System.Console.Write(ex.Message);
e.Cancel = true; // I am canceling the updating event
lblErrorMessage.Visible = true;
}
catch (Exception ex)
{
System.Console.Write(ex.Message);

e.Cancel = true;
lblErrorMessage.Visible = true;
}
}

Thanks,
Jaydeep Vishwakarma