Posts Tagged ASP

Naggie4 Steps to Consume Web Services using Ajax

Thursday, March 4th, 2010

Normally the browser Ajax controls calls the ASP.NET code and the ASP.NET code consumes the web service, but there are scenarios where you would like to call the web services directly from the Ajax JavaScript functions rather than calling via the behind code.

Here, you can get the same following 4 steps-

Step 1: Create your Customer Class

The first step is to create the customer class as shown below. So the customer class has 4 properties on customer id, first name, address and designation.

public class Customers
{
// private properties
private int _intCustomerID;
private string _strFirstName;
private string _strAddress;
private string _strDesignation;

// Public property and
public int CustomerID
{
get
{
return _intCustomerID;
}
set
{
_intCustomerID = value;
}
}
public string FirstName
{
get
{
return _strFirstName;
}
set
{
_strFirstName = value;
}
}

public class Customers
{
// private properties
private int _intCustomerID;
private string _strFirstName;
private string _strAddress;
private string _strDesignation;
// Public property and
public int CustomerID
{
get
{
return _intCustomerID;
}
set
{
_intCustomerID = value;
}
}
public string FirstName
{
get
{
return _strFirstName;
}
set
{
_strFirstName = value;
}
}

Step 2: Create your Web Service

The next step is to create the web service which exposes the customer class to UI. Here is a simple web service which has encapsulated customer collection. In the constructor, we are loading some dummy data into the list of customers as shown in the below code snippet:

[System.Web.Script.Services.ScriptService]
public class Customer : System.Web.Services.WebService {

// Customer collection
List<Customers> listcust = new List<Customers>();
public Customer ()
{
//Load some dummy data in to customer collection.
listcust.Clear();

Customers cust = new Customers();
cust.CustomerID = 1;
cust.FirstName = “Dan”;
cust.Address = “Live in UK”;
cust.Designation = “Software Developer”;
listcust.Add(cust);

cust = new Customers();
cust.CustomerID = 2;
cust.FirstName = “Sheen”;
cust.Address = “Live in Austrailia”;
cust.Designation = “Web Designer”;
listcust.Add(cust);

cust = new Customers();
cust.CustomerID = 3;
cust.FirstName = “Koraine”;
cust.Address = “Live in London”;
cust.Designation = “Architect”;
listcust.Add(cust);
}

// This function exposes all customers to the end client’
[WebMethod]
public List<Customers> LoadCustomers()
{
return listcust;
}

// This function helps us to get customer object based in ID
[WebMethod]
public Customers LoadSingleCustomers(int _customerid)
{
return (Customers)listcust[_customerid-1];
}

Two functions have been exposed with the web service, one which gives out a list of customers and another which gives out individual customer data based on customer id.

Step 3: Reference your Web Service using the asp:servicereference

Using the ‘asp:ServiceReference’, the path to the ASMX file will be pointed as shown in the below code snippet. This will generate the JavaScript proxy which can be used to call the customer object.

<asp:ScriptManager ID="ScriptManager1" runat="server">
    <Services>
        <asp:ServiceReference Path="Customer.asmx" />
    </Services>
</asp:ScriptManager>

Step 4: Call the Webservice and the JavaScript Code

Once you have defined the proxy, you can now call the ‘Customer’ proxy directly to make method calls.

function LoadAll()
{
Customer.LoadCustomers(LoadCustomerToSelectOption, ErrorHandler, TimeOutHandler);
}

When you call the JavaScript proxy object, then you need to provide three functions; the first function (‘LoadCustomerToSelectOption’) will be called when the web service finishes and returns data. The data will be returned in the fill variable which will then be looped and added to the customer combo box.

function LoadCustomerToSelectOption(Fill)
{
var select = document.getElementById(”cmbCustomers“);

for (var i = 0; i < Fill.length; i++)
{
var value = new Option(Fill[i].FirstName, Fill[i].CustomerID);
select.options.add(value);
}
}

There are two more functions which are attached; one which handles error and the other which handles time out.

function ErrorHandler(result)
{
var msg = result.get_exceptionType() + “\r\n“;
msg += result.get_message() + “\r\n“;
msg += result.get_stackTrace();
alert(msg);
}
function TimeOutHandler(result)
{
alert(”Timeout :” + result);
}

http://www.all1martpro.com
http://get-a-designer.com

Tags: , , , , , ,
Posted in Microsoft Technology, Purely Technical | No Comments »

SuzanneHTML Tools: Haml 2.3.0

Friday, February 26th, 2010

Haml 2.3.0 is a markup language, which is used to describe the HTML of any web document easily and simply, without the use of inline code.

It is compiled into XHTML, similarly to ERB, and attempts to fix many flaws in templating engines like explicitly coding HTML into the template.

Haml itself is a description of the HTML, with code to generate dynamic content. And it functions as a replacement for inline page templating systems such as PHP, ASP, and ERB.

Example:
The #foo Hello World! line of code will output this HTML line of code: <div id=”foo”>Helo World!</div>

Automatically, Haml handled the end tag and tag defining. For CSS stylings, SASS does the same thing as Haml does for HTML. SASS is bundled with Haml by default.

Platform: Windows/ Linux/ Mac OS/ BSD/ Solaris
Language: Ruby

http://www.all1martpro.com

http://www.all1sourcetech.com

Tags: , , , , , ,
Posted in Purely Technical | No Comments »

SuzanneDell plans new line of ‘private cloud’ servers this year

Tuesday, February 9th, 2010

Dell is planning to take some of the custom servers designed by its Data Center Solutions division for Web giants like Yahoo and Facebook and sell them to a wider range of companies, including large enterprises, according to Dell executives.

About three years ago, the DCS unit was formed to help Dell get more business from large Internet firms. Its engineers often spend several weeks on-site with those companies to design low-cost, low-power systems that meet the special requirements of their search, social networking and other Web applications.

In an interview, Dell executives said that hands-on role means the DCS group designs servers only for large companies, such as Ask.com and Microsoft’s Azure division, which order tens of thousands of servers per year, but that’s about to change.

Dell will turn some of those custom servers into standardized products and sell them to companies that order lower volumes of systems later this year, including enterprises building “private cloud” environments in their data centers, and a second tier of smaller Internet companies. They will likely be sold under a new brand, CloudEdge.

Andy Rhodes, a director with Dell’s DCS group, said “What we’ve found is, there are a whole bunch of other customers who want access to those designs but who are not buying in those types of quantities”. “So the big thing we’re solving now, and we’ll talk more publicly about over the next couple of months, is how to provide more of that capability to many, many more customers.”

Dell isn’t discussing specific products yet and is still working out details, such as whether the servers will be sold by DCS or through Dell’s standard server channels. But the goal is to offer the designs to a wider market, even while DCS continues to do custom work for very large customers..

DCS aims to build highly energy-efficient servers that pack a lot of computing power into a small space. The systems often forego redundant power supplies and fans, for example, which saves on component costs and energy bills.

That also makes the servers less resilient to failure — a trade-off large Internet companies are willing to make for lower operational costs. Companies like Google and Yahoo design their Web applications to run on such “fail in place” architectures, so that workloads are rerouted around failed servers with little or no disruption to services.

According to Barton George, cloud evangelist for Dell, the main thing with these hyperscale systems is that the availability and resiliency are baked into the customers’ applications rather than into the hardware.

Tags: , , , , , , , , , , ,
Posted in Opensource, Technical News | No Comments »

NaggieMoonlight 3.0 preview offered for rich Internet apps

Monday, February 8th, 2010

Moonlight 3.0 that puts Microsoft’s Silverlight rich Internet plug-in software on Linux and UNIX platforms is now being offered in an alpha release, according to Web pages from the Mono project, which has jurisdiction over Moonlight.

Silverlight Moonlight 3.0 preview offered for rich Internet apps

Novell, which sponsors Mono, said the release features infrastructural capabilities designed to move Moonlight closer to the capabilities of Silverlight 3.

Novell VP Miguel de Icaza, who has been in charge of Moonlight and Mono projects, described the release as the first preview of Moonlight 3.0 in a blog posted this week.

Capabilities include MP4 demuxer support, although there are no codecs for it yet unless a developer builds them from source code and configures Moonlight to pick up codecs from ffmpeg.

Also featured is initial work on UI virtualization and a platform abstraction layer. The Moonlight core is now separated from the windowing system engine. This should make it possible for developers to port Moonlight that are not X11/Gtk+-centric, according to de Icaza.

The alpha release features 3.0 Binding/Binding Expression support and updates to APIs. An SVN (Subversion) of Silverlight 3.0 offers pixel shader support from developer David Reveman.

A beta version of Moonlight 3.0 is due this summer, followed by a final release in the fall, according to Novell. A download page for Moonlight 3.0 stresses that the project is only in an alpha stage and offers caution.

According to the page, this release should be considered alpha quality. There are various new subsystems in Silverlight 3 which expose new and different attack vectors, and the implementations of these subsystems have not yet been exercised or audited.

The page recommends that one should use this plugin on trusted sites on non-production computers. This situation will gradually evolve over the beta releases. According to the page, an up- to-date overview of Moonlight security features status can be found on Moonlight Security Status wiki page.

Tags: , , , , , , , , ,
Posted in New Product Release, Technical News | No Comments »

ShwetaIntel Pushes out VPro for Core I5, I7 Processors

Monday, February 8th, 2010

On Thursday, Intel announced a new vPro platform for its Core processors to make remote maintenance and management of PCs easier in an enterprise.

With vPro technology, Laptops and desktops enable IT administrators to use hardware-based technologies to manage and secure PCs through a wired or wireless network. The new vPro technologies will be in systems with Intel’s Core i5 and Core i7 processors, which were announced earlier this year, Intel executives said during a webcast on Thursday.
intel logo 2009,E U 194934 3 Intel Pushes out VPro for Core I5, I7 Processors

The vPro platform includes new hardware, which can solve a larger number of problems than prior vPro platforms. The technologies could help reduce support costs and the number of support visits to desktops, said Rick Echevarria, vice president of the Intel architecture group.

For example, a technology called Anti-Theft 2.0 uses software and hardware technology to remotely disable systems and lock access to data if a PC falls into wrong hands. A message can also be designed for disabled PCs that will be displayed after boot. This feature will be especially important to secure data on laptops, which can get easily stolen. The technology can also enable a disabled laptop remotely.

The new platform also includes technology called Keyboard-Video-Mouse Remote Control (KVM Remote Control), which gives support personnel better control of PCs remotely. Intel has introduced new hardware to enable the KVM capability, which helps establish a stable connection to remote PCs, Echevarria said. System administrators get pre-boot access to systems, which help solve a larger set of problems including disk and operating system failure.

Users will need to agree to start a KVM session with support personnel in order to maintain privacy, according to Echevarria. Built-in KVM technology also helps cut costs as it reduces the need for a KVM switch or software usually needed to enable such functionality.

As part of vPro, the new Core i5 and Core i7 chips will take advantage of a new instruction called Advanced Encryption Standard (AES) for faster data encryption and decryption. That could help secure data residing in servers or virtualized environments.

During the webcast, Brad Anderson, corporate vice president of Microsoft’s server division, said Intel has worked with Microsoft to enable vPro features on Windows 7. The platform enables Windows 7 to do things in System Center that previously required a desk-side visit from support, including remotely awakening and troubleshooting PCs.

The latest vPro platform based systems will include Intel’s Q57 Express chipset. Close to 500 hardware and software vendors will take advantage of the latest vPro technology. PC makers including Hewlett-Packard, Dell and Lenovo will be releasing systems based on the platform, according to Intel.

The company declined comment on whether the new platform will support systems with Advanced Micro Devices processors. But Echevarria said that there are scenarios that Intel has enabled with vPro that utilize specific Intel-developed technologies. For example, the new AES instructions are found only in Intel’s new Core processors, and do not apply to platforms that don’t include support for those instructions.

Advanced Micro Devices offers competitive tools to compete with vPro. It offers a tool to remotely fix PCs based on DASH (Desktop and Mobile Architecture for System Hardware), a suite of specifications set by Distributed Management Task Force for remote management of laptops and desktops.

Intel’s Core vPro processor technology supports standards such as DASH, Echevarria said in an e-mail. “Intel is a contributor to the specifications from the DMTF. Remember that standards are necessary, but not always sufficient,” he said.

Tags: , , , , , , , , , ,
Posted in New Product Release, Technical News | No Comments »

NaggieDownload ASP.NET MVC 2 RC 2

Saturday, February 6th, 2010

ASP.NET MVC 2 RC 2 provides a new Model-View-Controller (MVC) framework on top of the existing ASP.NET 3.5 SP1 runtime.

ASP.NET MVC 2 is a framework for developing highly testable and maintainable Web applications by leveraging the Model-View-Controller (MVC) pattern. The framework encourages developers to maintain a clear separation of concerns among the responsibilities of the application – the UI logic using the view, user-input handling using the controller, and the domain logic using the model. ASP.NET MVC applications are easily testable using techniques such as test-driven development (TDD).

The installation package includes templates and tools for Visual Studio 2008 SP 1 to increase productivity when writing ASP.NET MVC applications. For example, the Add View dialog box takes advantage of customizable code generation (T4) templates to generate a view based on a model object. The default project template allows the developer to automatically hook up a unit-test project that is associated with the ASP.NET MVC application.

Because the ASP.NET MVC framework is built on ASP.NET 3.5 SP 1, developers can take advantage of existing ASP.NET features like authentication and authorization, profile settings, localization, and so on.

System Requirements

-Supported Operating Systems: Windows 7; Windows Server 2003; Windows Server 2008; Windows Vista; Windows XP

.NET 3.5 SP1. Visual Studio 2008, Visual Studio 2008 SP1 or Visual Web Developer 2008 SP1 are required to use certain parts of this feature.

http://get-a-designer.com

http://www.all1sourcetech.com

Tags: , , , , , , , ,
Posted in Microsoft Technology, New Product Release, Technical News | No Comments »

NaggieFacebook gets more Bing — and control of display ads

Saturday, February 6th, 2010

 Facebook gets more Bing    and control of display ads

On Friday, Microsoft said Bing will power Internet searches for Facebook’s 400 million members in an arrangement that returns control of display advertising to the social-networking service.

Previously, Bing had powered online searches on US Facebook pages.

According to Bing general manager Jon Tinter, Microsoft will provide Facebook users full access to Bing features as part of an “expanded cooperation in search”. You will start to see the fruits of our expanded relationship show up in the Facebook experience over the weeks and months ahead, he said.

According to Tinter, the companies mutually agreed that Facebook will take over selling display advertising posted at the website because it “just made more sense” given the unique nature of the website.

The control over the displaying advertisement by Microsoft served up at Facebook stretched back to shortly before the US software giant bought a 1.6-percent stake in Facebook in 2007 for 240 million dollars.

The arrangement was inked in a contract, which was up for renewal.

Last year, Microsoft launched its new Bing search engine.

http://www.all1martpro.com

http://get-a-designer.com

Tags: , , , , , , , , , , ,
Posted in Opensource, Technical News | No Comments »

NaggieVideogame star “Fallout 3″ heading for Sin City

Friday, February 5th, 2010

 Videogame star Fallout 3 heading for Sin City

Videogame star “Fallout 3” is taking its devoted fans to nuclear war ravaged Las Vegas. Bethesda Softworks announced Thursday that a “New Vegas” chapter in the award-winning franchise will be available by the end of this year. A video trailer has been posted online by the studio at fallout.bethsoft.com.

According to Bethesda, ‘Fallout: New Vegas’ takes all the action, humor, and post-apocalyptic grime and grit of this legendary series, and raises the stakes.

After the release of “Fallout 3” in 2008, it was crowned Game of the Year, and proved so popular that Bethesda has expanded on it with adventures in an array of downloadable software.

A “Broken Steel” addition to “Fallout 3″ even modified the end of the original game to resurrect the hero, who had sacrificed himself for the sake of other survivors in the post nuclear war scenario.

“Fallout 3″ players start out as a youth venturing out of an underground survival bunker to search for a scientist father and make moral choices shaping his or her destiny.

Players take on quests such as freeing slaves, rescuing hostages, and integrating an elitist survivor settlement.

Conversations players have with in-world characters affect directions stories take, with choices regarding whether to do good or evil determining their reputations, opportunities and allies.

Tags: , , , , , , , , , ,
Posted in Opensource, Technical News | No Comments »

NaggieAndroid apps for business users

Thursday, February 4th, 2010

In businesses today, the Blackberry may be the most popular phone, but the openness of the Google Android platform is attractive too. Most of the big-name apps from the iPhone world are now available for the Android. And because the Android’s Web browser is based on the same WebKit rendering engine the iPhone uses, Web apps built for the iPhone will likely require minimal changes to work on Android devices.

Programmers enjoy the freedom offered by Google’s looser reins, and this will make life much easier for any business that adopts the platform. The Android operating system and marketplace are both pretty open, something that makes life much easier for the IT departments that support the phone. Distributing an app to all internal clients, consultants, and customers is much simpler without the tight strictures of the iPhone world.

Nowhere, the Android Market is near as deep as the iPhone’s App Store, and it shows when you browse through the apps. But the lack of depth isn’t as important to a business user as it might be to the casual consumer or gamer. Many of the dumb apps filled with scantily clad models aren’t available for Android yet, and those are a surprisingly large slice of the iPhone marketplace.

Even though the market for Android apps is still emerging, there are a number of good apps for business users. Take InfoWorld’s quick, at-a-glance tour of 10 Android apps for business users that help you find where you’re going, track your expenses and exchange rates, overcome language barriers, view and edit Office documents, and connect remotely to a company database or your desktop PC.

This story, “Android apps for business users,” was originally published at InfoWorld.com. Follow the latest developments on mobile computing and Google Android at InfoWorld.com.

http://get-a-designer.com

http://www.all1sourcetech.com

Tags: , , , , , , , ,
Posted in Technical News | No Comments »

NaggieHack Brings Mac OS X to the Nokia N900

Wednesday, February 3rd, 2010

Have you ever thought of running a full-blown copy of Mac OS X on your mobile device? One hacker has managed to get Apple’s operating system running on a smartphone, and it’s not the iPhone.

In this case, Finnish geek Toni Nikkanen has become the first person to successfully run Mac OS X–, Mac OS X 10.3 “Panther”(released in 2003)–on a cell phone. The phone he managed to achieve this feat with – Nokia’s N900 smartphone. Sadly the hack, which makes use of PowerPC emulator Pear PC, runs incredibly slowly.

Some bloggers had suggested that the iPad might finally deliver a more full Mac OS X mobile experience. However, this was not to be, as last week’s unveiling revealed that Apple’s tablet will run a variant of the iPhone’s operating system, multi-tasking limitations included.

If you have a few hours to spare–and you don’t mind stepping into a legal gray area by breaking Mac OS X’s end-user license agreement–check out Nikkanen’s blog for more information.

http://www.all1martpro.com

http://get-a-designer.com

Tags: , , , , , , , ,
Posted in Technical News | No Comments »