maintaining scroll position on Page Postback

Microsoft provides an property for pages " maintainScrollPositionOnPostBack". If this is set to true it works fine in Internet Explorer browser. But  maintainScrollPositionOnPostBack="true" doesn't work in webkit browsers correctly. some techies use hidden field to maintain the scroll position.... [More]

Required field validator not firing on readonly textbox

Are you expecting a required field validator will fire on your empty textbox field (textbox with readonly property)? Well, it will not fire. You need to refer the behavior of asp.net validators. Required field validator is disabled for readonly inputs. But still you have a scenario where you wa... [More]

Show Update Progress on JavaScript function call

If we have defined Update Progress with Update Panel, this magic works automatically. In case, you want to show this explicitly, you need to write some code with help of Script Manager. The below lines of script code will do the job what we want. We need to place below script inside a <script typ... [More]

asp.net Panel with scroll bar

If you want to set vertical scroll bars with Panel by applying CSS ScrollBars="Vertical" only then it will not work perfect. In addition to ScrollBars, you need to apply one more css property wrap="false". <asp:Panel ID="myPanelID" runat="Server" Height="300px" Width="400px" ScrollBars="Vertical"... [More]

Simple way of applying file downloads permission

There could be many ways of validating users before allowing them to download the files. In some applications, you can put direct URL of files into browser and can get downloaded from there directly. It is because that application don’t have user validations on file downloads. Users role can b... [More]

Difference between CSS overflow : auto and overflow : scroll

If you want to make a DIV element with scrolling either horizontal or vertical, you set CSS’s overflow attribute to scroll or auto. But there is a small but important difference between these scroll & auto. [More]

Exporting huge DataSet or DataTable into Excel via byte array

 CodePatternAdSense You can do it using third party well written code that are available in the [More]

Using master page with iframe for content page

Though iframe is no more used in modern web programming. HTML5 and CSS3 is buzz now a days. Some prefer using update panel for their whole content page. There are many ways to handle the post backs of pages for better efficiency. Here, I am giving a good sample for using master pages with iframe for... [More]

Create a clone of panel with fieldset on hyperlink click

There is no readymade clone or copy method so if you have a panel which contains fieldsets with controls and want to add the same panel to the page on hyperlink button click, you have to do it yourself through coding. You can create new Panel object and initialize its properties ... [More]

HCL Interview questions on WCF

These questions are from a walk-in of HCL Noida. (1) For what purpose WCF is used in your current project? (2) What is binding in WCF? (3) How many bindings are there? Have you ever used netMsmqBinding or netNamedPipeBinding? (4) If my hosted service is chargeable and I want to track the record that who has called/ accessed my service how many time, how can I do it? (5) I want to restrict the concurrent access of my service to limited users, how can I do that? Where this setting is done? (6) How session management is done in WCF? (7) How WCF service is secured? [More]