Thursday, September 04, 2008

Use overloaded web methods in web services (asmx)

In order to use the overloaded methods in the web services (asmx), two things need to be done.

1. When creating a new webservice in Visual Studio .NET 2005, the IDE automatically adds the following line on top of your serviceName.cs file:

[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

Change it to WsiProfiles.None

2. Add the MessageName in the [WebMethod(MessageName="UniqueName1"]

Wednesday, September 03, 2008

Make default button on the page

There are different ways control the page behavior when user enter the text in the text box then press the Enter key.

One way is to user the Javascript function to monitor the key pressed. If it's the enter key, then activate the submit button (the default button).

Another way is to put the page around a panel and use the "defaultbutton" property.

The best way to do this is to use the "UseSubmitBehavior" property for the button. Just make it false for buttons that not default.