Monday, September 7, 2009

ExtJS Grid does not work with asp.net mvc

ExtJS Grid does not work with asp.net mvc

Hello, I still need your help, and more specifically the implementation of the ExtJS grid.
I can not make it work.
I have a View that makes a search with more parameters, then the controller will have the action research that when loading the page I set the controls of the latter, and then I post the action through which I search. This is the code:

[Authorize (Roles = "OP_Bollettino")]
[AcceptVerbs (HttpVerbs.Get)]
Search public ActionResult ()
(



Viewdata [ "checksurname"] = "false";
abilitatosur.Add ( "Disabled" "Disabled");
Viewdata [ "abilitasur"] = abilitatosur;
Viewdata [ "checkcf"] = "false";
abilitatocf.Add ( "Disabled" "Disabled");
Viewdata [ "abilitacf"] = abilitatocf;
abilitatocaus.Add ( "Disabled" "Disabled");
Viewdata [ "checkcausale"] = "false";
Viewdata [ "abilitacaus"] = abilitatocaus;
Viewdata [ "selection"] = "Select";
string EndDate = null;
string StartDate = null;
DataFire DateTime.Now.Date.AddDays = (-30);
EndDate = dataf.ToShortDateString ();
data = DateTime.Now.Date;
StartDate = datai.ToShortDateString ();
Viewdata [ "StartDate"] = EndDate;
Viewdata [ "EndDate"] = StartDate;
Viewdata [ "Cause"] = causale.GetListaCausaleDropDown ();



return View ( "Search");


)
/ / /
/ / / Implementation of research, and more precisely when the operator clicking on the button passes the parameters
/ / / Will be used to build the Linq query and return the results in the grid.
/ / /
/ / /
/ / /
/ / /
/ / /
/ / /
/ / /
[Authorize (Roles = "OP_Bollettino")]
[AcceptVerbs (HttpVerbs.Post)]
[LogError]
public JsonResult Research (FormCollection formcoll)
(

DateTime date = DateTime.Now.Date.AddDays (-30);
data.ToShortDateString EndDate = string ();
data.Date.ToShortDateString ();
string StartDate = DateTime.Now.Date.ToShortDateString ();

date = DateTime.Parse (Request.Form [ "StartDate"]. ToString (). Trim ());

DataFire = DateTime.Parse (Request.Form [ "EndDate"]. ToString (). Trim ());
Viewdata [ "StartDate"] = datai.ToShortDateString ();
Viewdata [ "EndDate"] = dataf.ToShortDateString ();
TRY
(


var search = utente.GetBollettinoBySearch (null, 0, date, DataFire, null);




if (String.IsNullOrEmpty (Request.Form [ "Surname"]))
(
Viewdata [ "checksurname"] = true;
abilitatosur.Add ( "enabled", "enabled");
Viewdata [ "abilitasur"] = abilitatosur;
Viewdata [ "cog"] = Request.Form [ "Surname"]. Trim (). ("''", Replace "");
name = Request.Form [ "Surname"]. Trim (). ("''", Replace "");
utente.GetBollettinoBySearch search = (name, 0, date, DataFire, null);

)
else
(
Viewdata [ "checksurname"] = "false";
abilitatosur.Add ( "Disabled" "Disabled");
Viewdata [ "abilitasur"] = abilitatosur;

)



if (String.IsNullOrEmpty (Request.Form [ "Cause"]))
(

Viewdata [ "checkcausale"] = "true";
abilitatocaus.Add ( "enabled", "enabled");
Viewdata [ "abilitacaus"] = abilitatocaus;
Viewdata [ "selection"] = "Select";
id_causale string = Request.Form [ "Cause"];

utente.GetBollettinoBySearch search = (null, int.Parse (id_causale), date, DataFire, null);
var selectcasuale = causale.GetListaCausaleDropDown (). ToList ();
Viewdata [ "Reason"] = new SelectList (selectcasuale.ToList (), "Value", "Text", id_causale), / / new MultiSelectList (causale.GetListaCausaleDropDown (), "Value", "Text", selected);

)
else
(
abilitatocaus.Add ( "Disabled" "Disabled");
Viewdata [ "checkcausale"] = "false";
Viewdata [ "abilitacaus"] = abilitatocaus;
Viewdata [ "selection"] = "Select";
var selectcausale = causale.GetListaCausaleDropDown (). ToList ();
Viewdata [ "Reason"] = new SelectList (selectcausale.ToList (), "Value", "Text", 0);
)

if (String.IsNullOrEmpty (Request.Form [ "codiceF"]))
(
abilitatocf.Add ( "enabled", "enabled");
Viewdata [ "abilitacf"] = abilitatocf;
Viewdata [ "checkcf"] = true;
Viewdata [ "cf"] = Request.Form [ "codiceF"]. Trim (). ("''", Replace "");
cf = Request.Form [ "codiceF"]. Trim (). ("''", Replace "");
utente.GetBollettinoBySearch search = (null, 0, date, DataFire, cf); / / res.WithCf (cf);
)
else
(
Viewdata [ "checkcf"] = "false";
abilitatocf.Add ( "Disabled" "Disabled");
Viewdata [ "abilitacf"] = abilitatocf;

)



return JSON (datastore = new (search));



)

catch (Exception ex)
(
Utilita.LogError (ex);

return JSON ( "Search");
)


)


I have tested a JavaScript debugger and load the page when I enter the debug extjs grid, even though I click the search button to search back to me the contents of the query in notepad format and I do not even enter into debbugger javascript.

I can help you understand why, I tried it with several examples of extjs but does not work.

Thanks


View Full Details...............................

Pass Regular Expression from view to controller

Hello, i have this problem on my asp.net mvc website (in c#) and i don't know how to solve it.

My web app has one aspx wich the user can create a field to be used later, such an input textbox, drop down list, radiobutton, etc. But in this field, the user can add to it a regular expression to validate the field later. My problem is that i cant pass the regular expression text from view to controller without losing text, and this is because the complexity of a regular expression. I try with encoreUri and encodeElement, but it didn't work. I have to tell that the text of the regular expression that i am passing is with a $.post() of the jquery library.

I hope that you can help me with this problem.

Thanks.

View Full Details...............................

IgnoreRoute

I start looking at MVC framework and trying to learn from ASP.NET/ MVC page. I started with Routing overview and alomost understant the logic. one point that I have issue with is IgnoreRoute property. I have the last version of MVC and in my MVC Project template' global.asax.cs' method RegisterRoutes(RouteCollection routes) i try to follow the tutorial and added ;

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");, but the IgnoreRoute is not a method of RouteCollection. Am i missing something , or is part of the new version
Thanks in advance.

View Full Details...............................

Accessing and Saving a set of fields from a webform

Hello everyone,



I have a set of fields in my webform I want to save/update. Its an overview of categories and prices - so the form represents a couple of datasets an I want to update/save them all at once. One row contains the ID - if not a new dataset, a 2 category ids and a price.

When I try to access them via FormCollection I get all the fields together in one String - what would be ok if there would not be prices. So for example I get the prices returned like 13,30,23,10,50,60. I could split them but as I don't know if the returned values were entered as 13,30 and 23 or 13 and 30,23 thats not really possible.

I think there must be an easy way to do that - maybe someone could help me how to access the data in the right way.

Thanks for your help!



Best regards,

Florian

View Full Details...............................

Parameter for AjaxOptions OnBegin callback ?

Hello,

I'm using asp.net mvc v 1.0 and wondering how I could write the AjaxOptions block so as to pass a parameter to the OnBegin callback. I write relevant code at bottom.

I tested "Test('hello')" but this prevented the ajax call to correctly update the target area (response opened in a new page).

However, when I look at the arguments passed to the callback, I find some, and just miss the correct documentation page. Could someone point me out to it please ? Argument $4 is the JQuery (it seems) object that will be updated by the ajax call. I can do with it, but will it remain in 4th position ? So I need to grab the correct information.

Here are the callback parameters when looking at it with Firebug :

Object $3=Object $4=tbody#d1.tbody_nav $0=0

Here is my code :

------------

string lien = Ajax.ActionLink(nomAffiche, "Lire",
new
{
(skip some request parameters here)
},
new AjaxOptions {
UpdateTargetId = "d1",
HttpMethod = "post",
LoadingElementId = "chargement_d1",
OnBegin = "Test"
},
(skip some html attributes here)
);

----------

function Test(chaine) {
alert('test' + chaine);
}

-------------

Thanks,

Barbara

View Full Details...............................

Model binding to object index

Model binding to object index

A view displays a list of customer details and inserts an index into each id.. like this customer[0].name, customer[1].name, customer[0].phone, customer[1].phone and so on. Also each of these can be posted to an action that has a customer parameter. The model binder is nt working correctly, i assume bcoz of the index customer[0].. Can the deafult model binder do this?

View Full Details...............................

MVC Local Date Input Formatting

MVC Local Date Input Formatting

I've got an MVC app I'm writing that has several input dates in it. Obviously these may be submitted in different formats, depending on the users localisation detail so I need to convert these on the POST method prior to using the UpdateModel method to fire the results through to the data object and its validation code. I believe I should use a custom model binder for this, correct? If so, do I have to create a model binder for each field (they may not all be present on any particular form submission) or can I create one that will apply to all the different field names? Are there any good articles on doing this that anyone knows about (I would have thought this would be a common issue, but I am struggling to find an article that addresses it well).

Cheers

MH

View Full Details...............................

Skip Validation in MVC 2 preview 1

Hi,

is there a way to skip validation in ASP.NET MVC 2 Preview 1 or to use validation-groups?

Regards,

Manfred

View Full Details...............................

Thursday, September 3, 2009

Build an AJAX-Enabled Content Management System with Visual WebGUI: Creating a Prototype

Build an AJAX-Enabled Content Management System with Visual WebGUI: Creating a Prototype
T
he web offers a way to share incredible amounts of information; however—even within a single organization—as the amount of content grows, it became more and more difficult to manage and organize.

All this explosion of information (useful content) requires software systems capable of organizing and managing this content by letting the users themselves organize it in meaningful and useful ways, and make it available to the appropriate users. The applications intended for this purpose are called Content Management Systems (CMSs).

CMSs are numerous, popular, and widespread today. Most are integrated systems that offer a portal—based architecture, allowing integration not only of content-management-specific modules, but also various other modules such as like chat rooms, forums, wikis, shopping charts and other e-commerce functionality. While all this functionality can be beneficial in large organizations, smaller organizations, which need only basic systems for organizing their own documents and providing appropriate access rights to their employees and selected partners, such comprehensive systems can be overkill.

A recent customer of mine began the quest for a CMS by reviewing various full-featured CMS systems (such as DotNetNuke, Joomla and phpNuke). He liked their overall functionality, but thought the complexity of the admin modules was prohibitive. So he asked me to design and implement a custom application that had just the functionality he needed.

Develop Provider-Based Features for Your Applications

Develop Provider-Based Features for Your Applications


The ASP.NET Provider Model drives many features within the ASP.NET architecture, yet most developers associate it only with security or membership-related functionality. This article takes you deep into the provider model, so you can see how it's used in a security context. Then it shows you how you to use it to turn any feature in your application into an extensible and swappable component. In fact, I'll even show you why calling it the 'ASP.NET' Provider Model may be a misnomer.

Back when Microsoft released ASP.NET 2.0 (remember those days?), Microsoft rewrote several areas of functionality using a pattern that has become known as the Provider Model. Some of the features existed back in ASP.NET 1.x, others, such as security, were new to the platform. The important aspect is that each of these areas of functionality benefited from something that I find developers often take for granted—the ability to extend and swap functionality when the situation calls for it.

View Full Details...............................

Using Microsoft Dynamics CRM 4.0 as a Development Platform

Using Microsoft Dynamics CRM 4.0 as a Development Platform

Microsoft Dynamics CRM 4.0 (MS CRM) exposes a set of SOAP-based APIs that provide access to the core CRM data model and business objects so developers can leverage existing MS CRM functionality in their custom CRM solutions. The services support both object-based and role-based security, which allows the core model to be exposed in a secure fashion.

The following web services are exposed by the Microsoft Dynamics CRM 4.0 SDK:

  • CRM Discovery Service. A single instance of MS CRM server can host multiple organizations and each organization has a CRM Service associated with it. This service helps you identify the CRM Service endpoint for your organization.
  • CRM Service. This is the primary MS CRM service that is used to access CRM entity instances. The CRM Service methods also support offline function.
  • CRM Metadata Service. This service allows access to the CRM entity, attribute and relationship definitions of your organization.
View Full Details...............................

Building ASP.NET Applications with Delphi and Advantage Database Server

Building ASP.NET Applications with Delphi and Advantage Database Server

Like Delphi's other development platforms, Delphi for .NET offers a wide range of data access options for ASP.NET developers. These include support for the generic foundation class library (FCL) data access classes (ODBC and OleDb), dbExpress drivers, BDP for .NET providers, as well as support for all third-party solutions that support the ADO.NET data provider interface. (ADO.NET is the portion of the .NET FCL that applies to data access, storage, and manipulation.)

Fortunately, the choice of data provider for ASP.NET development is often uncomplicated. In most cases, you should use the data provider supplied by the publisher of the database. For Advantage, this is Advantage Data Provider for .NET, which from this point forward, I'll simply refer to as the Advantage Data Provider.

Because of the special capabilities of the Advantage Database Server itself, the Advantage Data Provider supports features unheard of in most other data providers. But there is a problem. You cannot begin a web page by dragging and dropping the Advantage Data Provider from Delphi's Data Explorer. Since Delphi's help tends to emphasize this approach, Advantage developers sometimes don't know where to begin.

Ideally, you should have a class, or set of classes—independent of the web pages on which their data is displayed—that perform data access.




View Full Details...............................

What's New in ASP.NET 3.5?

What's New in ASP.NET 3.5?

M icrosoft released Visual Studio 2008 and .NET 3.5 in November 2007. I have good news and, depending on your perspective, I have either bad news or good news. If you were hoping ASP.NET 3.5 would be released with a variety of new controls, features, and architectural changes then I have bad news for you. If you're still trying to master all the controls, features, best practices, project structures, deployment options, and architectural changes introduced when ASP.NET went from version 1.1 to 2.0, I have good news for you. Don't get me wrong, there are plenty of new things you will want to take advantage of in ASP.NET 3.5, but the changes from ASP.NET 2.0 to ASP.NET 3.5 are more additive and incremental than monumental.

Even if you are not ready to upgrade your existing ASP.NET 2.0 applications to ASP.NET 3.5, you will want to upgrade to Visual Studio 2008 because of all its Web development-friendly new features, including full support for ASP.NET 2.0 development. Yes, you read that correctly; you can maintain and improve your ASP.NET 2.0 applications with Visual Studio 2008.

I'll describe the changes in ASP.NET 3.5 as one of two categories: ASP.NET 3.5 specific features (new controls, for example) and ASP.NET-related Visual Studio 2008 enhancements such as nested master page support.


View Full Details...............................

Using Microsoft's Chart Controls In An ASP.NET Application: Plotting Chart Data

Using Microsoft's Chart Controls In An ASP.NET Application: Plotting Chart Data

Plotting Chart Data Point By Point
The most straightforward way to get your data onto a chart is to specify the data point by point. Each series in a chart has a Points collection that specifies the data points to plot for that series. As we saw in the previous installment, the Points collection data may be specified statically via the section in the Chart Web control's declarative markup. The values for this collection can also be defined programmatically via the Points collection's AddXY method.

The following example shows how to specify chart data point by point by displaying a chart that shows the total number of sales per day of week for a fictional online retailer. (The complete code for this example, as well as all of the other demos in this article series, are available for download at the end of this article.) The data is shown in a three-dimensional area chart using the Earth Tones palette. This information - the chart type, the instructions to render the chart as a 3D chart, and the palette choice - are all configured in the Chart control's declaratively syntax:












View Full Details...............................

An Extensive Examination of LINQ: Grouping and Joining Data

An Extensive Examination of LINQ: Grouping and Joining Data

Introduction
As discussed in An Introduction to LINQ, one of the cornerstones of LINQ is the standard query operators, which are a set of extension methods on the IEnumerable interface added to the .NET Framework version 3.5. The standard query operators can be applied to any enumeration - any collection of "things." In The Standard Query Operators installment we looked at some of the more common query operators, such as Where, Select, OrderBy, and others. Each standard query operator can be classified as a certain type of operator. There are aggregation operators like Count, Sum, and Max; element operators like First, Last, and ElementAt let you pick out a specific element from a sequence; and the ordering operators OrderBy and OrderByDescending order the elements of a sequence based on a specified sorting criteria.

Another class of query operators that we've yet to explore are grouping and joining operators. The grouping and joining operators work with two (or more) sequences and combine them together, much like how a JOIN in SQL combines records from two (or more) tables into a single resultset. Through LINQ's standard query operators (or via its query syntax), it is possible to perform: nested (or grouped) queries; cross joins, or the Cartesian product of two sequences; inner joins; and left outer joins.

Examining the Sample Data
The examples in this article look at how to create LINQ queries that group and join the same set of sample data. If you download the demos (available at the end of this article) you'll find a class file named FauxNorthwind.cs in the App_Code/CSCode folder. This file defines a namespace (FauxNorthwind) and three classes within that namespace. The first two, Category and Product, mimic the schema of the Category and Product tables in the Northwind database. The Category class has CategoryId and CategoryName properties, while the Product class has the properties ProductId, ProductName, Category, UnitPrice, and Discontinued.

public class Category
{
public int CategoryId { get; set; }
public string CategoryName { get; set; }
}

public class Product
{
public int ProductId { get; set; }
public string ProductName { get; set; }
public Category Category { get; set; }
public decimal? UnitPrice { get; set; }
public bool Discontinued { get; set; }
}




View Full Details...............................

Exception Handling Advice for ASP.NET Web Applications

Exception Handling Advice for ASP.NET Web Applications

First Things First: Create a Custom Error Page
Whenever an unhandled exception occurs, the ASP.NET runtime displays its configured error page. (An unhandled exception is an exception that is not caught and handled by some method in the call stack when the exception is raised. If no method in the call stack catches the exception then it percolates all the way up to the ASP.NET runtime, which then displays the error page.)

The error page displayed by the ASP.NET runtime depends on two factors:

  • Whether the website is being visited locally or remotely, and
  • The configuration in Web.config.
ASP.NET's default error page is affectionately referred to as the Yellow Screen of Death. The screen shot on the right shows the default Yellow Screen of Death error page shown when an unhandled exception occurs for a remote visitor. When visiting locally, the Yellow Screen of Death page includes additional information about the exception that was raised.

While the Yellow Screen of Death error page is acceptable in the development environment, displaying such an error page in production to real users smacks of an unprofessional website. Instead, your ASP.NET application should use a custom error page. A custom error page is a user-friendly error page that you create in your project. Unlike the Yellow Screen of Death error page, a custom error page can match the look and feel of your existing website and explain to the user that there was a problem and provide suggestions or steps for the user to take.

Range-Specific Requests in ASP.NET

Range-Specific Requests in ASP.NET

Introduction

The HTTP protocol defines the syntax and semantics of how a client, such as a browser, issues a request and how a web server returns the requested content. Typically, a client requests the entire contents of a file, which the web server returns in its response. Alternatively, a client may request a particular range of a file or even a particular set of ranges. Such range requests allow for a client to resume an interrupted download. For example, imagine that while downloading a very large file your browser crashes, or you lose your Internet connection. Once the browser is restarted or Internet connectivity is restored, the browser can request the large file starting just beyond the last-downloaded byte rather than having to download the entire file from the beginning. Range requests are also used by certain mobile devices. Apple's media player on the iPhone and iPod Touch use range requests to download video files.

Web servers such as IIS have long supported range-specific requests. Therefore, if you are serving videos, ZIP files, or other large files using IIS, then your visitors automatically get the benefits of range requests, which include the ability to pause downloads, resume interrupted downloads, and view videos on Apple's devices. But what about ASP.NET? Websites that impose limits as to who can download content, or websites that dynamically generate downloadable content, typically do so through an ASP.NET web page or HTTP Handler. Unfortunately, ASP.NET does not support range-specific requests out of the box.

The good news is that with a fair amount of code it is possible to build in support for range-specific HTTP requests. This article provides an overview of how range-specific HTTP requests work and then shows how to implement support for such requests in ASP.NET through the use of an HTTP Handler. This HTTP Handler, along with a working demo application, is available for download.

View Full Details...............................



sing Microsoft's Chart Controls In An ASP.NET Application: Rendering the Chart

sing Microsoft's Chart Controls In An ASP.NET Application: Rendering the Chart

Introduction
The Microsoft Chart Controls provide ASP.NET developers with an API and a Web control for creating and displaying charts in a web page. Behind the scenes, the Microsoft Chart Controls take the data to be plotted and dynamically generates an image. This image can be generated using one of three techniques: the Chart Web control can generate the image and save it to the web server's file system in a specified location; the Chart control can generate the image and store it in memory, session, or elsewhere, and have that image served by a built-in HTTP Handler, ChartHttpHandler; or the Chart control can send back the binary contents of the chart image directly to the browser. The chart image can be rendered using one of four image types: PNG, JPG, BMP, or EMF. And when rendering a JPG you can specify its compression level.

Regardless of the image file type and the technique used to generate the image, the Chart Web control renders an element whose src attribute references the image (or the image-producing HTTP Handler or ASP.NET page). When a browser requests a web page with a Chart control on it, it receives this element as part of the page's rendered markup and then makes a request to the URL specified in the src attribute (just like it does for any other image on a web page). The chart image file the browser requests either already exists in which case its contents are returned, or the image is dynamically-generated. Either way, the end result is that the browser is sent back the chart as an image file, which is displays.

This article explores the three different techniques the Microsoft Chart Controls has at its disposal for generating chart images. We'll look at how to use each option, enumerate the pros and cons, and discuss when to consider using one option over another. Read on to learn more!


Generating And Serving Static Images
The simplest and most straightforward manner for generating the chart images is to have the Chart Web control itself create and save the chart image to the web server's file system whenever a page is requested. In short, whenever a page with a Chart control is requested, the Chart control takes the data to be plotted and generates an image of the appropriate image type (PNG, JPG, etc.). It then saves this image in a specified folder and renders an element whose src attribute points to the just-created image.

The two key Chart control properties that dictate how the chart image is rendered are ImageStorageMode and ImageLocation. To have the chart images rendered as a static file on the web server's file system, set the ImageStorageMode property to UseImageLocation and the ImageLocation property to the file name and folder name where you want the images stored.

The following snippet shows how to create a Chart control that saves the generated chart image to a specific file on the file system, ~/Images/Chart.png. This location is specified via the ImageLocation property.

ImageLocation="~/Images/Chart"
ImageStorageMode="UseImageLocation"
ImageType="Png"
>
...


View Full Details...............................

Four Little Known, Helpful Methods, Properties, and Features for ASP.NET Developers

Four Little Known, Helpful Methods, Properties, and Features for ASP.NET Developers

1. The Request.IsLocal and HttpContext.IsDebuggingEnabled Properties
Typically, ASP.NET developers design, implement, and test their web applications from their personal computer, visiting the website through localhost. When the site is ready to be deployed it is moved to a different web server and the visitors are remote, reaching the website from a domain name like www.yoursite.com. Likewise, when developing the application it is not uncommon to have debugging enabled, which entails going to Web.config and setting the element's debug attribute to true. However, this setting should always be set to false in production, as Scott Guthrie notes in his blog entry Don't run production ASP.NET Applications with debug="true" enabled.

Sometimes its helpful to know if the user visiting the website is coming from localhost or if debugging is enabled. For example, you might want to display debugging- or development-related information at the top of each web page, such as the time it took to execute the page or detailed information about the currently logged-in user. However, this information should not be shown to end users; rather, it should only be displayed if the user is visiting locally or if debugging is enabled.

The good news is that it's quite easy to determine whether a visitor has arrived at the site locally, thanks to the Response object's IsLocal property. Response.IsLocal returns True if the visitor is coming from localhost, False otherwise. To determine whether debugging is enabled, use the HttpContext object's IsDebuggingEnabled property. The code snippet below shows how to display a Panel (pnlDiagnosticInfo) only if the user is arriving from localhost and debugging is enabled.

// C#
if (Request.IsLocal && HttpContext.Current.IsDebuggingEnabled)
pnlDiagnosticInfo.Visible = true;


' VB
If Request.IsLocal AndAlso HttpContext.Current.IsDebuggingEnabled Then
pnlDiagnosticInfo.Visible = True
End If




View Full Details...............................

Building Interactive User Interfaces with Microsoft ASP.NET AJAX: Triggering Full Page Postbacks From An UpdatePanel

Building Interactive User Interfaces with Microsoft ASP.NET AJAX: Triggering Full Page Postbacks From An UpdatePanel

Introduction
The ASP.NET AJAX UpdatePanel provides a quick and easy way to implement a snappier, AJAX-based user interface in an ASP.NET WebForm. In a nutshell, Web controls within the UpdatePanel that would normally cause a full page postback trigger a partial page postback, instead. For example, a Button Web control, when clicked, submits the form, causing the browser to start a full page postback. However, if the Button control is within an UpdatePanel then the UpdatePanel short-circuits the full page postback and performs a partial page postback, using JavaScript to make an HTTP request to the server. The server realizes that the request is a partial page postback (and not a full page postback) and only returns the markup for the UpdatePanels on the page. When this response is returned to the browser, JavaScript code parses it and seamlessly updates the user interfaces in the UpdatePanels. (For a more in-depth look at the UpdatePanel control, refer back to the Using the UpdatePanel installment in this article series.)

While we usually want controls within the UpdatePanel to perform a partial page postback, there are scenarios where we need a full page postback. ASP.NET AJAX allows us two techniques for specifying that certain controls within the UpdatePanel should cause a full page postback. The simplest approach is to define the controls declaratively using the UpdatePanel's Triggers collection. It is also possible to programmatically specify that a particular control should perform a full page postback, which is useful when the control(s) that need to perform a full page postback are not created until runtime (such as the Buttons in a GridView).

This article looks at how to configure full page postbacks for particular controls within an UpdatePanel, exploring both the declarative and programmatic techniques. Read on to learn more!




View Full Details...............................

Optimizing the Silverlight Install Experience

Optimizing the Silverlight Install Experience

One of the things that is important to think about when you start using Silverlight in your sites/applications is to make sure you handle the "what if the end user doesn't have Silverlight installed yet?" scenario. Ideally you want to make sure that the installation experience for Silverlight is very seamless, and nicely integrated into your overall end user experience.

Silverlight "Indirect Install" Experience

By default when you use the Silverlight.js library to load a Silverlight control in a page, it will automatically detect whether Silverlight is installed on the visiting client machine, and if not prompt the user to install it via an install image the Silverlight.js library automatically injects into your page.

This default installation option is a model we call the "indirect install" option - because when the user clicks the install link it automatically opens up a new window with the Silverlight EULA and download page on Microsoft.com displayed.

The benefit with the indirect install option is that it works with any site (no custom JavaScript required). The downside, though, is that your visitors will end up navigating to a separate page to install Silverlight, and the overall end user experience won't feel super integrated within the rest of your site.



View Full Details...............................

Silverlight and the 2009 Presidential Inauguration

Silverlight and the 2009 Presidential Inauguration

Tomorrow’s presidential inauguration of Barack Obama will be a truly historic event.

Silverlight is being used as an enabling technology on several sites that will allow those of us who can’t be there in person to share the experience online.

Presidential Inaugural Committee

The Presidential Inaugural Committee has worked with iStreamPlanet to enable live and live and on-demand video streaming of the Inauguration events at the official Presidential Inaugural Committee web site: www.pic2009.org. It streamed its first live video on Saturday, with the train ride that took President-elect Obama from Philadelphia to Washington, D.C. The official Inaugural swearing-in ceremony, speeches and parade will also be streamed live online on Tuesday, January 20.





View Full Details...............................

Introduction to XAML Browser Applications (XBAP)

Introduction to XAML Browser Applications (XBAP)

Introduction

XBAP (XAML Browser Application) is a new Windows technology used for creating Rich Internet Applications. There is always a confusion between WPF, XBAP and Silverlight. Developers get confused which one to go for while designing a project. Here I will explain all the 3 technologies with the differences and a sample XBAP application.

WPF applications are divided into two categories.

  • Standalone WPF Application
  • XAML browser applications (XBAPs)

XAML browser applications (XBAPs) combines features of both Web applications and rich-client applications. Like Web applications, XBAPs can be published to a Web server and launched from Internet Explorer. Like rich-client applications, XBAPs can take advantage of the capabilities of WPF. Developing XBAPs is also similar to rich-client development.

It is used for creating heavyweight .Net applications that take advantage of the full capabilities of .Net 3 Framework.



View Full Details...............................

Examining Various Silverlight Containers

Examining Various Silverlight Containers

User Controls

The core mechanism for displaying Silverlight pages is the UserControl class. The UserControl element appears at the top of every user control. This root element is a prime choice for storing static resources (discussed briefly later), as well as any namespaces (Silverlight uses namespaces to point to namespaces in an assembly).

The UserControl class is a content control, which means that it has only one property for storing children: Content. This means only one root level element can appear underneath the UserControl class, excluding complex properties (like UserControl.Resources, where Resources is a collection-based property).

Fortunately, other controls can contain a collection of children, so the user control can host a single control, which that single control can then host multiple controls. We'll get into the specifics of this soon. The first control that appears at the top of the user control by default is discussed in the next section.




View Full Details...............................

DoubleAnimation Basics with Silverlight Application

DoubleAnimation Basics with Silverlight Application

Introduction

Silverlight within a short time has made great progress and continues its battle with Adobe applications

such as Flash and Adobe Air. Clearly the battle lines are drawn. Adobe is no soft stuff either. But Silverlight has great capability. Events like the Presidential Election and the Olympics have left a lasting impression. Also anybody who has interacted with Netflix or Playboy would know the difference it has made for user experience.

This article is about developing an animation application using the Silverlight Application project that you find in Visual Studio 2008 with SP1. You must download Silverlight 3.0 and Silverlight Tools as described in a number of posts in my blog http://hodentek.blogspot.com. Why did I choose animation? It's the best eye candy and it sure arrests attention. I am not adept at animation but I describe some of the basics to go about creating animation. The Out of browser experience possible with Silverlight 3.0 is also described.



View Full Details...............................

Dynamically creating DeepZoom composition

Dynamically creating DeepZoom composition

Introduction

Admittedly, the need to create an image pyramid in code is not often encountered in system requirements; unless, of course, one is developing a composer for DeepZoom or any other zooming technology

. Microsoft's DeepZoom composer has the designer aspect covered, so this article actually assumes the road less traveled, hypothesizing that one could imagine a need to create image pyramids, and consequently "image collections" and "compositions" on the fly. Two examples immediately come to mind, the first of which inspired this article.

Writing from experience, an automobile body shop quality assurance department is required to review, often many, high resolution images of vehicle damage; these images are uploaded from the body shop, and typically loaded onto a viewing webpage at full resolution, which becomes increasingly tedious. An alternative is to use DeepZoom, which requires a process to dynamically create these necessary DeepZoom files, following the upload of the original images, so that they can be presented in a zoom-able thumbnail viewer on demand. As a second example, this process could also be used in a photo sharing application, allowing users to upload high resolution pictures without requiring the viewer to download huge image files.



View Full Details...............................

Cross domain access policy in Silverlight applications

Cross domain access policy in Silverlight applications

Introduction

We can see serious movements that took place in the development of applications during the last years. 5-10 years ago the majority of applications were desktop. Today web-applications also become popular.

Web-applications become popular, so the market of technologies is changing. We can see that a Silverlight application becomes more popular. It is a class of applications which are named Rich Internet Applications.

Undoubtedly, a way of interaction with a server is one of the main factors of web-applications developing. Interaction with a server should be simple and convenient, it is important.

Today interactions with a server in Silverlight applications are usually built through web-services. Web-services assume data exchange in XML format between a client and a server via protocol SOAP or REST. Besides, client’s applications can request other resources from a server. Undoubtedly, all these ways present the developer with convenient tools for an applications building. However, such forms of interaction contain certain threats.

Let us have a look at ways of Silverlight applications interaction with a server, and then we will find out what threats exist and how they can be eliminated.



View Full Details...............................

Using the Silverlight Accordion Control

Using the Silverlight Accordion Control

Introduction

If you've worked with ASP.NET AJAX and used the AJAX control toolkit, you may have noticed the Accordion control. This control provides an expandable and collapsible view of accordion panels within the accordion control. By clicking on the header expands or collapses that accordion panel. It's also possible to bind data to the Accordion control in ASP.NET, a subject I've written about before on this site.

The Silverlight Accordion works similarly. This container provides a default interface to show/hide the accordion's content. The control can be bound to, creating repeatable AccordionItems to create the Accordion user interface. We'll examine all of this in this article.




View Full Details...............................

Using the Silverlight HeaderedContentControl

Using the Silverlight HeaderedContentControl

Introduction

The Silverlight toolkit is an add-on to Silverlight meant to add additional Silverlight control functionality for developers. One of these controls is the the headered content control, a pretty simple control: it consists of a header area and a content area, which the header and content can be anything. This header/content area is a one-to-one mapping; there is only one header and one content area.

While I'm going to write about this control, I'm also going to discuss the nuances of the content-based controls, how they can be bound, and how the entire control can be bound using an underlying data context.

The Silverlight toolkit is available at http://www.codeplex.com/Silverlight. This control is subject to change in the future, and may change with the release of Silverlight 3.




View Full Details...............................

Usage of VisualStateManager to Define User Interface in Silverlight 3

Usage of VisualStateManager to Define User Interface in Silverlight 3

Introduction

A possibility to describe declaratively a user interface based on XAML has become the reason to think about the building of the user interfaces in a different way. This approach has allowed distribution work between a programmer and designer. It has defined a new branch of a user interfaces development industry.

As is known, user interfaces are based on the set of templates (ControlTemplate) for control elements. It is true for both WPF and Silverlight. Usually templates are a kind of layout, containing elements for a user interface definition. Triggers are usually used when there is a need to define some appearance changes depending on any condition. For these purposes a property or event is used to trace the moment of a control element state changing.

View Full Details...............................

3D Capabilities in Silverlight 3

3D Capabilities in Silverlight 3

Introduction

Silverlight platform (WPF/E) emerged as a branch of Windows Presentation Foundation platform. While WPF was essential to create well-established user interfaces of desktop applications, Silverlight was focused on Internet applications. A special feature of Silverlight technology is that it can work under various operational systems and browsers. Also, work of Silverlight application should not take a lot of system resources. So, a specificity of Silverlight technology is the realization of a powerful user interface based on the declarative markup for a wide variety of platforms with full compatibility between them.

All these conditions create certain restrictions for development and construction of the platform. First, the need to support several platforms simultaneously increases the amount of works to develop a platform and time spent on it. Secondly, Silverlight applications should consume a few (not too many) system resources. For these reasons the Silverlight functionality is less than WPF once from the beginning. Both versions 1.0 and 1.1 of Silverlight were basically focused on creation media applications. It was heavy to build any serious business solutions based on these platforms. Silverlight 2.0 already contained a set of control elements and tools for various business scenarios implementation. Nevertheless, until that time there was no possibility to work with 3D- graphics within Silverlight applications. Some tools which allow building user interfaces in a 3D mode have appeared in Silverlight 3.




View Full Details...............................

Building a Silverlight 3 based RIA Image Management System - 1

Building a Silverlight 3 based RIA Image Management System - 1

Introduction

With the web development technology maturing, RIAs (Rich Internet Applications) are preferred to by more and more people. After many years of silence, under the situation that Flash nearly dominates the Internet world, Microsoft is unwilling to lag far behind, against many deficiencies of the rival and quickly developed a so-called "Flash killer" technology-- Silverlight.

In the four parts of articles, I’ll show you a basic RIA image management system based upon the popular Silverlight 3 technique, through which we are to explorer the typical routine and necessary skills in creating Silverlight based line-of-business applications.

We are going to, as far as possible, follow the development of software engineering to introduce aspects of the case in this chapter. However, since this case still remains at a level on a simplified version, so for some modules, such as needs analysis and so on, will be simplified or be omitted.



View Full Details...............................

Building a Silverlight 3 based RIA Image Management System - 1

Building a Silverlight 3 based RIA Image Management System - 1

Introduction

With the web development technology maturing, RIAs (Rich Internet Applications) are preferred to by more and more people. After many years of silence, under the situation that Flash nearly dominates the Internet world, Microsoft is unwilling to lag far behind, against many deficiencies of the rival and quickly developed a so-called "Flash killer" technology-- Silverlight.

In the four parts of articles, I’ll show you a basic RIA image management system based upon the popular Silverlight 3 technique, through which we are to explorer the typical routine and necessary skills in creating Silverlight based line-of-business applications.

We are going to, as far as possible, follow the development of software engineering to introduce aspects of the case in this chapter. However, since this case still remains at a level on a simplified version, so for some modules, such as needs analysis and so on, will be simplified or be omitted.



View Full Details...............................

Building a Silverlight 3 based RIA Image Management System - 2

Building a Silverlight 3 based RIA Image Management System - 2

Introduction

In the first part of this series, we first examined the general design of the RIA image management system, then discussed the database design, and finally started up the application development from the homepage module. In this second installment, we will continue to develop another module—the photo category management module, which represents one of the most typical components in a Silverlight based data-centric RIA application.





View Full Details...............................