Error About "Inherits" Attribute Even Though It's Correct?

Sep 23, 2010

Having a really strange issue at the moment with an ASP.NET site I'm currently building. At the moment, I'm writting the HTML and CSS for a page called Dashboard.aspx. But when I go to view the page in a browser, half the time it throws up this error: ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl). I've checked the Inherits attribute on the .aspx page, and it matches the Partial Class held in the VB code of Dashboard.aspx.vb file.

When I refresh, it will always come up with this error. Then after a minute or two, it will load fine with no problems. I had a quick look on Google and I couldn't find an answer to this issue. I have also changed the name of the partial class (and the content placeholder on the .aspx file, thinking that may have caused a conflict) and nothing I do seems to fix it. Could anyone shed any light on what's going on?

View 1 Replies


Similar Messages:

Mvc Views With CLR Generics Syntax In Inherits Attribute?

Oct 18, 2010

For reasons I won't go into I need to use CLR generics syntax in an ASP.NET MVC view.

I.E. NOT this:

System.Web.Mvc.ViewUserControl<someobject>

but this:

System.Web.Mvc.ViewUserControl`1[[someobject]]

When I run the application I get

Parser Error: could not load type `System.Web.Mvc.ViewUserControl`1[[someobject]]

View 2 Replies

Set The Inherits Attribute Of An ASPX Page Directive To A Class In An Arbitrary Assembly?

Feb 24, 2011

Is it possible to set the Inherits attribute of an ASPX Page directive to a class in an arbitrary assembly?

I need to modify an ASP.NET (1.1) application for which the source code was lost. In a new assembly (foo2.dll) I've created a replacement code-behind class that derives from the original class in the site's code-behind assembly (foo.dll). It seems easy enough to set the Inherits attribute of the Page directive to the new class name, but when I do that the web server gives me Could not load type 'Foo2.checkout2'. I am referencing the new assembly in the <assemblies> section of Web.config.

I don't see anything in the documentation to indicate that this scenario is unsupported, but I'm not certain that it is, either.

Original

<%@ Page Inherits="Foo.checkout" language="c#" Codebehind="checkout.aspx.cs" AutoEventWireup="false" %>

New

<%@ Page Inherits="Foo2.checkout2" CodeFile="checkout2.aspx.cs" CodeFileBaseClass="Foo.checkout" language="c#" Codebehind="checkout.aspx.cs" AutoEventWireup="false" %>

View 1 Replies

Why Can't Use C# Syntax In Inherits Attribute For A Closed Generic But CLR Syntax Is Fine

Jan 15, 2011

The following CLR syntax works fine in my aspx page:

<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="Website.MyBasePage`1[HomePageViewModel]" %>

But this C# syntax does not:

<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="Website.MyBasePage<HomePageViewModel>" %>

Note, I am not using ASP.NET MVC, but this works fine if using System.Web.Mvc.ViewPage<> from ASP.NET MVC.
My MyBasePage looks like this:

public class MyBasePage<TModel> : Page where TModel : class {
public TModel Model
{
get { return (TModel)HttpContext.Current.Items["model"]; }
}
}

View 1 Replies

Add Correct Checked Attribute When Rendering Html

May 3, 2010

It doesn't seem that the Html.CheckBoxFor helper adds the correct "checked" attribute when rendering the HTML. I have a bool property rendered like so:

<%= Html.CheckBoxFor(m => m.Visible) %>

And the outputted HTML is this:

<input type="checkbox" value="true" name="Visible" id="Visible">

Is there some particular reason it does not add the "checked" attribute when the value is true?

View 1 Replies

Configuration :: Parse Error When Using Inherits?

Mar 24, 2011

I just uploaded files to my website and am getting a parser error when it comes to the Inherits word. If the exact error , you can look at [URL] the required dll is located at [URL] if it i got the web host godaddy sells. Also I thought it would be worth noting that if I remove the Inherits from the page there is no error.

View 1 Replies

Web Forms :: Getting Error / Unrecognized Attribute 'targetFramework'. Note That Attribute Names Are Case-sensitive

Mar 17, 2011

I have a problem with my web site 1stSigBdeAssn.org. I have made no changes to the site but I now get the following error message:

Parser Error Message:

Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.

Source Error:

[code]....

View 4 Replies

Forms Data Controls :: ListItem Error Message Validation(ASP .Net):Attribute CssClass Is Not A Valid Attribute Of Element ListItem

Sep 17, 2010

I have a tag:

<asp:ListItem
CssClass="LabelCSS">Executive</asp:ListItem>

and I am getting the error message

Validation(ASP .Net):Attribute CssClass is not a valid attribute of element ListItem.

What attribute would I use for Css with ListItem?

View 2 Replies

C# - Source File Parse Error - Could Not Load Inherits Type File

Mar 10, 2011

How do I fix this error?

I'm running .NET Framework v4.0.30319 so the Framework shouldn't be an issue. I'm not using any DLL files or bin directories. How do I setup the IIS/Virtual Directory if I'm using Forms Authentication for the whole website using VS2010?

Description: An error occurred during the parsing of a resource required to service this request. review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'ACAWebApplication.Pages.State_Carrier_Search'.

Source Error:

[code]....

[code]....

View 3 Replies

Web Forms :: Getting Error - Input String As Not In A Correct Format Error

Feb 21, 2011

I am getting the below error when tryingn to do an Insert. Any words of wisdom would be great:

Input string was not in a correct format.

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.FormatException: Input string was not in a correct format.

Source Error: [Code]....

I am using the ErrorLbl to capture any errors.

View 5 Replies

Forms Data Controls :: Error - "Input String Was Not In A Correct Format." Error When Trying To Sort Gridview

Jan 21, 2011

I have gridview control that has data binded by using EF. Whenever I try to sort my gridview I get this error: "Input string was not in a correct format." This error points to the following line of code: "int index = Convert.ToInt32(e.CommandArgument);"

AdministracijaVrstaAktivnosti.aspx

[Code]....

AdministracijaVrstaAktivnosti.cs

[Code]....

I'm not sure what do I have to fix if I want to sort the columns.

If I bind the data manually what is the code for codebehind to allow sorting for particular columns.

View 3 Replies

Input String Not In Correct Format - Error

Apr 8, 2010

Is it legal to define a default value for a parameter the way I am in the code below? It keeps throwing an "Input string was not in a correct format." error for me. Is there a different way I should be doing this?

<asp:LinqDataSource ID="lds_numbers" runat="server" ContextTypeName="nrm.prop.myDataContext"
TableName="Sources" Where="myNumber== @myNumber" EnableDelete="True"
EnableInsert="True" EnableUpdate="True">
<WhereParameters>
<asp:Parameter DefaultValue='<%= this.StateItems["myNumber"] %>' Name="myNumber" Type="Int32" />
</WhereParameters>

View 2 Replies

Error: Input String Was Not In A Correct Format?

Oct 26, 2010

i wants to convert string to long , below the code, i try to convert string type to long

but it throws the error: Input string was not in a correct format.

long works= Int64.Parse((Label2.Text.ToString()));
string kannan = RupeesIntoWords.ConvertRupeeToWord(works);

View 1 Replies

How To Display Attribute Error Messages

Jan 28, 2011

I am having an attibute

[Code]....

The user logged in doesnt have any admin right and the RequiresAdminRights throws an exception. How can I display the exception message?

View 1 Replies

.net - Unrecognized Attribute 'requirePermission' Error

Nov 26, 2010

I am getting following error: Unrecognized attribute 'requirePermission' from machine.config file.When i trying to login by using WCF services from Windows application which is developed in 1.1.

View 1 Replies

Web Forms :: Error - Input String Was Not In Correct Format

May 7, 2015

I got this error: Input string was not in a correct format.

Source Error: 

Line 63: protected void btn_save_add_Click(object sender, EventArgs e)
Line 64: {
Line 65: pcd.Pro_Comp_ID = Convert.ToInt32(txt_prod_of_compID_add.Text);
Line 66:
Line 67: //int companyId = Convert.ToInt32(ddl_choose_companyName.SelectedValue);
 
I revise 'Pro_Comp_ID' in sql and .net it all of datatype 'int' where is the error?

View 1 Replies

Web Forms :: Input String Was Not In Correct Format Error

Nov 7, 2013

error...Input string was not in a correct format.

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.FormatException: Input string was not in a correct format.

Source Error:

Line 59: Primarykey = Convert.ToInt32(GridView2.DataKeys[i].Value);
Line 60: ProductName = ((Label)GridView2.Rows[i].FindControl("lblproductname")).Text;
Line 61: txtCostPrice = Convert.ToInt32(((TextBox)GridView2.Rows[i].FindControl("txtcostprice")).Text);
Line 62:

my code

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;

[code]....

View 1 Replies

C# - Adding KnownType Attribute Causes Unknown Error?

Jun 21, 2010

I'm using DataContract/DataMembers to serialise my class to JSON for a webservice, and it all works fine, except for one of my members, which could either be class a, or class b, where class b extends class a.

If I omit the KnownType parameter, then an exception is thrown during serialisation:

Type 'ClassB' with data contract name 'ClassB:http://schemas.datacontract.org/2004/07/MyApp.App_Code' is not expected.

As expected, because the ClassB is an extension of Class A, and so not know to the deserialiser. So I need to add a known type attribute, which I do, to the parent Class which contains the member

[KnownType(typeof(ClassB))]
[DataContract]

This compiles fine, but the page which I am currently testing this on seems to go bizzare, it loads fine, however apparently the Service doesn't exist anymore, as my JS call tells me and throws and error. But I have no idea why adding the known type attribute on my class causes the webservice to apparently not exist :s

Is it something to do with the fact that my setup is ClassA, ClassB: ClassA, and all the examples I have seen, seem show a ClassA: ParentClass, ClassB: ParentClass setup.

.NET 4, VWD 2010express

View 1 Replies

Web Forms :: Input String Was Not In A Correct Format - Receiving An Error?

Mar 15, 2010

I am receiveing this error. On this line:

DataRow dr = GetCurrentEvents(int.Parse(Request.QueryString["ScheduleID"]));

ScheduleID is an int in my stored procedure. SoI inserted the (int.Parse) But now I get that error. How can I convert an int into the QueryString.?If I take out the (int.Parse) The method I have calling the above. Its something like:

private DataRow GetCurrentEvents(int ScheduleID)

{

some stuff

}

If I change it to (string ScheduleID). I get a different error bc I'm trying to convert an nvarchar to an int...

View 13 Replies

AppendDataBoundItems Throws Error, Input String Was Not In A Correct Format?

Jan 20, 2011

I've got a Dropdownlist with CategoriesI've also got a Listbox with Items filled using the selection from the DDL (autopostback=true).I have a SQLDataSource for each one.the DDL populates perfectly. the listbox SQL DataSource uses a stored procedure, that, on its own works perfectlyIt works well just as outlined above. However, when I add the following properties to the DDL, I get an error:
appendDataBoundItems=true and '--Select--' (tried 'Select' also) as an item
the error is:Input string was not in a correct formatI also set up the sqlDataSource selecting event handler, so that it would check for 'Select' first, but it bypasses that handler when debugging, and goes straight to the error msg

View 2 Replies

AJAX :: Getting Error / Ensure The Correct Version Of The Scripts Are Referenced - How To Fix It

Jun 14, 2010

We have upgraded recently from Visual Studio 2008 to Visual Studio 2010. One of the upgrades has to do with the AJAX libraries.

On the initial project (SV2008) the AjaxControlToolkit.dll used was:

Product Version:version: 1.0.10920.0
Date Modified: 28/09/2007

The current one, used in the VS2010 project is:

Product Version:
3.0.31106.0
Date Modified: 09/03/2010

The project compiles fine but once we access some web pages, we get numerous error messages with the first one being:

Message: AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. If you are using an ASP.NET ScriptManager, switch to the AjaxScriptManager in System.Web.Ajax.dll, or use the ToolkitScriptManager in AjaxControlToolkit.dll.

View 8 Replies

DataSource Controls :: Error - Input String Was Not In A Correct Format

Jun 21, 2010

I am using a SQL stored procedure to insert client records into multiple tables.

this is my datasource markup:

[Code]....

I am using a multiview to step through the input pages then on the last view there is a submit button that fires this:

[Code]....

this is my stored procedure:

[Code]....

View 5 Replies

Web Forms :: Getting Error Second Time - Input String Was Not In Correct Format

May 7, 2015

when I adding for first time it's added successfully but for the second time it raises this error:

Input string was not in a correct format.
protected void btn_save_add_Click(object sender, EventArgs e)
Line 147:        {
Line 148:            pro.Pro_ID = Convert.ToInt32(txt_prodID_add.Text);
Line 149:            pro.Pro_Name = txt_prod_name_add.Text;
Line 150:            pro.CategoryProd_ID = Convert.ToInt32(ddl_ctegOf_Product_add.SelectedValue);

View 1 Replies

Configuration :: Deployment Error: Unrecognized Attribute 'type'?

Nov 26, 2010

I am trying to deploy my site from my computer to my server and I am getting the next error.

Server Error in '/Fleet' Application.

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

Parser Error Message: Unrecognized attribute 'type'.

Source Error:

[Code]....

Source File: C:InetpubwwwrootFleetWebweb.config Line: 12

I am using Framework 3.5

I have tried to change asp.net from 1.1.x to 2.0.x and I am getting other error : The page cannot be found

View 2 Replies

C# - Custom Attribute In .NET For Page_Load / Displays An Error Message?

Oct 8, 2010

I have an ASP.NET 3.5 Site where, in some places, I am checking if the currently logged on Active Directory user is in a certain AD Security Group. In the Page_Load I'm doing something like this:

if (isInADGroup(UserGUID))
{
//proceed
}

Now I was wondering, couldn't I just create a Custom Attribute, like some of MVC's security attributes, which runs this check and cancels the execution or displays an error message?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved