Welcome to MSDN Blogs Sign in | Join | Help
Direct Push

Now a days I'm exploring the Windows Mobile , so some interesting work which i'm doing is related to Direct Push. In this blog post I will be discussing about the ways to implement Direct Push......

Using SMS (this was used when there were no real direct push available) 

The triggers are sent from the server as SMTP Message to the SMTP front end at the mobile Operator and they send SMS messages to the device. So it keeps device Always Up To Date notification feature (AUTD).

Limitations

1.    SMTP to SMS conversion latency.

2.    Reliability.

 

Using Direct Push

In Direct Push client opens the HTTP connection with the server and keeps it alive for a X amount of time known as heartbeat interval. The server looks for the changes till the heartbeat interval elapses and sends notifications about new items over this connection.

 

How Direct Push works

Device issues a PING command and sends it as a part of the POST request from the device. EAS server receives a PING command and subscribes to notifications for the folders using SUBSCRIBE command for DAV subscriptions.  EAS checks for changes and if a notification arrives within the heartbeat interval it notifies changes to the client to sync by issuing a response to the PING command with a Status of 2. If there are no changes within the heartbeat interval, the EAS server waits for the notifications from the mailbox server. After the heartbeat interval elapses, the server uses UNSUBSCRIBE command to delete the DAV subscription and then it will return a response to PING command with a status of 1 indicating no changes.

Connecting to WCF based services from Devices

It's coooooooool, Amazing, it blew away my mind...  Hats off to NET CF team.... the exciting things are coming up with NET CF 3.5 .... the NET CF team is working on WCF subset for the next release, hmmm... excited to know more about this, please refer Roman Batoukov blog post..

Windows Communication Foundation (Compact Edition) and the story of the Lunch Launcher

How to Set permissions for Website Using Installer (MSI)

Many of us create installers for installing websites but most of the time we don't include the permission settings for the Website and rely on the users to do the rest   i.e. go in the IIS administrator and set the required permission on that…

I believe if you do the same stuff with writing the custom action class, it will save hell lot of problem… so I’m including one of the custom action class which sets the required ACLs for the website

U can do lot many things starting from creating your App-pool to whatever you can think of doing with IIS administrator… so make sure that next time if you create MSI include the most of the stuff you can…

 

 

Debugging Windows Installer (MSI) using Visual Studio 2005

I was struggling to debug my custom action class... Oh gush real pain How to debug this stuff..

i searched and got the simple way to debug Windows Installer (MSI) is to put below cool line in begining of your custom action class code

"Debugger.Break"   !!! and you are ready to go... 

Useful Visual Studio shortcut keys

Shortcut Keys

Association

F8/Shift-F8

Navigate compilation errors

Ctrl-D

Move to mini-buffer

Ctrl-Shift-G in mini-buffer or
Ctrl-O in mini-buffer

Open file name in mini-buffer (Ctrl-O seems to open stuff Ctrl-Shift-G does not)

"> command" in mini-buffer

Execute command

Ctrl+/

Move to mini-buffer, typing the leading > for you

Ctrl-Alt-A

Open the command window

Ctrl-PageUp in HTML Design View

Open source view

Ctrl-PageDown in HTML Source View

Open design view

F7 in Form Design View

Open source view

Shift-F7 in Form Source View

Open design view

Ctrl-Alt-L

Solution Explorer

F4 or Alt-Enter

Properties of selected item

Ctrl-Shift-B

Build

F5

Debug

Ctrl-F5

Run, but not debug

Ctrl-Alt-J

Object Browser

Ctrl-Shift-C

Class View

Ctrl-Space when typing a symbol

Complete the symbol you're currently typing or give you a choice of possibilities

Ctrl-Space when entering arguments

Show the function prototype

"-" (no quotes) as the name of a menu item

Menu item becomes a separator

Ctrl-K Ctrl-F

Reformat selection

}

Reformat scope being closed

Ctrl-K Ctrl-C

Comment out selected lines

Ctrl-K Ctrl-U

Uncomment selected lines

Ctrl-}

Match braces, brackets or compiler directives

Shift-Ctrl-}

Select match between braces, brackets or compiler directives

Ctrl-L or Shift-Del or
Ctrl-X w/ no selection

Delete entire line

Ctrl-Del

Delete next "word"

Alt-F6

Next visible pane (not for use with all windows unpinned)

Ctrl-Shift-F12

Jumps to next *whatever*, depending on what's active, e.g. next find result, next task, next error, etc.

Ctrl-"-"/Ctrl-Shift-"-" (no quotes)

Jumps to last/next place you worked

Ctrl-C in the Class View

Copies fully qualified name to the Clipboard

Ctrl-M Ctrl-M

Collapse or expand a region or outlined block (as marked by the [+] and [-] on the left hand side of the editor).

Ctrl-M Ctrl-O

Collapse everything in the current file

Ctrl-M Ctrl-L

Expand everything in the current file

F12

Jump to the current symbol's declaration

Ctrl-G, line #, Enter or
Ctrl-D, line #, Ctrl-G

Jump to line

Ctrl-I/Ctrl-Shift-I + string

Incremental search for string

Ctrl-R+Ctrl-R

Turn on/off word wrap

Ctrl+Up/Down Arrow

Scroll window up/down without moving the cursor away from the current line

Shift+Alt+Arrows
(Alt+Mouse works, too)

Column selection (include of line selection)

Breaking changes when Migrating from .NET Framework 1.1 to 2.0

Well... there will be tons of article on the web about breaking changes when you migrate from .net framework 1.1 to 2.0, I find few good article and blogs on the migration.. If any one thinking or migrating to 1.1 to 2.0 may find good information.

Links 

MSDN Article for breaking changes

Mehran Nikoo's blog 

 

Ajax Validation controls

I hope you will get the same problem which i faced when we use ASP.NET 2.0 validation controls with Ajax controls ( inside Update panel)  :'(

so in this article i'm going to discuss about the difference between the ASP.NET 2.0 and the Ajax validation controls.  

The difference between the ASP.NET 2.0 AJAX Extensions Validation and the ASP.NET 2.0 Validation controls is that the ASP.NET 2.0 AJAX Extensions validation registers expando attributes and script compatible with partial page rendering by using the script registration methods of the ScriptManager control.

When using ASP.NET 2.0 AJAX Extensions validators the control to validate and the validator should be inside the same UpdatePanel control.

Validators outside of UpdatePanel controls should use the script registration methods of the ClientScriptManager control.

Examples

This example uses two RequiredFieldValidator controls to validate user input. Error messages are displayed in a ValidationSummary control.

CS

<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Validation Summary Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <asp:UpdatePanel runat="server">
    <ContentTemplate>
    <table cellpadding="10">
      <tr>
         <td>
    <table style="background-color:#eeeeee; padding:10">

               <tr>
                  <td colspan="3">
                     <b>Credit Card Information</b>
                  </td>
               </tr>
               <tr>
                  <td align="right">
                     Card Type:
                  </td>
                  <td>
                     <asp:RadioButtonList id="RadioButtonList1" 
                          RepeatLayout="Flow"
                          runat="server">

                        <asp:ListItem>MasterCard</asp:ListItem>
                        <asp:ListItem>Visa</asp:ListItem>

                     </asp:RadioButtonList>
                  </td>
                  <td align="center" rowspan="1">
                    <asp:RequiredFieldValidator
                          id="RequiredFieldValidator1"
                          ControlToValidate="RadioButtonList1"
                          ErrorMessage="Card Type."
                          Display="Static"
                          InitialValue="" 
                          Width="100%" 
                          Text="*"
                          runat="server"/>
                  </td>
               </tr>
               <tr>
                  <td align="right">
                     Card Number:
                  </td>
                  <td>
                     <asp:TextBox id="TextBox1" 
                          runat="server" />
                  </td>
                  <td>
                     <asp:RequiredFieldValidator
                          id="RequiredFieldValidator2"
                          ControlToValidate="TextBox1" 
                          ErrorMessage="Card Number. "
                          Display="Static"
                          Width="100%"
                          Text="*" 
                          runat="server"/>
                  </td>
               </tr>

               <tr>
                  <td></td>
                  <td>
                     <asp:Button id="Button1" 
                          Text="Validate" 
                          runat="server" />
                  </td>
                  <td></td>
               </tr>
            </table>
         </td>
         <td valign="top">
            <table cellpadding="20">
               <tr>
                  <td>
                     <asp:ValidationSummary id="valSum" 
                          DisplayMode="BulletList"
                          EnableClientScript="true"
                          HeaderText="You must enter a value in the following fields:"
                          runat="server"/>
                  </td>
               </tr>
            </table>
         </td>
      </tr>
    </table>
    </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>

Migrating Atlas to Ajax Beta 2

This Article will help you directly migrate from Atlas to Ajax beta 2. The migration guide available at http://ajax.asp.net/ site talks about migrating Atlas to Ajax beta1 and beta1 to beta2.. I have not done much great job .. J just used these two migartion guide and consolidated in one to help those guys who wants to migrating from Atlas to Ajax beta2 directly.

Please refer the attach migration guide..

Generating Pivot Reports and charts in SharePoint

In this article I’m going to talk about generating “Pivot Reports” in SharePoint using excel as a data source.

Let’s begin with the important step before we jump to talk about the “Pivot Report”

Point 1. You need to Install SharePoint J

Point 2. Install Office 2003 and Office Web Parts.

After you have installed the Office Web Parts you should be able to follow these steps:

1.     Import data from an Excel spreadsheet to your SharePoint team Web site. Those who not aware of how to import data from excel to SharePoint list refer Microsoft Office Assistance site

2.     Open ad Web Part page and add the Office PivotChart component from the Virtual Server Gallery

3.     Click on the "Connect to an external data source" link in the web part.

4.     Add a new data connection & select Data retrieval services

5.     Select Windows SharePoint Services lists

6.     Type in the URL to your site and then select the list you wish to retrieve data from.

7.     Select the columns you with to retrieve

8.     This next step is most important. It is selecting the location to store the data connection information. This must be a location that is accessible to users who will view the web part. A logical location for this on a SharePoint site is a document library.

9.     Finish the wizard and View the result.

If you don’t see any data in pivot table then follow the above steps till you succeed……J

How to bind Generic Dictionary with dropdown list

I was searching for binding the dictionary  with dropdown list, the solution I found was consist of binding the Key as  ‘DataValueField’ and value as ‘DataTextField’ of dictionary object.

But my problem was to bind the object (value collection of the dictionary)as datasource and its property to the dropdown ‘DataValueField’ and ‘DataTextField’.

The beauty of Generic dictionary object is that it can return you the value collection by using ‘Values’ property of the dictionary.

So here is the example.

<asp:DropDownList

ID="ddlCustomer"

runat="server"

DataSource='<%#Customers.Values%>'

      DataTextField="Name"

DataValueField="ID">

</asp:DropDownList>

How .NET Data Bound Controls works

In ASP.Net you can pass any control a “DataSource” it use the same to populate itself.  How this works and how to create your own data bound control

Check below article written by Mike 

http://blogs.msdn.com/mikechr/archive/2006/03/31/566402.aspx

 

AutoComplete with scroll bar

One of my friend asked me that he is getting difficulty to put scroll bar for the AutoComplete(Atlas) Control. I tried to put scroll bar for him. same thing I'm explaining here.. May interest you guys.

By default Autocomplete control does not provide the scroll bar, in-order to have scroll bar you need to define panel or Div to attach as dropdown area and apply style on that to get scroll bar.

Define Panel for the dropdown area for the autocomplete control 

<asp:Panel ID="dropdown" Height="100px" ScrollBars=Vertical runat=server></asp:Panel>

 Set the "DropDownPanelID" same as panel id. 

<atlas:AutoCompleteExtender 

               DropDownPanelID="dropdown"

               ServicePath="AutoCompleteService.asmx"

               ServiceMethod="GetSuggestions"

               MinimumPrefixLength="1"

               runat="server">

            <atlas:AutoCompleteProperties

                    TargetControlID="searchText"

                    Enabled="true" />

        </atlas:AutoCompleteExtender>

Control adapters for ASP.Net

Couple of days back, I was using ASP.Net Menu Control. I saw the way it generates html its difficult to apply styles (css). I got stuck with the same problem. but thanks to control adapter it made my life easy.

The control adapters are the coolest thing, it let you change the HTML markup produced by ASP.NET controls. So, why invent a new control to generate the markup the way you want.

For the detail information about the control adapters and the downloads just refer: http://www.asp.net/CSSAdapters/Default.aspx

 

 

Page view tracker