I was looking for the javascript to add the link in favorite. I have tried window.external.AddFavorite(location.href, document.title) which is working only in IE. I need to do that for firefox also. After spending few mnutes on google, I found the code working in both.
<script type=”text/javascript“> function bookmarksite(){ if (document.all) { // For IE window.external.AddFavorite(location.href, [...]
Archive for March, 2007
Add to Favorite in Firefox and IE
Posted in Javascript, Techincal on March 26, 2007 | 5 Comments »
Default button in ASP.NET
Posted in DotNet 2.0, Techincal on March 24, 2007 | 1 Comment »
I was creating a search page and I require that when user press enter key, by default search button’s click event should be fire. I look around for the solution and find the easiest one. You just need to write below line in page load of your code behind file.
Form.DefaultButton = btnSubmit.UniqueID;
Here btnSubmit [...]
Nullable datatypes in C#
Posted in DotNet 2.0, Techincal on March 19, 2007 | Leave a Comment »
In C# 2.0 there is a special datatypes called Nullable datatypes. You can assign null to them. Here is some basic information regarding Nullable data types.
You can make any value types to nullable data types by writing as shown below.
public int? intA = null;
Fig – (1) Declaring integer data types so it can [...]
Remove/Delete element from page using JavaScript working in FireFox,IE,Opera
Posted in Javascript, Techincal on March 16, 2007 | 16 Comments »
Few days ago, I was recalling my Java script skill. I was generating Grid using java script script. Instead of using Display property (‘none’ or ‘block’) to show or hide the control, I was creating and removing element each time. Creating element is not a big deal. However the script for removing element is different [...]
Create Serial Number Column using SQL Server
Posted in Sql Server, Techincal on March 15, 2007 | 22 Comments »
There is a common requirement to show records with serial number in Grid. The common scenario is, we take template field and label in Item Template. In Row_DataBound we can generate serial number using variable which is increamnted each time. The another approach is to genarate this column in SQL itself. Yes you can do [...]
Call parent window’s javascript function from child window OR passing data from child window to parent window in javascript
Posted in DotNet 2.0, Javascript, Techincal on March 10, 2007 | 105 Comments »
Hi, I was working on small application and I had a requirement as described here. I was creating a page in wjich user can add multiple cotact detail for him. The page has facility for add, delete and edit the contact. I was storing all these information in view state and finally on Save [...]
Storing and Retrieving Image in SQL Server
Posted in DotNet 2.0, Techincal on March 5, 2007 | 120 Comments »
Hi, I saw many developers are asking this questions in different forums. Recently I saw this question on MSDN forum and I thought let me write a blog on this. I know many of us found this too easy however for new bees its bit hard.
In this article, I had used SQL Server [...]
Impersonation using Code
Posted in DotNet 2.0, Techincal on March 1, 2007 | 1 Comment »
I was reading about impersonation and delegation. The most common way I found for impersonation is to write a tag “<impersonate = “true” username=”Name” password =”password” />” in web.config file. This will impersoname specific user to each request. I want to impersonate network user for only one request.
In my project I have to create [...]