mgthantzin.com/blog updates from me

about him

programming

Visual Studio 2008 SP1 Data Source Windows Problem

I haven’t used data source that much as I have been working on web projects for quite some time. Today, I gotta take a look at our previous Windows program and realized that nothing happened when I clicked ‘Show Data Sources’ or ‘Add New Data Source…’ from Data menu. I had to run this once [...]

JavaScript pageLoad() for MasterPage and ContentPage

Sometimes, we need to use pageLoad() function in both MasterPage and ContentPage to get something done. But, if we add two function with such same name, that function residing in ContentPage will be ignored by the browser. To correct this behaviour, we need to extend pageLoad() function in MasterPage as follows: In MasterPage function pageLoad(sender, [...]

Adding external files to VS project

Sometimes, we need to include files while publishing our web application in Visual Studio. But, those files (e.g. pdf) are not published together. In that case, make sure the file is in project. Right-click the file and if you see ‘Include in Project’, it means that file is not part of project yet. Then, right-click [...]

innerText for Firefox

Firefox doesn’t recognise innerText property. Below is the fix. var AmountLabelControl = document.getElementById(‘lblAmount’); var amount; if (AmountLabelControl.textContent) { // Firefox… amount = AmountLabelControl.textContent; } else if (AmountLabelControl.innerText) { // IE… amount = AmountLabelControl.innerText; } Thant Zin Oo

IE8 renders blank sub menu items for ASP:Menu

This is a known issue. Add following CSS class to your page. .IE8Fix { z-index:100; } And, apply that CSS to your menu’s DynamicMenuStyle. <asp:Menu ID=”ApplicationMenu” runat=”server” Orientation=”Horizontal”> <DynamicMenuStyle CssClass=”IE8Fix” /> </asp:Menu> Credit goes to km Web Solutions.

Simulating Button Click() Event in Firefox

We cannot directly simulate click event in Firefox. Add the following code to register mouseclick event for the button. HTMLElement.prototype.click = function() { var evt = this.ownerDocument.createEvent(‘MouseEvents’); evt.initMouseEvent(‘click’, true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null); this.dispatchEvent(evt); } Then, you may call the event in Firefox as if you [...]

iFrame & Modal PopUp

Undesired Behaviour: I tried to call a ASP.Net Ajax Modal Popup from master page code and child page has got one HTML iFrame. Modal Popup didn’t appear while the code was executed. Fix: Add runat=”server” tag to iFrame and make it server-side element. Behaviour was corrected.