Return Array from Web Service using ScriptManager & Javascript

 This is used to call the Web Service using ASP.Net and Script Manager. Must be inserted in .aspx page. 

<asp:ScriptManager runat=”server” ID=”scriptManager”>
<Services>
<asp:ServiceReference path=”WebService/TestService.asmx” />
</Services>
</asp:ScriptManager>

This is the script to call the web service method and print the result on the form: Read the rest of this entry »

Quickie | ‘Sys’ is undefined Solution

Today I was trying to call a web service from Java Script using the Sys.Net.WebServiceProxy.invoke function but the following error was loading:

‘Sys’ is undefined

The problem was because the ajax was not being referenced in the website. The solution I found was to create a new website in Visual Studio 2005 and use the AJAX Control Toolkit Web Site Template. When I ran the code again, no error was loaded and everything worked fine!

Calling Web Service From Javascript

 Hi my post explains how to call web service frm java script using AJAX.

If the web service class on the server includes a web method that does not return data, you can call the web service without having to handle a response. This is the simplest web method call that can be made from the client. For example, your application has the following web method:

Read the rest of this entry »

Return Array From WebService

Here’s the simplest way to accomplish what you want. Have your webservice return a simple string array:

[WebMethod]
public string[] getPersonIds(string Id)
{
//substitute code to actually populate the array with the dataset data
string[] personIds = {“ADS34579354″, “ASR34579354″, “TYU34579354″};
return personIds;
} Read the rest of this entry »

Disable AutoComplete in Asp.NET

Most Browsers have a feature called AutoComplete which saves information that has previously been inputted like web addresses and form data. But sometimes, you may want to disable this feature for inputs like credit card information.

ASP.NET has the ability to override the user’s choice with the autocomplete attribute by setting it to off. This can be added to a form tag or any TextBox control and can be done using one of the following two properties:

  • AutoComplete=”Off”
  • AutoCompleteType=”Disabled”

View some examples after the break…

Read the rest of this entry »

Source Control – AnkhSVN

ankhsvn

At work, we started using source control a year ago and after several packages we chose to use VisualSVN and was doing a good job until recently we started to find some problems. When trying to commit some changes, it was always asking to ‘Clean up’ the solution. Then obviously I would click on Clean up and upon doing so, another error was loading…. guess what… it’s asks me to Clean Up the solution…. and it’s never ending. It got on my nerves and today I started searching for another Source Control.

I found the AnkhSvn (don’t know how to spell it), checked some reviews and gave it a go! Till now it seems to be fantastic. It incorporates directly into Visual Studio’s Source Control (not like VisualSVN), it has a pending changes window (at the bottom of visual studio) from where you can write a message and commit with a simple step (not like VisualSVN where you have to right click the file, and choose commit… and if you’re lucky, it works)…. and the greatest feature of all is that it’s free!! For VisualSVN you’d have to pay around $50 for each user.

To use AnkhSVN for yourself, you just install a copy from here

To use AnkhSVN between multiple users, you need to install a copy on every user’s machine by downloading from here, then install VisualSVN Server (here) on the computer where you’ll store the Source Control files. Click here for a simple ‘How To’ to start using AnkhSVN. BTW… VisualSVN Server is also free so you’ll get the best of both worlds, for Free!

Till now i’m liking what i’m seeing… if I’ll find any problems… I’ll let you know. Happy controlling!! :)

For more info on:

For info on why you need to use a source control and back up, click here

Crystal Reports Problem

The following error loaded today when trying to output a crystal report from asp.Net:

Logon failed. Details: crdb_adoplus : Object reference not set to an instance of an object. Error in Filename.rpt: Unable to connect: incorrect log on parameters.

The problem was that I didn’t set the report’s DataSource. Next is the code that worked:

 

 

 

ReportDocument report = new ReportDocument();

 

 

report.Load(Server.MapPath(“Reports\\Label.rpt”));

report.SetDataSource(dset);

report.ExportToDisk(ExportFormatType.PortableDocFormat, full_path);

report.Clone();

report.Dispose();

Hope this helps someone!! :)