February 09, 2009

Open Yahoo Mail through Windows Script

0 comments

Hi People,

I'm a Newbie to scripting world. I thought of writing a windows script which will take my credentials and automatically logs me into yahoo. With lots of googling i  m able to write the following code:

set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate "www.mail.yahoo.com"
objIe.Visible = true

'wait untill page gets loaded
While objIE.busy
WScript.Sleep 1000
Wend

objIE.document.getElementByID("username").value = "my_username"
objIE.document.getElementByID("passwd").value = "my_password"
 objIE.document.getElementsByName(".save")(0).click()

That's it. Copy and paste the above code. Yeah pls fill corresponding username and password fields. This code needs to be worked in the following sections:

1)Inside the if condition i m finding the username textbox through DOM selection and then filling in the appropriate fields. But this may affect if the textbox name changes.

The following are some of the links where u can find some more useful information:






January 28, 2009

CSS Tips

0 comments

The disadvantage of using table-layout is, once the entire table is loaded then only u can view it. This is a performance issue interms of user experience, for ex if u have table with hundred images, until all the images r loaded u cannot see them. Instead if u follow some other way like using div's, it might be good.


Also dont overwrite styles until unless they r explicitly required. This is because if u have color coming for a p element from two style rules then it is considered as an error in css validator checks.

Giving negative margins will mess up things in IE6.


December 22, 2008

Nullable Types in C#

0 comments

int x = 0; //valid statement
int y = null; //compile time error

This is because we know that null is a value for reference types and since int is a value type it cannot hold the value null in it. So if there comes a situation where u need to hold null value inside an int then the solution is the Nullable Type.

Any Value Type can be Nullable Type, which means that the default value can hold the possible value in its data range as well as a new value 'null' in it. The syntax for this is,

int? x = null; //valid statement; now x is a nullable type

Also dont guess that since now x can hold null value, it can be reference type. This is wrong. What Nullable Type is like a wrapper around a value type which can hold a null value also. So the value of x is stored in stack(by default).

December 18, 2008

CodeBehind Files in asp.net

0 comments

Hey Friends, check the following links to get an indepth understanding of code-behind classes for aspx pages. 

Before going to these links check ur self that in VS2008, for a website u will find CodeFile attribute in the page directive, whereas for a web application u will find CodeBehind attribute in the page directive.


December 03, 2008

Enable IE6 Toolbar

0 comments

I had the same problem with the IE toolbar (IE7 under win 2003, using it to style a Sharepoint site). A combination of the suggested solutions did the trick:


  • Tools->Internet options->Security Tab->Local Intranet->Custom Level->Run ActiveX Control or PlugIn (Administrator Mode)
  • Tools->Internet Options->Programs->Manage add-ons->IEDeveloperToolbarBHO->Enable
  • Tools->Internet Options->Advanced->Enable third party browser-extensions (requires restart)

November 07, 2008

call a WebService from Browser(javascript code)

0 comments

Following links are helpful for making a webservice request


  • http://debasishpramanik.wordpress.com/2007/08/17/calling-web-service-using-xmlhttp-object/#comment-1021


For getting Basics:

  • http://www.codeproject.com/KB/aspnet/XmlHttpWS.aspx
  • http://www.howtocreate.co.uk/tutorials/javascript/domstructure

November 03, 2008

Creating a Simple User Control

0 comments

User controls allow you to save a part of an existing ASP.NET page and reuse it in many other ASP.NET pages. A user control is almost identical to a normal .aspx page, with two differences: the user control has the .ascx extension rather than .aspx, and it may not have

<HTML>, <Body>, or <Form> tags.


The simplest user control is one that displays HTML only(.ascx file)

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="MyUserControl.WebUserControl1" %>







CopyRight 2008 Ramp Infotech, Inc.
Support at http://www.rampgroup.com


To see it work add this in the .aspx file as:
<%@ Register tagprefix="ramp" TagName="CopyRight" src="CopyRight.ascx" %>


This registers the control with our page and we can use it like