Posts

Showing posts with the label JavaScript

Video Recordings of Our Latest Event

Here are the links for the sessions recordings for our last community event that was held in Khobar: - Introduction to SQL Server Integration Services (SSIS) - Windows 8 Development Jumpstart - Kinect Development

DevLifeStyle March 2012 Event: Sessions Recordings

Here are the sessions recordings for our last event Building High Performance Applications with .NET 4.5: Part1 , Part2 Kinect for Windows Developing Applications for Windows 8

Consuming Services from Client Side JavaScript (Part I)

Many frameworks allow you to easily call a server side service from JavaScript directly, services are called asynchronously from JavaScript so when you call any service method from JavaScript you can supply two extra parameters to the method in addition to the original method parameters, the first one is the name of a javascript function that will be called once the result of the service method is received, and the second one will be called incase an error happened on the server. In this post i will explore the options available to consume a service from client side JavaScript. - Calling a page method: ASP.NET AJAX allows you to call public static methods available on your aspx page directly from JavaScript, you have to mark these methods with the [WebMethod] attribute and set the EnablePageMethods property of the script manager control to true. the following example demonstrates this //Default.aspx.cs [System.Web.Services.WebMethod] public static string GetTemprature( string city...

Accessing the Properties of a Web User Control from JavaScript

I ran into this situation where I have a web user control (*.ascx file), in this control I defined some properties that will control the appearance and the logic of the user control public partial class WebUserControl : System.Web.UI.UserControl { protected void Page_Load( object sender, EventArgs e) { } public string Address { get; set; } } I wanted to be able access this property from JavaScript from the web page that hosts the user control like this document.getElementById( '<%=WebUserControl1.ClientID %>' ).Address My idea is as follows: - Add a hidden input control to the user control - Override the ClientID property of the user control to return the ClientID of the hidden input, so when you write the following JavaScript in the page hosting the user control document.getElementById( '<%=WebUserControl1.ClientID %>' ).Address what will happen is that you will set the value of an attribute on the hidden input this wi...