Posts tagged: Quick fix

ASP.NET button doesn’t fire UpdatePanel Async Postback (solution)

By , 11/04/2010 9:17 AM

If you’re trying to use a standard ASP.NET button control as a trigger for your AJAX UpdatePanel’s async postback – and it doesn’t fire, try setting button’s UseSubmitBehavior property to False. This will render button as a standard button with __doPostback() call instead of Submit button in HTML markup and will solve your problem.

Error using Crystal Reports 2008 in ASP.NET application on 64bit server

By , 08/13/2010 8:27 AM

If you’re using Crystal Reports 2008 in your ASP.NET application, and after deploying to a 64bit server getting following error:

An error has occurred while attempting to load the Crystal Reports runtime. Either the Crystal Reports registry key permissions are insufficient, or the Crystal Reports runtime is not installed correctly. Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required. Please go to http://www.businessobjects.com/support for more information.

then switch your application to 32bit mode. In case of Windows 2003/IIS6 entire server will have to be switched, in case of Windows 2008/IIS7 a dedicated 32bit application pool can be established for your application.

UltraWebGrid in Infragistics 9 displays default column captions.

By , 02/22/2010 6:20 PM

Recently I upgraded an ASP.NET project from ancient 6.3 version of Infragistics to current (at the moment) 9.2. Suddenly UltraWebGrid control began to display an unpleasant effect – columns that used to have no caption now showed what appeared to be default captions:

New look of UltraWebGrid

Looking at grid’s HTML markup I noticed that it set the caption to an empty string (showing code for one column):

<igtbl:UltraGridColumn HeaderText="">
   <Header Caption="">
   </Header>
</igtbl:UltraGridColumn>

Apparently it’s a new behavior in Infragistics 9.x to substitute empty captions with default column names. The solution is to set caption to a single space which, while invisible, is considered a real text caption and is not substituted by anything:

<igtbl:UltraGridColumn>
   <Header Caption=" ">
   </Header>
</igtbl:UltraGridColumn>

The result:

Correct look of UltraWebGrid

Visual Studio 2003 hangs trying open ASP.NET project from Visual SourceSafe

By , 10/20/2009 10:21 AM

If you still use Visual Studio .NET 2003 (I still do for some older .NET 1.1 projects) you may experience following situation:

  1. You have an ASP.NET Web project that is controlled by Visual SourceSafe
  2. While opening the project Visual Studio 2003 hangs, stops responding to mouse clicks and keystrokes.

Fortunately there is a quick fix to that.
Continue reading 'Visual Studio 2003 hangs trying open ASP.NET project from Visual SourceSafe'»

Postback disabled/readonly Textbox that was modified in JavaScript

By , 10/09/2009 4:56 PM

Let’s say in your ASP.NET application you set a TextBox control’s property ReadOnly to True (or Enabled to False) to prevent user from entering data directly. But you still want to update that text box’s value via client-side JavaScript. Which is happening, the value can be updated.  But during postback to the server – surprise, surprise! – the new value doesn’t persist. This is due to security precaution – if the value wasn’t meant to be changed – the change is not allowed. But there is a way around this.

Continue reading 'Postback disabled/readonly Textbox that was modified in JavaScript'»

Method ‘System.Object CompareObjectEqual(System.Object, System.Object, Boolean)’ has no supported translation to SQL. Solution to error

By , 10/01/2009 2:15 PM

I was running a basic LINQ 2 SQL statement:

From role In db.user_role _
Where role.USER_ID = Session("user_id") Select role

when I encountered following error message:

Method ‘System.Object CompareObjectEqual(System.Object, System.Object, Boolean)’ has no supported translation to SQL.

After a little research I found the solution.
Continue reading 'Method ‘System.Object CompareObjectEqual(System.Object, System.Object, Boolean)’ has no supported translation to SQL. Solution to error'»

Infragistics WebDataMenu: Expanding context menu UP

By , 07/21/2009 4:08 PM

Infragistics WebDataMenu is a light-weight highly responsive menu control with rich server and clinet side model. I was using it to display context menu on right mouse click.  The code is pretty simple:

function onMouseClick(oEvent) {
   if (oEvent.button == 2) { //right mouse button clicked
      var menu = $find("xwdmMyMenu");
      menu.showAt(null,null, oEvent);
   }
}

It checks whether the right mouse button was clicked (line 2) then locates the menu object and shows it using showAt method (which accepts 3 parameters, either X and Y client coordinates, or event object from which it derives coordinates of the mouse click).

 It’s all well and good, but the problem is – menu always shows down from the location of the mouse click. And if the click is at the bottom of the screen – menu gets cut off:

I needed to make menu expand UP and  couldn’t find a build-in property or method that would change this behaviour (GroupSettings.ExpandDirection property had no effect). Time for a little hack. Continue reading 'Infragistics WebDataMenu: Expanding context menu UP'»

Setting DOM element height and width thru style in IE and Firefox

By , 07/09/2009 12:44 PM

I was using a pretty standard line of JavaScript code to set dimentions of an HTML element, something like:

oDiv.style.height = iWindowHeight/2 - 50;

It was working fine in IE, but had no effect whatsoever in Firefox.
Turned out all that was needed – to add ‘px’ to that line:

oDiv.style.height = iWindowHeight/2 - 50 + 'px';

and it works fine in both browsers.

Correcting “ASP.NET AJAX client-side framework failed to load” error

By , 07/08/2009 11:40 AM

If you’re trying to use ASP.NET AJAX features (like Script Manager or Update Panel) in your ASP.NET 3.x website and getting “ASP.NET AJAX client-side framework failed to load” error, chances are your Web.config file is missing required sections. Fastest way to correct this is to create a new ASP.NET website in Visual Studio (you can delete it afterwards) and copy missing sections from the new web.config to the one in your web site.

Update: As churawut pointed out missing .AXD mapping in IIS configuration is another common source of this error (often this is done as security hardening on the IIS).  I encountered it while researching missing images in ASP.NET charts, and found out that underlying reason was missing/corrupt .AXD mapping in IIS.

Panorama Theme by Themocracy