In one of my recent projects I needed to validate whether user's input is a valid date, and this needed to be done client-side, in browser prior submission to the server. Lazy as I am, I Googled for a ready-to-use code snippet. There're plenty of versions out there, but most of them offer incomplete solution and none of them take into account browser locale, you know - the language settings:
So I decided to cook something of my own Read more...
This is probably a very obscure situation, but it happened to me, it could happen to someone else. Scenario: an ASP.NET page with Infragistics UltraWebGrid inside of a WARP panel. A button outside the WARP serves as a trigger for partial postback. First click on the button causes expected partial postback, but on the second click page does full postback and is screwed after that. The issue happens only in IE6/7, page works correctly in IE8.
Another condition - page contains ASP.NET AJAX ScriptManager control with ServiceReference path pointing to an ASMX WebService.
Turned out the issue was caused by project being left in debug mode (in web.config debug="true"). Which caused WebService page to be loaded with parameter "jsdebug" in query string. Which apparently IE6 and 7 didn't like very much. Switching to debug="false" in web.config solved the problem.
Categories: ASP.NET, HTML/CSS, Infragistics, Javascript, Rant Tags: browser, bug, dotnet, Error, html, Internet Explorer, Microsoft, solution
Hyperlinks are designed for clicking, to lead you somewhere else, but sometimes this behavior is undesired. In my case a grid control displayed some HTML data in its cells (including hyperlinks) and clicking on those links caused some undesired effects. I still wanted to display HTML and allow clicking on other grid elements (e.g. checkboxes) just needed a way to prevent hyperlinks clicks.
Remember that events bubble? That gave me an idea to wrap the grid control in a DIV to catch click events. This way I can check event source and if it's a hyperlink - cancel the event, otherwise allow it. Well that's pretty much it. Here's a stump for the DIV wrapper:
<div onclick="return checkClickSrc()">
<!-- Controls to check go here-->
</div>
and here's the JavaScript code that does the check:
function checkClickSrc() {
return event.srcElement.tagName != 'A'
//for firefox: return event.target.tagName != 'A'
}
In the previous post I described how using QuickPages property and a bit of creative HTML enhanced pager for Infragistics UltraWebGrid could be created. The only problem with QuickPages - the pager in this mode displays inconsistent number of page links. For example if you set QuickPages property equal 5, the pager will display from 5 page links (when you're at the beginning or at the end of the grid) to 11 (when you're in the middle). If you want that number to be consistent, you have to draw the page links yourself. Which turned out is surprisingly easy. Read more...
Infragistics UltraWebGrid offers rich set of features, among which paging of large sets of data. But if your total-number-of-records/records-per-page ratio is too high you will end up with way too many page links. And it doesn't look pretty:

UltraWebGrid offers some out-of-the-box solutions for this problem. Read more...
February 22nd, 2010
Yuriy
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:

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:

If you get the following error while browsing a page in Internet Explorer:
The value of the 'method' attribute may not be 'html'
chances are MSXML registration is corrupted on your machine. To fix this, open DOS prompt and type following commands:
regsvr32 msxml.dll
regsvr32 msxml2.dll
regsvr32 msxml3.dll
This will re-register MSXML and the error will go away.
Scenario: You're trying to update a template file in your PHPBB 3.0.x forum, for example to include Google Adsense code into overall_header.html file to display banner on top of all the pages. But after modifying and uploading the file nothing changes, board still displays old template.
What is happening - PHPBB displays cached version of the template. Forum software caches commonly used files to improve performance. The solution is to purge cache.

Login to your forum Administration Control Panel and click Run Now in Purge the cache section. After purging is complete changes in your template take effect.
If you open an IE Modal Dialog window and later on need to resize it using JavaScript code, standard "window.resizeTo" method doesn't work. Use dialogWidth and dialogHeight instead. For example:
window.dialogWidth='640px';
window.dialogHeight='480px';
Internet Explorer has a well known proprietary modal dialog window that can be opened using showModalDialog DOM command. While it is not a good idea to use browser-specific functionality, for many it's a convenient way to display a modal window and return result back to the parent.
Modal Dialog is designed to display data, accept user input and close window, returning the input back to the parent. It is not meant for postbacks, if you try initiating postback in Modal Dialog, all kinds of weird stuff could happen - from opening postback in a new window to JavaScript errors.
But there is an easy fix for that. If you include following line:
<base target="_self"></base>
inside of your page header in HTML source, e.g.:
<head>
<title>My Page</title>
<base target="_self"></base>
</head>
modal dialog will be able to successfully postback to itself.
Recent Comments