TechBubbles

Archive for September, 2011

Calling ASP.NET AJAX Modal Window from JavaScript

 

This post discusses about calling AJAX model window from JavaScript. The scenario is checking the UI controls in page and alerting the user if he is leaving the page without saving the data. This shows confirmation window with yes and no buttons.

The Form body code looks as below

   1: <body id="Body">

   2:     <form name="Form" method="post" runat="server">

   3:     <asp:ScriptManager ID="mgr1" runat="server"></asp:ScriptManager>

   4:     <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

   5:     <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>

   6:     <asp:DropDownList ID="DropDownList1" runat="server">

   7:         <asp:ListItem Value="no" Selected="True">NO</asp:ListItem>

   8:         <asp:ListItem Value="yes">YEs</asp:ListItem>

   9:     </asp:DropDownList>

  10:  

  11:     <asp:Button ID="Button1" runat="server" Text="Button" 

  12:      OnClientClick="javascript:return UnSaved();" />

  13:  

  14:     <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" 

  15:            runat="server" TargetControlID="btnHid"

  16:         PopupControlID="pnlSave" BackgroundCssClass="modalBackground"

  17:           CancelControlID="btnCancel"

  18:         PopupDragHandleControlID="panEdit">

  19:     </ajaxToolkit:ModalPopupExtender>

  20:     <asp:Button runat="server" ID="Button3" Style="display: none;" />


  21:     <asp:Panel ID="pnlSave" runat="server" BorderColor="Black" 

                   BorderWidth="3px" 

  22:          Height="100px" Width="180px">

  23:         <table width="100%">

  24:             <tr>

  25:                 <td >

  26:                     Do You want to save data?

  27:                 </td>

  28:             </tr>

  29:         </table>

  30:         <br />

  31:         <asp:Button ID="Button2" runat="server" Text="Save" />

  32:         <asp:Button ID="btnCancel" runat="server" Text="No" />

  33:     </asp:Panel>

  34:     <asp:Button runat="server" ID="btnHid" Style="display: none;" />

  35:     </form>

  36: </body>

Read more

Related Posts:

No comments

Creating Web Applications with HTML5 WebSockets

 

WebSockets enables the real-time web where the information is available to the user the moment it is published. WebSockets are standard based, Interoperable across browsers and very simple to use. We got the WebSockets support everywhere it is available on browsers, windows run time, WCF, ASP, IIS etc. This post gives you the basic idea about WebSockets and the technicalities behind this concept.

There is a deep desire for speed to get the information as quickly as possible.

Typical examples where user wants to see the information in real time

  • Stock Market data
  • Live Scores
  • Airline Location
  • Twitter Search Results
  • Interactive games

The Problem

HTTP is a state less protocol where server can communicate with client only once per request received. Real time web needs asynchronous communication with client.

Read more

Related Posts:

1 comment

Optimizing the website Performance using ASP.NET 4.5

 

There are so many different ways you can optimize your website performance. You may think why we need to worry about website performance when internet connection speed is growing faster and faster. Just few examples: Google did a test, if their search page is 500ms slower then they are going to lose 20% their traffic. If Amazon runs 100ms slower then there is 1% drop in their sales which is nearly $1 million a day. So it is important build the website which are fast in response time. ASPNET_vNext

Typical website may have the following architecture. We can do optimization in each layer but this post specifically talks about ASP.NET 4.5/IIS which is a presentation layer.

image

Read more

Related Posts:

2 comments

Creating Data-driven web apps using ASP.NET 4.5 Web Forms

 

Data binding is simpler and more powerful in ASP.NET 4.5 Web Forms.This post discuss about creating Data-driven application using ASP.NET 4.5 preview. It also discuss about different Data access methods, particularly about model access binding features in Web Forms. You need to install Visual Studio 11 Developer preview to use this feature. You can read this post for links to download etc.. ASPNET_vNext

Typical ASP.NET developer may use one of the following Data Access mechanisms for binding the data

  • You may setup your Database First – Creating a Schema and generating model from it. Here model is a class which you are going to interact with your database from your code.
  • You may setup your Model First – Instead of designing the database first, we design the entity model first eg: using entity framework. Design your model first and then generate a schema and code.
  • You may setup your Code First- In this approach you first write code to design the model and then generate a schema using that code.

Read more

Related Posts:

1 comment

Visual Studio 11 Web and .NET 4.5 Developer Preview and ASP.NET 4.5

 

 

Three days ago, Visual Studio 11 Developer Preview and .NET 4.5 were announced. You can get the more details from here. You can download the Visual Studio 11 Developer preview from here. You can run Visual Studio 2010 and Visual Studio 11 developer preview side by side.

Visual Studios - Living together 

.NET Framework 4.5 Developer Preview can be downloaded from here

Visual Studio 11 Developer Preview includes new features like

  • Editor support for CSS3
  • Editor support for HTML5 and Javascript

More about the features and ASP.NET 4.5 development can be read here

NOTE: You need Windows 7 or later to try Visual Studio 11 Developer

I am downloading the Virtual machine and want to explore the features. Soon I can write a detailed post on these features.


Share this post :

Related Posts:

1 comment

Web Standards Update for Visual Studio 2010 Editor

 

Web Standards Update for Visual Studio 2010 SP1, which provides HTML5 and CSS3 support. Microsoft team said Visual Studio next version have better support for HTML5. This update gives you HTML5 Intellisense and fixes some bugs in SP1 support for HTML5. CSS3 intellisense on latest specification from W3C. vshtml5

Download Web Standards Update for Visual Studio 2010 Editor

Please note this is not an official release from Microsoft.

HTML 5 Features support in this update

Complete Valid Markup -

We need a type attribute in script tag in SP1. It throws a validation error if you miss the attribute. Now you do not need to put this attribute. New items in the type list like text/x-jquery-tmpl

image

Read more

Related Posts:

1 comment

Deploying SSIS packages into SQL Server vs Deploying as a File

 

In earlier days we have the options to save the DTS packages to SQL Server or to File System. Many of you trying to understand the trade offs between them. This post list out the advantages of both options.

Advantages of Saving and Deploying SSIS packages to File System 

  • We can use Source control system manage the versions.
  • More secure when using the encrypt with user key encryption.
  • Packages are available when you save locally. not subject network downtime problems.

Read more

Related Posts:

1 comment

Deploying SSIS packages into SQL Server vs Deploying as a File

In earlier days we have the options to save the DTS packages to SQL Server or to File System. Many of you trying to understand the trade offs between them. This post list out the advantages of both options.

Advantages of Saving and Deploying SSIS packages to File System 

  • We can use Source control system manage the versions.
  • More secure when using the encrypt with user key encryption.
  • Packages are available when you save locally. not subject network downtime problems.

Read more

Related Posts:

No comments

Using For Loop and Foreach Loop Containers in SSIS

 

SQL Server Integration Services supports two container tasks name For Loop and Foreach loop. These containers supports to execute the repetitive workflows in controlled way. The For Loop has three expressions that control it’s execution and termination. This post also discuss about Foreach loop container in SSIS.

The three expressions are

InitExpression  The For Loop evaluates the InitExpression exactly once at the start of the loop execution. The initialized variables are used later in other expressions.

EvalExpression The For Loop evaluates the EvalExpression once for every iteration of the For Loop.For Example The  InitExpression would be @Index = 1 and EvalExpression would be @Index > 1. EvalExpression must use boolean operators.

Read more

Related Posts:

1 comment

Using Data Profiling Task in SSIS

 

Data Profiling is important in data quality processing and transformation. It provides a way to investigate large datasets and to identify incorrectly formatted data. This post explains doing data analysis using Data Profiling task.

Data Profiling task helps you to

  • Identify the problems with your data. Example: Finding the products in your data  which are not following the naming pattern.
  • Identify the missing functional dependencies between columns. Example: State and Zip code columns. It helps you identify wrong ZIP code that has been entered for a state or city.

Setting up Data Profile Task

Read more

Related Posts:

2 comments

Next Page »