Monday, March 28, 2011

How to prompt user if page is idle from last 5 minutes

While going through a interview, a interviewer asked me this question which made me to think over it. The question was: I have a web page and i want that, if a user not perform any operation (enter text or select a item from dropdownList or any other such) for last 5 minutes on that page then he should be prompted by a message. i answered the question but he was not looking satisfied. Later when i worked over it and got to...
Read More

Implementing two interfaces which define same function

Lets say we have two interfaces named "Intr1", "Iintr2" and both the interfaces contains a function named "myFunction()". now lets say, we have a class named "myClass" and we are implementing both the interfaces in that class. so now because of rule of implementation, we will have to override/define all the function of interface "Intr1" and "Intr2" in class. now the twist comes to story. as we have a function with same name...
Read More

Create thumbnail in c#

Many of times we requires to create a thumbnails images or we can say we wants to create a new image from existing one with different height and width. to do so below code will help you: First of all create an object of image class and pass image url in it: System.Drawing.Image objImage = System.Drawing.Image.FromFile(strFilename) ; Now create thumbnail: System.Drawing.Image.GetThumbnailImageAbort callback ; callback =...
Read More

Tuesday, March 15, 2011

Insert item in listbox at top using javascript

many of times we have requirement to add a item at top of listbox using javascript (add item at index 0).        var txtl = document.getElementById("<%= txtvalue.ClientID %>");         var lst = document.getElementById("<%=mylistbox.ClientID %>");         if(txtl.value != "")        ...
Read More
Powered By Blogger · Designed By Seo Blogger Templates