How to call WCF services from JavaScript jQuery and ASP.NET AJAX

First we have to create a webapplication and add to it Ajax enabled WCF service.

Change default DoWork method to accept parameter

[OperationContract]
public string DoWork(string userName)
{
[...]

Referencing JavaScript files from MasterPage

To avoid problems with pathes you can you “~” at the start of your ulr. But this works only for controls with runat=”server” attribute. You can add this attribute to head tag.

<head runat="server">

It works fine for css links

<link href="~/styles/style.css"
rel="stylesheet" type="text/css" />

But if you will try to add this attribte to scritp tag you will [...]

Building charts with Dundas Charts and SqlDataSource

Dundas has a very good Chart controls which I am using now in my project. And if you are familiar with Microsoft Charts you can easy start using Dundas charts, because Microsoft Charts based on Dundas charts.

Chart controls support SqlDataSource, and all than you need is Bind SqlDataSource to Dundas charts and tell charts what [...]

Global.asax file events for Application and Session

Global.asax file comes in ASP.NET from ASP language. This file contains events for Application and Session, and global.asax must be in the root directory of .net web application.

Below is the list of events in global.asax file you can call.

Application events in global.asax:

Application_Start: This event used to set up an application environment [...]

Oracle and SqlDataSource two way data binding

Often you have to create a simple pages for your website, for example admin pages which allow you edit tables through web. When working with Ms Sql server it’s a very easy task which you can solve with SqlDataSource and DataGrid. But using Oracle it’s difficult to make your page work without exceptions and you [...]

Eval vs Bind for ASP.NET

When you start working with ASP.NET sometimes it’s difficult to understand what is the difference between Eval and Bind for data binding controls in ASP.NET.

If you just need to display data on the screen from DataSource it’s enough to use Eval. It’s something like read-only method from DataSource.

But if you need to edit [...]

ASP.NET Health Monitor with ASP.NET 3.5

Health monitor is a system to monitor health of the application. It’s easy to add to your website and easy to use.

You can subscribe to some events occurred in the application, for example, “Error” and log it, or sent per email.

To add it you have to modify your web.config file, just add this lines of [...]

ModalPopupExtender and “Close” button

ModalPopup control from AjaxControlsToolkit has property CancelControlID which has ID of control to close modal popup. But you can use only one control to close window using this property.

If you need more controls to close the popup, you can easily add they on your page. You need to call hide() method of the control from [...]

Calling Oracle stored procedures from SQLDataSource

For some simple pages in my application I prefer to use declarative manner of programming. To display some data on the page you can use this lines of code.

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ProviderName="System.Data.OracleClient"
SelectCommand="pac_dwh.Revew_item_info.GetAppPermissionInfoExt"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:QueryStringParameter Name="p_line_id"
[...]