"property value is not valid" error when adding event to a control in ASP.NET
Detail error message is: Error HRESULT E_FAIL has been returned from a call to a COM component.
I opened my project after a couple of weeks and now I get his error. What I am trying to do is add extra entry to a Dropdownlist which is already bound to SQLDataSource, similar to this qu开发者_开发知识库estion. Also there is a question on windows form question. Is there any solution to this?
Edit: Looks like the problem line is the top line in .aspx file. This line is underlined (zigzag) and says "Syntax Error". This is causing code break in .aspx.cs file.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ContactIDs.aspx.cs" Inherits="ContactIDs" %>
My own answer: Apparently there was no error in the code but it somehow code corrupt, may be its setting.
Fix: Create a new .aspx file (webform), copy the contents of both .aspx and .aspx.cs file in the new files. The error is resolved. Make sure to check c# in language setting when creating new file.
精彩评论