Owner: Get solution of your bug URL:http://bugtrace.blogspot.com Join Date: Sun, 02 Dec 2007 23:33:49 -0600 Rating:0 Site Description: get solution of all programming bugs of AJAX, VS.NET,ASP.NET and much more Site statistics:Click here
Is there any way to get detailed error information for Win32 errors when using Platform Invoke? 2008-01-17 23:53:00 Yes, you can use the FormatMessage Win32 API. Sample projects for C# and VB.NET are enclosed. This is how the declaration looks like: [DllImport("Kernel32.dll")] public static extern int FormatMessage(int flags, IntPtr source, int messageId, int languageId, StringBuilder buffer, int size, IntPtr arguments );Called like so:// You can call FormatMessage to get a descriptive error
message StringBuilder sbFormatMessage = new StringBuilder(1024); retVal = Interop.FormatMessage(Interop.FORMAT_MESSAGE_FROM_SYSTEM, IntPtr.Zero, Marshal.GetLastWin32Error(), 0, sbFormatMessage, sbFormatMessage.Capacity, IntPtr.Zero); Read more:information
, Platform
I get an error message "Property cannot be assigned to -- it is read only". How can I set this read only property? 2008-01-17 23:52:00 When I try to set a particular font style, say italics, I get an error
message "Property cannot be assigned to -- it is read only". How can I set this read only property
?Code such as tabControl1.Font.Italic = true;will not work. Instead, you have to create a new Font object, and set the property during its creation. This code will work. tabControl1.Font = new Font(tabControl1.Font, FontStyle.Italic);
I get a 'This would cause two bindings in the collection to bind to the same property' error message. What might cause this? 2008-01-16 23:28:00 As the message suggests, the code is calling Control.DataBindings.Add twice with what amounts to the same parameters.One way this might happen is if you call the same code more than once in your program to reload your datasource for some reason, and in this code, you have lines such as:Me.TextBox1.DataBindings.Add("Text", myDataTable, "Col1Name")Me.TextBox2.DataBindings.Add("Text", myDataTable, "Col2Name")Me.TextBox3.DataBindings.Add("Text", myDataTable, "Col3Name")On the second call, this would attempt to add a duplicate binding to the DataBindings collection
. One solution is to Clear the DataBindings collection before you add your new binding.Me.TextBox1.DataBindings.Clear();Me.TextBox1.DataBindings.Add("Text", myDataTable, "Col1Name")Me.TextBox2.DataBindings.Clear();Me.TextBox2.DataBind Read more:error
, property
, bindings
When I try to update a dataset I get an error that the system is unable to find "Table"? 2008-01-15 23:56:00 Are you calling Update on the dataset like this without specifying the name of the table that you are updating. The problem is that when table names are not given the system assumes a table name of 'Table
'. This of course causes the update to fail.this.dataAdapter.Update(this.dataSet);If so just change this line tothis.dataAdapter.Update(this.dataSet, "Customers");// replace 'Customers' with the table that you have Read more:error
In C++, the code "MyClass ht;" creates an object ht on the stack frame. But in C#, this same code compiles, but gives a runtime error. Why? 2008-01-15 23:55:00 MyClass ht; does not create any object. Instead, it creates a variable (a reference) of type MyClass, and sets its value to null. No object is created. To create an object, you need to explicitly call the class contructor with a new. MyClass ht = new MyClass();You can also use ht to refer to an instance of MyClass that has been created (with a new) at some other point in your code. MyClass myClass = new MyClass(); MyClass ht; ht = myClass; // both ht and myClass are references to the same object... Read more:error
session does not working in Web Service 2008-01-08 23:18:00 The EnableSession property of the WebMethod attribute enables session
state for an XML Web service method. Once enabled, the XML Web service can access the session state collection directly from HttpContext.Current.Session or with the WebService
.Session property.in VB.NET _in C#[System.Web.Services.WebMethod(EnableSession=true)] Read more:working
Parse error: parse error, unexpected T_STRING 2008-01-07 23:24:00 Cause of ErrorThe problem is the syntax of your code, perhaps you forgot a semi-colon on one of the lines.How to Fix ThemIf you notice that you forgot a simple semi-colon, then insert it and you'll be on your way. Read more:error
Internet Explorer cannot download MyPage.aspx from MyWebSite.com 2008-01-01 23:21:00 Why do I get error message "InternetExplorer
cannot download MyPage.aspx from MyWebSite.com ..."?This happens for example, whe you try to export data to excel from a datagrid.The problem occurs if the server is using Secure Sockets Layer (SSL) and has added one or both of the following HTTP headers to the response message:Pragma: no-cacheCache-control: no-cache,max-age=0,must-revalidate Read more:Internet Explorer
Unable to find script libruary 'WebUIValidation.js' 2008-01-01 23:20:00 Why do I get the "Unable to find script
libruary 'WebUIValidation.js'" error ?When you install the .Net framework on your web server, it installs some script files (including the above) under the root folder (usually "C:\inetput\wwwroot" if you do a default installation) . You can then find the above file at "C:\Inetpub\wwwroot\aspnet_client\system_web\1_1_4322", for example.The above problem could happen if you reconfigured your web root directory to be a different one after you installed ASP.Net in your web server. If that is the case, then run 'aspnet_regiis -c' (utility is under %windir%\Microsoft.NET\Framework\v1.1.4322, for example) or copy over manually the above script files into a similar sub-directory below your current web root directory. Also, if you look at the error message i
Compiler Error Message: BC30289 2007-12-30 23:37:00 My ASP code gives an error "Compiler Error Message
: BC30289: Statement cannot appear within a method body. End of method assumed" when changed to .aspx?Use a script runat=server block instead of the Delimeter syntax to define Subs.Make sure you have proper events associated with the code and have start and end of procedure or function wirtten properly.
How to catch the 404 error in my web application and provide more useful information? 2007-12-30 23:35:00 In the global.asax Application_error
Event write the following codeVB.NETDim ex As Exception = Server.GetLastError().GetBaseException()If TypeOf ex Is System.IO.FileNotFoundException Then 'your code 'Response.Redirect("err404.aspx")Else 'your codeEnd IfC# Exception ex = Server.GetLastError().GetBaseException();If (ex.GetType() == typeof(System.IO.FileNotFoundException)){ //your code Response.Redirect ("err404.aspx");}else{ //your code} Read more:information
Server Application Unavailable 2007-12-28 23:31:00 Why do I get the error message "Server Application
Unavailable The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request."?By default, ASP.NET runs its worker process (Aspnet_wp.exe) with a weak account (the local machine account, which is named ASPNET) to provide a more secure environment. On a domain controller or on a backup domain controller, all user accounts are domain accounts and are not local machine accounts. Therefore, Aspnet_wp.exe fails to start because it cannot find a local account named "localmachinename\ASPNET". To provide a valid user account on the domain controller, you must specify an explicit account in the section of the Machine.config file, or you must use t
Why do I get the "Unable to find script libruary 'WebUIValidation.js'" error ? 2007-12-28 23:31:00 When you install the .Net framework on your web server, it installs some script
files (including the above) under the root folder (usually "C:\inetput\wwwroot" if you do a default installation) .You can then find the above file at "C:\Inetpub\wwwroot\aspnet_client\system_web\1_1_4322", for example.The above problem could happen if you reconfigured your web root directory to be a different one after you installed ASP.Net in your web server. If that is the case, then run 'aspnet_regiis -c' (utility is under %windir%\Microsoft.NET\Framework\v1.1.4322, for example) or copy over manually the above script files into a similar sub-directory below your current web root directory. Also, if you look at the error
message in detail, you will notice where the file is supposed to be.
Why do I get "HTTP 500" error (or "(DLL) initialization routine failed") in my browser? 2007-12-28 23:30:00 This is because if you have the /3GB boot switch enabled, the ASP.NET worker process (Aspnet_wp.exe) does not start. To create and set the "ASPNETENABLE3GB" environment variable as mentioned in the above article, right click MyComputer ->Properties->Advanced > Environment Variables > System variables > New. Add the variable name in the top text box and the value in the lower textbox. Read more:error
, browser
Invalid postback or callback argument 2007-12-25 23:14:00 Try adding this into the system.web section of your web.config file:pages enableEventValidation="false"@ Page Language="C#" MasterPageFile="~/Admin/MasterPage_Admin.master" AutoEventWireup="true" CodeFile="CategoryManagement.aspx.cs" Inherits="Admin_CategoryManagement" Title="Untitled Page" EnableEventValidation="false" You can also benefit from those features by leaving it enabled then register your control for event validation. Simply add the following call in the PreRender or Render page life cycle then your control should work without having to turn off eventValidation:Page.ClientScript.RegisterForEventValidation(this.UniqueID); Read more:Invalid
get error message Validation of viewstate MAC failed 2008-04-02 00:56:00 You have an ASP.NET web application running on a web-farm that does not use sticky sessions - so the requests for a session are not guaranteed to be served the same machine. Occasionally, the users get error
message Validation
of viewstate MAC failed. What could be one reason that is causing this error? The most common reason for this error is that the machinekey value in machine.config is different for each server. As a result, viewstate encoded by one machine cannot be decoded by another. To rectify this, edit the machine.config file on each server in the web-farm to have the same value for machinekey.
What does the "Access is Denied" IE error mean? 2008-04-02 00:54:00 The "Access
Denied" error
in any browser is due to the following reason.A javascript in one window or frame is tries to access another window or frame whose document's domain is different from the document containing the script.
Failed to load viewstate 2008-06-05 23:58:00 causeThe exception occurs because the viewstate of the page must be restored to its previous state. This mean we need to re-load any control we loaded dynamically before the page load had being triggered.Solution :I was able to get it working by setting the PlaceHolder that I was dynamically adding the control to EnableViewState="False".Set EnableViewStage=”false” in Page Directive
Operation must use an updateable query" error 2008-06-13 00:26:00 Reason: Your database is in a folder where there is no write/change permission.Resolution:If using Windows 2000 - IIS5- the {Server}\ASPNET User Account must have Read, Write, and Change Control of the Folder where database residesIf using Windows 2003 - IIS6- the NETWORK SERVICE User Account must have Read, Write, and Change Control of the Folder where database residesGiving EVERYONE account full Read more:Operation
, error
When we get Error 'HTTP 502 Proxy Error' ? 2008-08-24 23:39:00 We get this error when we execute ASP.NET Web pages in Visual Web Developer Web server, because the URL randomly select port number and proxy servers did not recognize the URL and return this error. To resolve this problem we have to change settings in Internet Explorer to bypass the proxy server for local addresses, so that the request is not sent to the proxy. Read more:Proxy
AjaxControlToolkit is undefined OR Sys' is undefined error in ASP.NET AJAX 2008-09-11 00:52:00 adding this under httpHandlers:<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>Turns out in the web.config nestled under <system.webServer> / <handlers>, I was missing this entry:<add name="ScriptResource" preCondition="integra Read more:error
, AJAX