Universal Knowledge Solutions s.a.l 1 : . : . . : : • • • .
Universal Knowledge Solutions s.a.l
1
������ ���������� ���������� ���� ���� ���� � ����� ����� ���� � ����� ����� ���� � ����� �
���� ��� �
� ���� � ������� ������� ������� � ����� � :
��������� �� ��� ���� ��� ������� ���� .
����: ���� �� ��� ���� ��� � ��� !�" #��$�� �� ��� ��� � %� ��� &% �� &'���(� )�*�� �������� �� ����� %+���$���� , %+�- . ./( �, �����
�������� �� ����� � �0� ' (�1��� !�" 2%$��� ������ 3%����� �, ����� � ��� ��%���� ���"0�.
������� ��!�: !�" �41�� �/( �, 5�� �� 2%$� :
• �������� �� ����� '��1��� ��7�� • �������� ��� ������ ��"���� �����14��� • ���� '��1� �������� ��� ����� '������ � ��%���� 3%������� $�.
Universal Knowledge Solutions s.a.l
2
� ���� � ���"�� �������# �
���� : ������� ��� 4� 2 %$� 2��� �&8�9 �� ���7�� %�: !�; �&���<�� ��=%�� !�; .
> +���?3��" ���� 4��� ��/( '&�� % � ������ �� '@%��� � ����� > ��� �" ��%�$� �1���� � �.
� ���� � ���"�� � ��%��� A��-� �������� ��� � ��� � � �( � B�� !�$�� � � ���� 2������ !�; �������� 5����� �� C%��� �(������ � ��� �" D���� ���, EF���� �, ���- �" D���� ������.
$�� %&�'�(� )�*�� � )%����(� ��4� ��%G� � ��" �" �� � ��% ����� '������ ���� ��. /; � ���$�� � ��7�� �� ����� H��
&�I� �, #���� �J� � , ��4�� !�; ������ ��� �I��� ���� � !�; ��4���� ?7-� �� E����9�� . ��� ����� ��9� ���� ��� ������4��> �� 5��0� �/�� K$��� ��*$�� � ��7�� ���9�� !�. -�./�� �����# � ���"�� � $� ��� � �""�� ��%G B������ ��� �� �� ��9� � ���9�� %�" ���� ��� �������� ��7�.
� ������ � ��� '������ � ��7�� ����9��� ��4�� ��� ����- EF�� ��.
���� �� ����� �� � J�� �"���� � ��7�� �� ����� %��$� �� �0� '<$� �, =%� ��� ����� ��0 ��� �� �0� K$� �, ��� �� ��� ������-�> ?� ��� ?� �� ��� �� ��� ������ . �������� �� ����� � � �F7$�� ������ ��9�� H*� �� ��7��.
.
�����# � ��� � �0� ��"���
������� �� �"���� %,�*� � �� ��" �J � � �L� � ��" 5� ��� ��� � ����� ��� �=%�� ��� �� 2�% � �M��� D ���� ��9 ��� ������� 2�% 0� ./(��$�� �J � ������.
�������� ./( ������ ��9�� %�< :
ت ا��������� ت ا��� ا�� ا�����
Universal Knowledge Solutions s.a.l
3
(� �123 %���# � ������ � ��4�: >� ��� �� N� 5� � OP9� ��>�Q������ �� (������� ��I� ��%9� �-�� � �* %" � �� ���9 %�" ��4�7� � ����� � ��� ���.
����1� �( ���%9�� ./( 5�@���� ��4�� ��4�7�� �������� 2������ ��4�� ����� '��� ���� ���%9�� .
��0��5�� � ���� � : ?3��" � ��7�� ������ C������������ ��� ����� !�; �,�*G�� ����" ?���4 ?� ,�*; ?�. ���J����� �-� ��� ��� ���$�� �/( ��9
� ��7�� ��4��� ���� ���9�� ��F� �� � ��7��. �� �, � � F � ��$�� ./( H�4�� �F��� K$� '�� ���� � �� ��9� ���$�� �/( �������� ��� ����� � �*� ������ ?�%�I� ����
�������� ��� �����.
���4������ � ����� � ��" � �: ���� ��$�� � J� � , �J � ���$��� ������ ���� %,� R������$�� � ��%� �J � ���� ��� ����� . ���� ?7-� N%�%*�� ��, H14��
���%���� �� �� ��� � � '��� S���%�� T � �G 3%�� �� ��" � ����������� R�� !�" �4�� !�� ��(% @�.
�����# � ��� � �0� ��"��� )����(
��0��$������ � ������ � : ?�,�*;� ����� � ���� �� ��%� !�; � '����� ����� �4�� �� ��%� ���%9�� �� � �$�� � �5J�%*�� 5�� �� ��%� �-� � $� K%@
�� ��%�� �� ,%4��� ������� �� ��%��� �4�� ��������. ..�(% @�.
������� ��6"7� : � '(�"���� �����%9���� � �������� �� ������� ���� ' ��� �, �"��� �%�/�� ������-��� � � !�$, ./( �� � �$�� ��%�
��������� �������� � ��7�� ������ ' ��� !�" ���%9��.
��"�����4�8�� � : ��� �������� ��� ����� %��$��������� �� ����� ���� �, ?� J% ?��� . ���� ����� %� ��� 2F�� >��� ��� � ��� )�� !�" ������� ��%
�� D � ���$� ���$��� 3���� %��$PDA?��J7� %-�� �������� 5����� 3����� �������� 2������ �� �������� ���"0� ���� �, � ������ ���� ?�� �$� %-�� ��� � � � P9� !�" 3%��F W���� �������?�����?��J7� �� � ��� ./( �$ � � %-�� � ) % P� E*��� �/( E�
����� � �/�� �������� 2������ %��<�$ � ���� 3���� ��" PDA E�N��$�� 2����� ��� ��.(
�<�7�:
OP9������7�� � ������ ������
�$J��� 5�4�� ���$��
������� ����
�$J���
�� ��%���
�������
��<�0�
�$�4��
��� �����
Universal Knowledge Solutions s.a.l
4
./( E �� ���� ��������� ������ �,�� �, ���� � �������� /; ' ���� ����� ./( ������ �� �, � J�� �"���� '����� ��� ������ K$�.
�� �� ���� � ��4�8
1 �������� ��� ����� T� '�� ?�$�� ?�� �������� ��� � ��� �� �1������ )���0� � P�� �������� �������� ��� ����� �� . �������� 5����� )���� � P�� '����� �1���� �, ��� ����� ./( C%���� 3����PDA �� �/�� 2������...�(% @� .
� ����� 5���&#��� !�" ��� N/�� �������� ������ �� � ���� A���� ����� �� ��� �(� �������� ��'������ E� %9��� .�/�
5� ��" �&�� N� ' �4������ � ���4�� � �: D � �� ��� ����� ./( 8J�4� 3�"�%� � �� P9��� '�<�� �:������G� �A��0� =����.
� ����� ����� 3�"�%� 5� ���: 1 X B���� ������ '�� 2 X ����$��� �"% 3 X ��%������ ������� '����� � ����;� ����0�� '���� D � �� �9�9�� ��14��� 4 X � P9��� '�<� D ��� � ����; 5 X Y����� �� ,% �� �4� � ����;E 6 X � %� ��� %�" 7 X >��� �� �����+��� �% ��� ����� ������ �, ��� �H ��1� �������%�� ��� �$9�A�� �D����� �� �� ��� ��4�� 8 X >� �� ��%� %,�� ��*� ��� ���%��� '"���Z� �$�4��� ����� �" �1���� ���%9 �� 3%.
� ���� � ��4�8�� � )����(
���������� ������ ' �4� �, ����"�%� 5� ����� �������� ��� ����� �(�� �% ���� 8J�4��� � �� �:� ����G� � �: 5��� �
3% �� � �(� � ��7�� ��4�� ���$� ��� ?7 41� %-�� 3%�4� ��9F���.
����9� �� :: 5�� ��� �"�1��� =��� !�" �������� ��� ����� �, �(%� ��� 5� ���� ����G� � �: ���$��� )�� !�" ��� � ��� � %� ���� ��$���
���$��?����"����� ���"0� ��� � � '<$� '���� �/( �, %���"� � $� ����G� � �: /�� 5� W�/� ����G� �� 3% �� � �� ��������� �� )����.
�:���( ?�%�9��� %-�[� ����G� :
• '�F%0� ���� • '���� '������ ����G�
o � *�%�,� H ��1��� ����
Universal Knowledge Solutions s.a.l
5
o 2%����� !�" 2%$��� o 2%��� �"���� o � �� � !�" %9����� 2%$���.
• G�H ��1��� ���� '������ ���� • ���4�� ����G�.
���������� ������ ' �4� �, ����"�%� 5� ����� �������� ��� ����� �(�� �% ���� 8J�4��� � �� � �:� ����G� � �: 5��� 3% �� � �(� � ��7�� ��4�� ���$� ��� ?7 41� %-�� 3%�4� ��9F���.
����9� �� ::
���$�5�� ��� �"�1��� =��� !�" �������� ��� ����� �, �(%� ��� 5� ���� ����G� � �:�� )�� !�" ��� � ��� � %� ���� ��$��� ���$��?����" �/( �, %���"� � $� ����G� � �: /�� 5� W�/� ����G� �� 3% �� � �� �������� ���"0� ��� � � '<$� '����
������ �� )����. �:���( ?�%�9��� %-�[� ����G� :
; ��<�7� ��� : ?3��" �������� 2������ N���� �� ����� ���� !�" 12?��F% .�� H�4� %��0� ���� '�F%0� ����G � ��$1�� �P��� ������ ./( %��$
8�4��� ����\� ��@%�� ��" ?����%; %-��� 5�8 4��2%��� D7- � -��� ]��1� �� . � E� ��� �$�� �1���� �� ��� % � � ' � ��� �� ����� ./( �� ���� %-�� ����G� � ��"T9 D �� ./( '��� � ����� � $� ����� ����; ��" B����; ��%��� 8��� EF���
2%�����. ; ��� � ������� ����9�:
%��$> 3� ���� ������G� ��� �, �-�� � ���� #���� ��9�9 '����� � ��� " ���$�!�����G� �, '���� . �/( H�5��0� ����G� �� ��$� � �������C����� H ��1� ���� !�; � !�;� J� � , '�F%� ���� . �� �/( �, ��������� ?�"� 9 �� ����� %-��
������: o � *�%�,� H ��1��� ���� : D �N%� ����; �(��" '������ ��� � �9�9�� !�" H ��1� ���� %��<; B�L� �����$���
� � �� H ��1� ���� !�" ��$ . ���� ���� �/( �, ���9��� �,� ?� �� 3% �� �9�9 ���� !�; ������ �, � ���������G� �"%.
o 2%����� !�" 2%$��� : �9�9�� !�" '���� � ��� ������� '�� ���� 2%����� % 1� ������ !�" � ����� ./( ��$�) !�" �� 3���� �����9�9�� ?����@.( � P9� '�<� %,� Windows CE3� ��� ./( ��� �(� 8�4��� ��� �, ?��� ���$, �$
3% P4���3% ���� 8�4��� �, ����G� �"% E,%� ��@%�� ��� �, � ��$, �F� H�4� �����. o 2%��� �"����Graffiti : ?7�9 �������� ��� ������ �4���� � P9��� ��<�� K$� ���F� �� ?� 2%$��� ���9� ��
2%����� !�"� !"�� �4�� 2%��� �"���� '������ W�/Graffiti !�" 2%$��� ����� 2%����� ./( H��
Universal Knowledge Solutions s.a.l
6
5 %���� K$� 2%����� ./( 5� �� �2%�0���� �" ��$��� '� �� �$� ����G� �, 3� � �"% T��� �����. o � �� � !�" %9����� 2%$��� :!�" � ����� ./( ���$� � !�" %9����� 2%$��� !�" � P9��� '�<� 5 %�� � ����; �
'���>��� .� ��$�� ./( 5� �� ����$, ���� !�� ��� �$� %-�� 5�4 ���"� �� ��%�.
)����� � ��� ������� ����9� : ���� ��� ����G �1���� ���9� ���F ���� ��%� ��� �� �� '@%���� �( H ��1��� ���� ���� �� ����G� � ��$� � ��$, %-�0� �� % ��.
>� H ��1��� ���� ���� �� ��� +��� �������� 5����� �, ��� ���������� ������ !�; ���4� ��� � ,% �.
%��� � ����9�: %��$�� ��� � ��" ���4�� ����G� � ��" � �3% �� � ��$, ��/ / 1�� ��� /;?3%9��� � ��4�� %���0� K$��� � ��4�� # L� D����
�� 8�9� ��4�� �����$� �". � ���4�� '7$��� �4���� W�� �-� ?�� �$� %-�0� ��� � ��� ���� �, ����� ����� �7F����� / 1��, �?3��$ W��� T � ��� �/(�� ����G�
���� �� 3��$��� � ��4�� ��J0� !�" ����_� � ,���� " :?��@ #� �� ��� 2 �T9�� �, "�� ���� �� " �� ������� ��%J� �� �( �� '� �� T9�� !�; ���." �-� � ��4�� ������ ��<�L� �4���� % �$��� ��� � ��� ./( '���� �� ?����@VoiceXML.
� ���� � ��4�8�� � )����(
�����# � ������ �� ::
� �� ���7�� ��4�7�� � J% )���� D7- %,����� ��7�� ��� ���� : ��4�� '������ �� ������ ��� ����� '������ ��4������� ��41�������� ��* �Z �>��� ��4�G�.
$����� ������� ������:
����� K$��� ���*$� E� ��$�� � ���� )���� �/( �� ��4�� 5� � PDAN� �� 2��( ����� ?7-� . � ��� ����� ./( ��� %,�������$��� '�� � %�[� ������ ���7�� ��4�.
� ����� T% �� =��G�� K$��� ��*$� ��� ����� ./( �4�� �� ��� : X ���� � ��� %9����� ��4�� X A�%���� ��� �$9� '������ ��4�� X D����� � ��� '������ ��4��.
Universal Knowledge Solutions s.a.l
7
X �"� ��4�� �� ���� �/(�,� ������ %� ��� >�� /J��" ���� � ����0 '�4 ���� ������ !�" ?�����"� B������ ��%?� �� ��4�� 3%�F ����� �������� � �*���.
X �"�� ?�* � �� % �� ./( �,B����� '�<��� ������ !�; ������ ��� �� ���� 3���0� ������ .��� �4�� ���� '����� ��� 7�� ��4�� � �L�� ?� ��%�: ���� �� %-�0 ���.
X �J �� � ����� �-��� ���� �/( �,�,.� �$� ./; N� ���� 2����� �� �� ���"; 5� ����� �/( ��" ���*� ������� ������. X �� ��� �F D����� � ���� ��4�� %,�� '�"�$� � ��" ��� A�%���� ��� �$90�� ��4���'������������ � �� $� � ��"
K$�A�9�� .
� ���� � ��4�8�� � )����(
�����# � ������ �� :: ���� ���� � ��4�8�� � ������� ������:
���7�� ��4�� � ��" � �L�� ������� ������ E� �41�� ������� � ���� ������� '����� ���� �/( ��*� . ������� ./�� ��� �9�� �� )�� �� %-�0 ��4�� � �L�� � ���"; � ��$� � ��7� ���.
�� ,% �� ./( �4�� 8�� #��F %,�� ������� ./( '����� 5� � � ��� ?����@ ���� ��(Compact flash)� �(PCMCI). 8���� ��4�� �� )���� �/�� � �(� %-�0� 3� ����, �1���� ����� '����� � ����; % ,���� �1���� )���� E� �%�� � ��" �
W ����9��WLAN� �WAN� �PAN...
4�8� � $�= ���� � ������ �� :: � ��" %��$�� �������� ��7�� ��4�� � �: ������� ������ � �*� �3���$��� ���7�� ��4�� 5 ��� ��� .
�������� 2������ ��� �, ��� %� ��� �/( %��$ ���� �F���� =%�0� �������� ��� ����� ?7-� �������� 5��� .����"� �, ?�%�I�.
8���� �� % �� ./( �, � �0� 3� ����, ���� �� � �$��� � ��� � ������� ������� ���7�� ��4�� ���� � � ���-� ����� � �L�������� 8���� � P9��� '�<��.
�� ;���%��� ����,%��$> ���� �/( �, � ���� %4��$�� ��� �D � '� ���� � ��7�� ���9�� ��� ?������ ������ '���� H�4
Universal Knowledge Solutions s.a.l
8
��4�� � �: ������ �4����.���� ��* ���
� ���� � ���� � %& ������� �
���%9�� �� � �$�� �%$9 ���9�� ��������� ������ % � � B�� �, TJ�$� � � ��� % �$��� 8��T����� ���%9�� ./( �%$9� �� ����� ���� ������ % � �� ?���� �� ��F !�� � %� $� % @ �� ��� !�; ������� ���� ����� �4����.
���(� �� ��� �������� ������ ���� �, � � ��� % �$��� �� � �$�� !�" ��$�� '� W�/�WAP ��� � ��� ���� % � �� 8����
�� % -��� ��� %� $��� �/( '�F D � ��%��G� !�" � ��7����%��G� % �$�� T,��� ��9� ��$��� ���$���� ���9���. ��� �-� �1���� ��P� % � � '� WML �CHTML �VoiceXML ���� �,��P��� � % 9L�����%��G�� �4���� � ���( � � �� � � ��� '����� '�� ��� BREW (Binary Runtime Environment for wireless) ���� �, �/�� 2��������
� ����J2ME ��� ���������� ��� ����� �� E�� 2 W�/� ������� ��� �� ��� � ��� % � �� �4���� % �$��� ���� �,. ��J � �,��%� �� ��%9 ���F.NETCF(.NET compact framework) � �(� 5��� ������ ��% ��9� � � F %��$� �����
��� % � � ���� ���, ����� 3% �� � P9� '�<� !�" ����$�� ��� ����� ��� �windows-CE. � �� T� �� �/( �, ��� � � ��� %�/ ��C/C++ �Visual basic �� ,% �� ��� � ��� % � �� ��@%�� ��" 3� � ��%� � %��$�
� �/��.
=%�� �P� % � � SyncML� '���� ���� % �$��� ��� ����� ��9%��� ������>��� �� ��$ /; ���� �����$�� �������� � ��$� H��� ��4����4�� ����� ������� ������ � � ���� ���� � "����.
� '�%� � 8�� %� $� !�" T�1�� a�� WAN��� � ?�%�I� '�%� '"� ��� ���IP� ������ a WLAN % �$��� T,� W�/�
802.11a �802.11b �802.11x'�� � ,�� $� D����� � ��� % ����9�� ?�%�PAN.
� ���� � ��4�8�� � �"��
T F� ��9� ��1 �4� 5$4 � �% �� ��9� �������� ��� ����� )����.��� ���� ./�� �������� ��1 �4��� ��� �� �� , : 1 X ����\� 3������ �������� 2������ 5��� !�; C����� �. 2 X ���� (����� 3% 4��� �J�%�� 3� : 3���0� ./( H��� 4��� �J�%�� ������� ��%\� 3 X � ��� �*1��� � �/�� 2������ 4 X PDA 5 X � ��� � ��" � �/�� 2������ 6 X � �� �� � 4�9�� 5�����
Universal Knowledge Solutions s.a.l
9
7 X �� ��� 5����� 8 X �������� 5�����.
� ���� � 48�7� >��* $? ��"���� �� ���� � m-commerce
� ��%���� 3%����� �� )���� �/( ��� C%�� � ������� A�%9�� �� ��"� 3%�1�� ���� D � ��������� 3���0� '������ ����� '��1��� �/( % � �� T�$�� ���� � �0�� �� ��"� ���"0� A�%�; !�" �������� ��� ����� ������� 3%���� A� "; �B�����
%���� ���"0� � ��$, #1�� �F� N� �,� ���� N� �� � ��%���� A�%9������� ��4�� �� F �� �(� %�� � ��. �( ������� ������ �7� �������� � ��%���� 3%����� T� ���� ���� ����$> ����� '��1��� �/�� ��� � ��� '(� ��:
%�<� � @��3 �: ��� ��� ��� ���� � �F%�� �������� !�" � J�%9�� � ��$�� �� )���� �/( ��% �?�%�, ��������.
����%��� ��������� ��� ������ �4���� 5�$�0� T��� �( �������� �/�� T��0� %������� ����� ./�� �4���� ���P���.
� ���� � ���" � �#���� �: � ����� �7��$���� T�$� �� , ��� ��� ��� ���� ������� �� �� �� ��"�� W��(.
€ �4��� � ���� ���$���� W��� !��0� A�%�; � ����; !�; ?�,�*; ��7F����� 29� !�" )7 7� ������ 5���� !�; �� ����� �7F����� .� �(� ��� '� �F �������� ��� ����� ��� ��%��� '������ � ����� �� ��$�� ?������� ������ ./( %��$�
���9�� ./�� ��4�� � ����\�. € �� '������ ���$���� ��, � ��-�� ��� '� ��F% ���� ������ T % �" E,��� '� D � E,��� � ��" �, �������� ��� ���
������� 2����� ���%9 �, ��� ��4�� ��I� ���� ��%9�� T % �" �� �� ��� !�; B� ���.
������� � �����: � �"������ �����$���� �������� 3���0� ������ � ��� ������� �� )���� �/( ��*� �� ����� '�0� T� ��%�� 8�� �� , A�
��� ��*� %�� %������ ��� ���� � ��� �J�%� '������ !�; �����$��� ./( ��%; ��� D � �#� ��.
� ���� � 48�7� >��* $? ��"���� �� ���� � m-commerce
)����(
A<�� � ������ � ����� �: EF�� � ��� � ����; ��9�� �� ��� �4���� ���� ���� '������ � ��� '� D �� E ���� ����� �, 3���� �P��� 3��� B���� ���� '������
B �; �J� � , E � ���� 5%F� �, B���� N/�� S����� �". '������ � 4�4�� T�$� ��� ������� �� )���� �/( 8�4�� ?��J� T���� K$� ��� �� ����B��%� �����$�.
>��� �� ���� � ��4�8�� � �������:
���� ��� ����� � ����� 5�� 5 %��� ������� �, � �$9 �������� ��� ����� '������ ���%���� T���� )���� 5�@� 5�� ��
Universal Knowledge Solutions s.a.l
10
?�� �� %-�� ��%�� =%�0� T% ��� T���� �$��. ( ��� ���� � �������� K$� ���� �� �/( �� '@%���� ��� �, ����� ?7-� K%$�� �� �"� ��F � J��� �� K�%$�� ��F� �
���J� � , %��� �� .A�%9 ��F �� S���� ��%��� !�" 3%,����� %�$0� ��%��� ���� �,.
� ���� � ��4�8�� � ������� $#?9�: ���� EJ�*���� B$F��� '������ ���� ��� �1���� �����$� �������� ������ '��� =�� %,�� �����$��� �� �(% @� �(A�%9� '��
� � ����. � S���� � �7"; �J�% �% �� ������ ����� ��� � '�������(� 5�� � ������� !�; �������� J�%9�� '��%�F� '���� =���.
9 ��� �, ������ ���� % P�� '�� '������ �� �, ���7"G� �� )���� �/( �, � �0� ���9��� ���� � ��" �� C�"�G�� %$�7"G� �J�%� T�%@G�.
� ��F� � �� 5%F� �" �7"G�� '������ ��F �� ���� ��� ���7"G� �� ?�"�� =%� �� �, EF��> �/��� �� 4 5%F�... �(% @�.
� ���� � 48�7� >��* $? ��"���� �� ���� � m-commerce
)����(
E���� ������ '�" � ��I� � �1�� 5��0� �� �"���� T��" !�" �������� � ��%���� 3%����� E %� � �� ��$�� 5��0� ���$����
���"0�� ����(� ��: • ��� ����� 5�@� A����� '�"� ����9�� !�"�� �4�� � ���Q�A�%9�� �� ��" �, ��� ����� '����� �� ��" � • %,�� '�"���� ��� ����G ����� '��������� �� • '�" % ,�� ������� N����� � ��7�� ����9�� );?�%�I� ( � � ,�� ��"%� ��� �� � ��%��� �������� E� ���$��
A�%9�� �� ��" A�%�\�. • 5��� '�"� ����� 3� �� %�4���� 3%�4�� % �� ��9� � ���%�� ���%����E�A�%9�� �� ��" .'@%���, �� �� ���%9��
����� �$�4����F��� � ��" ����� ��9�9� ����� ��� ���� �F �������� ���� ; �� 3%9����� ��� ����� 5�@� N����3� ��� ./( .
• )���F� '� � ��%���� 3%����� �L� � ������� '<$�)� ����( 3%����� '��� � � T % W��( ��� ��, �/� ���: % @ ���0� )�*�� �, �������� � ��%���� % � ���$� % -0� %�" �����$��� ��%; ���� )�*�� ������� ��� D �
�,�*;. • �������� ��� ����� ������� ��� � ��� %,�� '�". • 3%��1�� ��� � T% ��� '�"�� ��7�� ��� ����� �"��4 ��F �� ������ ����� W������ � � % $���.
�J��� % 9�!�;�7�� 3%����� % 4� �� �������� � ��%��( � ]�������/( ���]����� ?�$F��� ��� ��� %-�� L�F� /�L .
Universal Knowledge Solutions s.a.l
11
B �C �� %"�C � ��� �:
�����# � ���3 �D �8?��"� ��8�& ������� � ���"�� �
������� � ����� � : �"���� �4�" �%� ����� �"������ �� J�� �"���� �A����� �F7" �A����� �F7" ��, �� ��E �� �)����� ���41�� ��"���� �
������� �"������.
����: � ��7�� ����9�� �� D��-�� � ��� �" D��� E ����, �������� �� ����� ���� �, ���� E *����� %-�� ��� � ��7�� ����9�� �$�
T��� !�" % � ���� � ��7�� ����9�� � ��� �"�. ���� �� A���� �/( �, � P� � ��7�� ����9�� � �0� �$�%0� )���0� �� ./( �, �������� �� ����� �� �"���� !�" 2%$��
����9��.
������� ��!�: !�" �41�� �/( �, 5�� �� 2%$� :
€ � 4�9�� � ����� � ��7�� ���9��(WPAN) € � ����� � ��7�� ���9��(WLAN) € �* %$�� � ��7�� ���9��(WWAN) € 9 � "��4�� %��F0� ��� (Satellite)
Universal Knowledge Solutions s.a.l
12
�����# � ���3 �
� ��7�� ����9�� �� D��-�� � ��� �" D��� E ����, �������� �� ����� ���� �, ���� E *����� %-�� ��� � ��7�� ����9�� �$�� T��� !�" % � ���� � ��7�� ����9�� � ��� �"�.
A���� �/( �, � P� � ��7�� ����9�� � �0� �$�%0� )���0� ����� �� :
1 X � 4�9�� � ����� � ��7�� ���9��.(WPAN) 2 X � ����� � ��7�� ���9��(WLAN) 3 X �* %$�� � ��7�� ���9��(WWAN) 4 X � "��4�� %��F0� ���9 (Satellite) .
�����# � ���3 � $? �����
�$�� � ��7�� ����9�� '���K�%@0� �� � .��O�9�� ��� � �7����� '������ �4��� �" ?7 �� �� �0� K$� �, ����9�� ./( ���+�� ' � ��� � �L�� =%�� �� �� �,��$� �" ���� ��� ��%�9�.
� J% � "�� !�; � ��7�� ����9�� ' ��� '���: X ���� � ��� � ���3: �� ���� ����9�� 2 �4��� �/( ����� ���9� ������ ����� �( ��� 3����� ���� � PWLAN
�A��� � P� ������Y���E� ��� ��$������ !��� ��� � � 4�9�� � ����� ����9�� ?�* � 2 �4��� �/( ��� C%��WPAN .?3��" ����9�� ./( ��$� 8 �%��� !�; ����� � � ����%� !�" N%� �� "��4�� K�%@b� �(���� ��� %����� �
��� ��$��� �� � ���. 2���� &��� �� 3%,����� ����%���%�[ � �( ?�"� 9 ����%��� ./( %-�� ����2.4 A���� �� �, ?�� %�� ������� % @ ��%(�P � '��$�� . ����%��� '����� '� W�/�5 ��%(�P � �40��%(�P � .
X ���* � ��� � ���3:�� +��� � � �� =���� ����9 '����" �� ������ � ��� % 4��� =���� ����9 E � P�� %��� �����
���9��. > �� ?����@+�������� ���7�� ��4�� '��� ���� ���%9�� ��F �� ����9�� �� )���� �/( ' . ����9�� �� )���� �/( ���
�� �� ���9 ���� �$�� ����� !�"�� ��<,����� ����� ��� !�" !��. �� )���� %-��( ?�"� 9 =���� �� � � ��7�� ����9�WWAN� ��* %$�� � ��7�� ���9��.
����" =��� !�" ��� ��4�� !�; ������ ��" ����O��9�� �� ��� � "��4�� %��F0� %�" � ��7�� ����9�� ?7�?� �-�� .
�����# � ���3 � $? ����� )����(
?�/;��� %-�0� �$�%0� )���0�, �( =���� 3% 4���� �� � �� W�� � P� ����� ��%�/ ��� � ��7�� ����9�� ?�%�9
WPAN,WLAN,WWAN,Satellite����9�� ./( 8J�4� '(� H*� ���� �� �� ,� .
Universal Knowledge Solutions s.a.l
13
��3 � E�" �*2� � ����� � ���6� � ���� � ��" � �?�� ����� �
(WPAN) ����� 3��"10%����
������ � 4���� �" � �� ' ����9�� �, �7�����
� 4�9��
�*1���?���
0.1-4
Mbps IrDA, Bluetooth, 802.15
(WLAN) ����� 3��"100%�� � ����� ���9�� E��� ��$�
��� ���� ���9�� �" � �� � ���
1-54
Mbps
802.11a, b, g,
HIPERLAN/2
(WWAN)
!�" � P��� ���� 3��" %-�� '������ �� � =���
������
� ����� ���9�� E��� ��$� �$1�%� 8 Kbps-2
Mbps
GSM, TDMA, CDMA,
GPRS, EDGE, WCDMA
(Satellite) Global coverage � ����� ���9�� E��� ��$� �$1�%�
?���
2 Kbps-
19.2 Kbps TDMA, CDMA, FDMA
��%�/ ��� � ��7�� ����9�� ?�%�9��� %-�0� �$�%0� )���0�, �/;�( =���� 3% 4���� �� � �� W�� � P� �����
WPAN, WLAN, WWAN, Satellite����9�� ./( 8J�4� '(� H*� ���� �� �� ,� .
������� � ������ � �������
�"� ��$�� � �: �" �����$� �,%$� ���� �� ��7�� ����9�� ������� ��$��� � � 41� �,%$� ��� � ��� % � � 5� � ,� '�, �1������ � ��7�� �� ����� ��� 2%4�� ���� �� % ��.
� � ��%�� �����%��� �" ������ ���� � ��7�� �� ����� �, 8�P�� ��F. ������� � ������ �:
����9 �, � ��7�� �� ����� �� � �$�� ����WWAN, WPAN, WLAN� � ��%�� ������� '������ �������$� . / 1���./( � ��$�� N%� ������ '� �� �" T� � � � ��% ���� !�" ���� ��� � ��� . > �' �%��� '� � ��$�� ./( !�" T�
(Modulation) . .� ��� ���� ��� ' �%��� � ��" �, �������� �� ����� �� � �$�� W��(� � ��$1�� D � �� B�� "��F� �� ���� ��.
���� �( �$J�9�� ' �%��� �� ���� �: X ���= � ��4� � ��� � �"��:���� N� ��% ��%� '������ ���� ��� ������� ��%\� �� *�� ������ ��<�� '��� .N%��
>��� ��%��� A��� !�" �<,�����+������� �� ?�� * ' .N%� ����%� 3�" !�" � ����� 3�" � P9�� ������� )�*�� ����� >��� � ��I� H�4��O9%>��� H���>��� W�� ��" ��%�9G� �� ��$��� �+%3������ ����%��� !�" ��. �� �� ��%9 ������
��%��� ���� ����� H %4� !�" �4�� �� 5� �� *�� ������ � ��� '�����. X �3�"� � ��4� � ���� �"��: ��� �4� �, � ����� ./( '��� ������ K%" � ��$, � � �* ������� �� �� F�-�����
�� ���0�� � ����"=%�� ��� �� . �� * ��%� ���� !�" 3���$��� W��� �� %��� ���� K%" W���� ��,� ���� �����
Universal Knowledge Solutions s.a.l
14
>��� ��F �� ?�,�9��� ���� =�F� 3%�9;�����%��� 3%�9G�� �4���� ��%9I��� 2%$� ���� �7. ��������� S �*� 3%9����� ������ � ������� '���� ���� 3%�9G� W�� �� �; ��%� ���� �7������ ��" �7������ ��� �
3%�9G�.
������� � ������ � ������� )3%9����� ������ � ���(
��������� ��� � ����� ./�� �7�9 W��( ���%��� ���1F � ��� ��( � %9����� ������� � ���
���� � ��4�< ��"�� FHSS :��� � ����� ./( '��������%��� !�" �$ % 3%�4� ��%����� '�� ������ T * �. �%��� �� �� '�$ ��������� ����%��� � �9�� � ����� ./( �, �������. � !�� B�� �( 3%�1����� ��%� K�%�"� '�� ��%_� 3%,��� =%�0� ����%��� �<� ����� ��� ��%; � ��" 3��"; '��, ;. ��� �, ���� �� ����3� �� � � �� 3��F � ��� �����$���.
�� �������� ����%��� � �9� W��� ���� �7������ ������ ���� ��%G��S �*�� �� 3% 4F ���,� B�L�. '������ ��%G� ��$�� !4F0� ����FHSS( � �����1Mbps
�3�� � % ��� � ��"��DSSS: !�" 3%�9G� %9�� � ����� ./( '���� ����� 3%�4� � � ��%�� ����%��� �� �$�� ����. ��� )�� (B��%; '� W��( ) �� ( %%��
>%�� !� �F�F. �(%%*� ��� �, ���� ��� 3��$��� ����$� ����G�� ��� ���� �F�F%�� ./( �� ����� ����.
5� ��!�"� ���� K%" ?�* � �� � �� ��� ��. �� � /�� � ������� ������>��� 3%�9G� �\, 3%�9G� ���� ��$F+% � ���� ��DSSS��� � ������ K %" 2 $* S �*�N%�
B*,%. 5� ��DSSS �� %��� �F� FHSS �(�4F� �� F !�; ��%G� ��$� E,% ��� ���� 2Mbps.
������� � ������ � ������� (� � ��"��F?�=G������� � ���� � ����� �(OFDM)
./( �, '� �, �������� �1��� � ���� #��$� ��9� � ����� �� % � �����$��� ��%; �� % ��FHSS � �, �������� %�9����
DSSS.
��%; � ����� ./( �7� �� ��� T *� ���� K%" %�" ���� ��� �� !�"� � �� �$� ��� � � ����� OFDM ��%G ����� ���" ��%; ��$�� ���� ���.
Universal Knowledge Solutions s.a.l
15
������� � ����� ./( �, ���9 �, ���� T � ��� ��$4?�F� 5� ���7� �� !�"� � � ����� FHSS �DSSS.
����3 � �����# � ���3 � WPAN
� ��%���� ��� ����� � ������ '����� E,� ������� �, � ��� ����� ./( ��4�� !�; ������ �� � ���� !�; 5������ ��*$�� K$��� %�F %��L����%��� ��. ' ���� ����9 % � � !�" � �%��� �� �� ���� �% � ��" ./(��� ����� .
��� ����� ./( �" ��-�0� �%�� �� :� 4�9�� 5����� ��5������������� � � 2�������������� ���$�� ��� % -���� ��
=%�0� ��� �����.
�7��� � ��� ��� ����� W��� �% 3%�, ���� W�� !�; � ������� �,�*; '� � � ?�� �$� %��0� �������� ��"�� � ��" 3%9������ �����.
������ W��� ������� � 4�9�� � ��7�� ����9�� �%�<� ����9�� �� � ���� 8J�4��� �%�� ����WPAN �(:
X =���� % 4F ��4�� X �F� �� � ���� W7��� X �*1����� �1���� X 4�9 ����9� 4�9�� ��$�� ���� ��* ��4�� ��I� 3% P4 �.
���3 %& ������� � ������ � ������ � WPAN
������ 4�9�� � ��7�� ����9�� � � ��� % �$��� �� � �$�� �� W���� D �� � 3�F ��� ���� ���2$* ��� . K%$�� % �$��� ./( K$� ����� �� A���� �/( �,����� K�%@�����:
�����IrDA: ��$ A�%���� ��� �$90� '������ �1���� K1��� �������� ��4�� % �$� E*�� ���F ���� � ���$�� �I��� !�; %�4��� �/(.
%� $��� E*�IrDA ���� ����� '"�� ������%��� �� �"���� �5��������4�� 3����� . ,�� ������%��� ./( �� K%P�� ���� ��" �"%�� 3% 4F �,���� %<� � %�" � �� !�; � �� �� ��� ���� � ��� % .
'��������%� �IrDA�� aIrDA DATA �����$��� ' �� � �c� �a�� IrDA CONTROL'��� � �c� . ��� �� ��0� K%P��IrDA �,������� �4��� �" � �� ' ��� .�1� /; �� ������ ������ � �� �� � ����� A�%���� ��� �$90
Universal Knowledge Solutions s.a.l
16
��%; �� ����������� � ���� ��� ������ .��4�� �� )���� �/( 8J�4��� '(� K$� �� �� ,�: X �4 !�� ��4�� ����1 !�� ��4��� �� �0� K$� �, ����G�� ��� �;� %�� 2%�� X %� � � ����� ./( '���?� ��4�� ��� �, �F� �� % ,��� ��*���� !�� 20%�� �� . �F� �F� %� ��� �/( 5� � D �
=�4��� �F� ��� %��-�� ���� �� 2�$*� %9$�. X .���� �J��- ��4��. X � � ]��%�� ���� ��� ��%; �"%9600 bps � !��4 Mbps. X ����� ?�%�� ������ �1��� ���� ��* � ����� ./( � �*� ��� D � �1���� �*1��� � �����?����.
����� �� %� $��� �/( B��� ��� '@%��� ��� ��� ���� TJ��$�� �� % -��� W��( !��� �O�� ���� ��� '<$� � P� �� � ����� ./( �
�4���� 4�9�� . �7�� � 4�9 � � �� ��4�� �����$� ����� ���� �, ����� A�%���� ��� �$90� '����� 3%�, ���� �� ������ ��, � ����
� ������?7-� �$�� � ��4�� !�; ������ ��" ?�� �$� %-�� H�4� %��0� ���� � %9��� %<� � !�" ��4��� E �� �F ������ 5��� �J � �, ��� ��4�� ����� ���� ��� ����� � �� ��� ��� ������ �J ��� �,.
���3 %& ������� � ������ � ������ �
WPAN ���� � �BlueTooth
( D������ %� $��, �"� ��������� 5����� � � ���7�� ��4�� � 2����������d���� �=%�0� �������� ��� ����� K$�.
A�%���� ��� �$90� ���� �, .��<�� ��� 3% �P� 3%�4�� ��� ����� � � %<� � D����� � ���� 3������ ��� ����� 5� �� ��4����� ���� ������� %�" ��4�� � �L� E .
���� � ��$�� ������ �, ��4�� �,��10 !�� ��4��� ��� ���� %�� 1003%�9; ����*� '������ %�� .
2 �� D����� %� $� '��� 2.4-GHZ>��� % @ e�%��4�7� 8W��� ��� � !�; �4 ��� ��$� 720Kbps �, EF����� ���
� �� 5 %��� ������� !�; �4 � ����� ��$� E,% '10Mbps.
���� D � =%�� ���%9 ��F �� %� $��� �/( % � � '�B� ��%9 Ericsson �-� ���%9 ��$� ����$� '- �Nokia�INTEL� Toshiba �IBM� !� �� ��9�� aSIG�
(Bluetooth Special Interest group)"������ ./( !�; ���%9�� ./( �� � �$�� ��*�� '- �-� �Microsoft , Motorola,
Lucent , 3COM �=%�� ��%9 �1�� �� %-��.
!���3% �� %� $��� �/�� � ��%��� ��$F���� �������� ��4�� �" � ��� ��� ��9�� ��$ �[� !�� ��� �� D����� ����.
Universal Knowledge Solutions s.a.l
17
� � ����� ./�� 3������ ��� ����� ��� D � �J���� 2�9��� � �: D����� '�� �����" ���� ��* �$F���� 3���0� E �� 2�9��D �� �(�$� N%� 3���0� W�� � � ��4�� # L� .
2 �� �J���� � ����� �� 2����� K$� W��(2.4GHZD����� � ��� ��$�� ���� ���� ��� ����� �� � ���� '����� E� . ������
���9��� ./( 2Q%$���� D7- D����� %� $��� ��������� ����� ��:
��? ��3 �3��# ���� � ��4�8�� �: ��* %�: ���� N� �� � ����� ./( '��� N/�� ������ 2�9��� '� �L� ���� �/( H� ������.
����� ��3 �3��# ���� � ��4�8�� �:>�� 3���� ��� ���� �, ��� Z$>� �,%> �K$��� ��*$� 29��� �� ?�����+�� ' ���� �/(
?� � ������ K$��� ��*$� !�" 2%$�� �� 5@%� ���� D����� ��� ��� �� �"���� ���� ��" � �� 3%�4�.
�3��# ���� � ��H ��4�8�� �:%� % @ ������ ���� �/( �$� J=%�0� ��� ����� ��F �� 2�9��7� ���F % @� �.
���3 %& ������� � ������ � ������ � WPAN
����� �BlueTooth
���9 � �9� '� D����� '������ � ���� � � ��4�� '� �� ��PICONET �� 2�La�� �� ��� 8 %-�0� !�" 3���� D ��
?3%9��� ��4�� 3���0� W�� �� N0 ��� %�[� E� .
�� %-�� '����� �� �� 3���� ���- �� %-�� �� ����� ���9 2 �L��PICONET�� �>��� ���9�� !� ��� ��*$� E� S�3%-$� D �� 5 ����� ���9�� �, ��� ����� E ��� ��� ���;� �� �, 3������� W�� �,Piconet ��� ����� E� 5 ����� E ��
�� #1� �, 3������� aPiconet.
#�� �� �1�I� 3���� 3%-$�� ���9 ��� ������ ��9�� �,Piconet
Universal Knowledge Solutions s.a.l
18
'� �� �� ���9 � �9� '� D����� '������ � ���� � � ��4�� PICONET �� 2�La�� �� ��� 8 %-�0� !�" 3���� D ��?3%9��� ��4�� 3���0� W�� �� N0 ��� %�[� E� .
�� %-�� '����� �� �� 3���� ���- �� %-�� �� ����� ���9 2 �L��PICONET�� ���9�� !� ��� ��*$� E� S��>���3%-$�
D �� 5 ����� ���9�� �, ��� ����� E ��� ��� ���;� �� �, 3������� W�� �,Piconet ��� ����� E� 5 ����� E �� �� #1� �, 3������� aPiconet.
���3 %& ������� � ������ � ������ � WPAN
����� �BlueTooth
����� � ���� � �#��3� �BlueTooth � � ��" D������ 8���� %� $��� %� ���F � ����� ./( ���� ���� ��� ����� � � ���$��� ���*�SIG �7 �9��� �� �"���� � ���� �(��"13���� #�� T,� ��� ����� ./�� W%�9��� ��$�� ���*� .
3���� ���� A��L� '�� � � �9� �� ' �4� '�. ������� ����� � J% �7 �9� �$�%� ' �4� '�=%�0� �7 �9��� �� �" ���$� ���� � �0�. '����� �7 �9� �( � F���� �$��� �7 �9����� ����� ./( � ��� �(A�%�; ��� ���� �� ��$�� ���9� �� ��9 �" ���� �� %�$�.
Universal Knowledge Solutions s.a.l
19
D����� � ��� '���� 3���� �� % � ���� 3%��/��� �7 �9��� ' �4� '� '�� �, ���4 ����� ��" ���*� �� F %� $�� ��" ���*� %� $��� �/( !�" �I� ���� �� !�" ��� 5@% ���� �� �[� ' ��� E�4� N0 ��� N� K$��� ��*$� E� ��� �����
D����� � ��� '���� ���� =%�0� 3���0� E� ������ ��������. EF���� 3%� � ��� �7 �9��� ./( ��� �����$��� �� � ���com.bluetooth.www.
����� � %& $��7�BlueTooth:
( ��� �F0� !�" � ��� ���� � � '��� �� ��� �� 7, �7����� '����� �" ?7 �� ���� �� D����� � ��� �� ���� ��� ���� ���� %,����7����� ���� �,. 0� 8J�4� ���� �%�� ��� �, D����� � ��� �, ���) ���� ��OSI(. '� D � � �: � � � ��� '� '�, T � ��� =��� !�" ���
'������ T � ��� 5� 5�0� � �[� � ���� %� ��� � ��� ./( W%�. ������ ��* �� �� T��� � �: '�� W�/� ?�%19� ��� �� D����� '������ ��4�7� ��� .
�� ��� % 19��� ��%� '������ ��� � � � ]��%� �� � ]��1� '��� �� ��� 8 !�; 128� � . '������ �/( ��� � ��4�� �"% � � �*,0� ������� � ��� ���� ��� ���0� ��%� 5�����0� =���.
���3 %& ������� � ������ � ������ � WPAN
����� �802.15
����� �802.15:
(�� ��$� �(��� ���� 8J�4��� �� �"���(IEEE)� =���� 3% 4F � ��7�� ����9�� % �$��� % � �� � � ��7�� ����9��� 4�9��.
>��� ��14����� �� 3��1�� ��� %� $��� �/( E*�� A���� ��"+��� %� $�� #�L� ���� A�� '������ D����� � ��� �, ��802.15.
� %� $��� �/( 2�� ��� !�; ��4���� '����� # �� !�; � �� 3%�4)MAC ( D����� � ��� �� � J� � 1�� ��� �� W�/�T% � �
!�;���9�� !�" �������� ���$��� �-� E *��� . K%P�� �/��=%� �/�� �1������ �������� !�" ��$�� '��� ��"���� E�%� A�9�; �( %� $���:
X '��� �"����WPAN/BlueTooth X � '��� �"���Coexistence Mechanisms X '��� �"���� WPAN��$��� ���" X '��� �"����WPAN ��$��� K1��� –� � � %� � %�$� .
Universal Knowledge Solutions s.a.l
20
����� � �����# � ���3 � WLAN
?�"% ��"� ��� %-�� �� � ����� � ��7�� ����9�� ���� �$���4�� �"��4 ���� �, %� ��� �, .
������ '(� �7����� �� 5���� 2���� % ,�� ���� ����9�� ./( ��' ��� !�; �,�*G��� ������� � ��" �"%� ��%��� ��4�� . ���� ��� % -�������9�� ./�� ������ �������� ��'� �� %�<� .
�� �� ��� ����9�� �� )���� �/( ��� ��� % � � ��"� ���"���� � �� �����>����0� �� ������9� :
• ��*2� �: % F 24�� ���� ��� ����� ./( � P� �� 3��" � � ]��%� 50 �150?�%�� . • ��"�� � ��" �?�� : ��1 Mbps !�; 54 Mbps • ����� �:=%�� )���� �� ����9 E� ������� ��%� 5� . • �<�* � I#8���:�� � ��7�� ���9�� ���J��� ��F �� �F� �� W7��� 2��� B����� N/�� %� $��� 5. • ��� �: ���� ����� ��% �'������ %� $���.
���3 5����WLAN
����9 5 �%� C%�� WLAN� �$��� 3� �9 !�� ?��� � ��� W�� �� .
( ����9�� ./( 5 �%�� ��9 ���� ���9 ��J��� ��4�� 5 �%��� �/( �, ��� D � % <��� !�; % <��� ����� %-�� ���*$
K$��� . 5 �%��� �/( !� �� 3��"������ ��� � (ad hoc) . '� D � � �� C��� � �� ���� 5 �%��� �/( 5� � � 3%��; 5� � N� � ��%� 3��$� %�%��� !�; ������ ���� 3%9��� 3%�4� ��4���T�� ���";.
��� � 5���� �)Ad hoc( ��� N� ���� 5 �%��� �I����� 2� ���� ���9��� ��4�� � �� C��� � �� �,�*G�� ���I , � X 3� � !�;>� ��� ��� 3�" ��%�9
��4��E�� �� C��� � �� X?�4�� $ % ?� ?�$��� ��%�?�� ���� ./�� .
Universal Knowledge Solutions s.a.l
21
> Z*1 �5 �%��� �/( �,4�� �, � %�%��� � �L�� �$ ���� C����� ��� � P� ����� ���� �� ������ !�" )� ��� N� ��� ��� P��� ����� � �. E ���� ��� ��� ��� '����� 5 �%��� �� )���� �/( �, ��� ) �, '��� 3%�9; �� ��� �" 3%��" �(�
3%�9G� ��������-� 3��";( �������9��� ����� ��4�� 5� �� ��� W�/� +���� T ����� �, � ��7� ���9�� E ��� '?� �� 3� $��. %+���$> �������� �� J����� '������ ������� ���� .����� 3%�9G� ��%\� H�� ����� !�" ?�����"� ����� �J��( 2��� ��4 ;
=%�� C��� � �� !�; 3%�9G� �?�* � ���9�� ������ E �� 5 ��� ���.
N� ���� 5 �%���
���3 ������WLAN
�� � �$�� ���� ����9� �4�� % �$� E*� % �$��� �$*���� ��J ��� WLAN ��J ��� ./( '(� �� IEEE �ETSI � T ����� '�F
����� % �$��� ./��HomeRF
%��0� '���(� T��� � �� % �$� D7- W��(:
����� �802.11: ����9� B1 %$� '� %� $� ��� �$ WLAN%��� #1� %� $��� �/( '��� ���� � ������ �4���� ����>�����+�� ����9 �, ��
Ethernet� ���� . N� ��%�� ��%��� '������ ���7�� ��4��� H� B���� 2.4Ghz � �$��� �� ��� %� $��� �/( '"� FHSS �DSSS.
'"�� ���� �������� ���� �� �� % �� ��9� 3%9��� %� $��� �/�� �4���� ��� ����� �$� '� % �$���802.11a �802.11b���" ?�� .
����� �802.11b/Wi-Fi
��J�" �, ?�%�9��� % �$��� %-�� �� %� $��� �/( �$ 802.11x. � �[� %� $��� �/( '��� DSSS 2 �� '������ 2.4Ghz. ��� %� $���802.11b �"%�� !�; �4 �� 11Mbps � !�; �4� �,���100%�� . � W��( ����� ��$�� �,���� � � '�� �* ���� �� C%��1Mbps �,��� 100 !�; %��11Mbps �,��� 30%�� .
����� '�F(WECA) '�� 3���9 ���"\� WiFi ��*�� %� $��� '������ ��$ �� S��� ��" � ����; 802.11b �4�� %�: S��� E�
Universal Knowledge Solutions s.a.l
22
3���9�� ./( !�". ���3 ������WLAN
����� �802.11a: %� $��� �$ 802.11a �� %��� �"% %,� ?7 �� 802.11b � ��%��� '��� 5Ghz�"%�� �4� !�� 54Mbps.
%� $��� #�$�802.11 �802.11b � %� $��� '��� 802.11a )�� �� ' �%��� OFDM.
2���� ��%� '����� �;� %� $��� ����9 T,��� '�" !�; N�I �1���� ' �%� � �:802.11a� %� $��� ����9 E802.11b.
���� ��� ��� �"% E,% ���� ��� ��� �� � �$�� %� $��� �/( ���54Mbps?������� �F� ��%� '���� ?�%<� ������� �� � ������ . �� C����� � �� B P� N/�� !4F0� ������ K1��� �F��� #1� �, ����100 %� $��� ���� �, %�� 802.11b !�; 50� � !��25
%� $��� ���� �, %��802.11a.
T%1�� ?�* � �%� ��� �, %� $���, � %� $��� � � �F� �� W7���802.11a � ��� ��%�/ ��� '��� OFDM %��� �F� W���� ����� � ����� ��DSSS>��� %� $��� �, 3���$802.11b.
���3 ������WLAN
����� �802.11g: �� %� $��� �/( '�� ��%��� !�" � ��" �"%� ���7�� ��42.4Ghz %� $��� E� � �,����� !�" �<,����� E� 802.11b. /( !�; ��4��� '� ��� ��� .%� $��� ���$� !��0� � ��� T % �" 802.11g ��%��� !�" ��$� 2.4Ghz>��� %� $��� �, '���
802.11b � � �$��� )�� #1� '������DSSS��� ��� D � �"% !�" ��4 �4� !��11Mbps. ( � ��$, %-�� � �$� ���$�, � ��-�� ��� �� ����OFDM ��%��� #1� '������ 2.4Mhz ���� ��� ��� ��$� !�; ��4��� 54Mbps.
%� $��� '������ ����$�� C����� ���� ���9�� ��F� � E �� ?� ��"802.11b ���9�� ��F� � E� ��$�� �� C����� ��� '������ ����$�
%� $���802.11g ��� KO1�> %� $���� ��$ ���� N� 802.11b �(�4F� �� F !�; ���� ��� ��� ��$� 11Mbps .�/� ���� �� 5� %� $��� !�" ����" ��$ �� ��������802.11g �"% !�; ��4��� 54Mbps.
��9�� � P��� ����� �4���� W�� �-� =%�0� ������� B��9�� � %� $��� � � �802.11b �802.11g.
������ 802.11���7� : ����IEEE���(� �1���� ��A�%�\� �4���� =%�0� % �$��� �� �"���� : ����� �IEEE 802.11e. ������ 3��� ������ � �L�� 84���� � �L�� ���7�� !�" � ����"� ��/ � ��4 ��4�� !�" ��4���
E� ��,������ ��<�0� 802.11b. ����� �802.11f.��%� % � �� 84���� �C����� ��� � � �������� C����� ���. ����� �802.11h.%� $���� �4���� �$ %�� � J� � 1�� ��� �� � ��� 84���� 802.11a ��%��� !�" ���$�� 5Ghz �$��
%� $��� ��� ���802.11a � ��%�0� ��<�0� ���� ��� E*�� .
Universal Knowledge Solutions s.a.l
23
��� � ��802.11i ��� �� � ��� 84���� MAC %� $��� 802.11 �� ���� �� T����� �� �: � ��� � %�� 3�� �� W�/.
���3 ������WLAN
�����HomeRF: �, %� $��� �/( '� ��� ���� � �7�� � ����� ����9��� 8���� �4����� ������ ��� � �� .
%� $��� !�" %� $��� �/( # L� '�802.11 '������ FHSS� ������� 5�@� ���� ��� � P�� �7 �$��� K$�� '� ��� '� ���� . �� %� $��� �/( '��� �����%� SWAP) Shared Wireless Access Protocol (N/�� '"� '"� E� � ��" 3���� ���4�� ��4��
� ��7�� 2������� 8���� %� $���DECT� � � ���� '������ H� �� ��" � �L� E� ���9�� ��4�7�� 2����� � ��7�� � ����� ��������� %�<��� �-� �������� � 1����� ��� �������%�� 8 4�� !�; �,�*; ��� ���...g�;.
!�� � P� %� $��� �/( ����9� ��� D � ����� �"% �� %-�� %$�� ���" !�" %� $��� �/( �, � �%��� '�50 ?�%�� ��4��� !�; � �(�4F� �"%10Mbps.
��%��� ?�* � %� $��� �/( '��� 2.4Ghz.
����� �HIPERLAN/1 �HIPERLAN/2: ��4�7� ���%�0� % �$��� ��$� ]% (ETSI) %� $��� HIPERLANA��0� � ��" � ���%�� � ����� ���9�� N� .
����"� !��0� %� $��� �/( �� � ��� ]% '�!��0� %��� ��5Ghz ������ T � ��� � � !�; �4� '� � ��� ��� N� C���; '� '�( �������� ./. ��� ��%��� '���� ?�* � ��, %� $��� �/( �� � ��-�� ����� 5Ghz � � �$��� '������ ���OFDM ��� D �
�� � �,�� � P� %� $��� �/( T,� ��� �����150 ?�%�� � �(�4F� �"%�54Mbps��� �" %� $��� �/( ��% � 3��� � �� !�4�7� ������� J���� ��$�� � �%� $��� �/( ���$� ���� �������� ��� ����� �F� �� W7��� � �� !�" ��".
> '�+� ��� ����� �, �[� !�� %� $��� �/( T�5 %��� ������� �, % �� %�� ��� ��� ���� % �$��� ��� %��$ B���.
���3��?�"� � ���<7�
� P� ��/ ���9 ' ��� 2���� ��� D � ��� $��� � ��� �, ���� ���� ��4�� ���7�� ��4�7� � "��4�� %��F0� ��<�� �, % �1��� '�� ������� �� �"���� ��9� 3% ���� ���� 2��( �� %-�� !�; ������ ��� B���L� 5����� !��� C��� � �� �� ������ �� ��" !�;
=%��.
% �$� ��� '�WWAN 3���$��� ������� 2������ �� H*���� �� ���� �?� �-��� ����9�� ./( 5�@� ���� ��*�� ���%��� ./( �, ��4�7� %� $�� ��1� K%1� �� �� H�4� � "��4�� %��F0� !�" ��*�$�� �����.
����� %�9��� �� ���� �, ?�% �� ?�%�� %$�� %4�" 5$� � "��4�� %��F0� !�" 3���$��� 2�5�� �1�� �F0� ���� %,�� �, �-������
� � ���� 2������. �� � �$�� ��-� �/( '@%� � ��$, � "��4�� %��F0� ����9 ��� � � ����� ����� �,:
X ���C � A<��� � %& : ���� ����">� # � EF�� �� ���7�� ��4�7� 3%�%* W��( h�� NL� ?�� �( ��� ����9�� �� %�: )��
Universal Knowledge Solutions s.a.l
24
����$� 3� $� ����� �, ����" ��%�� E*��� ���� ��P��� 1��� ���%9 �, �����. X � ���� � ������� : � ?� ��4 ��4�� 8��9b� ��� D �� T%, ���� �, ��� '�$F�� �" %<��� KP� ���� ��� ��%;
/���G��D���0� ��� %�$�� =����. X ���� � :��� �( �, � ���$�� ��� D � � "��4�� %��F0� '������ ��4�� �� �� , 3��1�� ��� ���� ����� '(� �
%���0� �����'�$F�� �" %<��� KP� ��4�� ���*� ��4�� �� )���� �/( �� 3��1�� � 4����.
� � ���9�� ��4�� �� )���� �/�� ���� ��� ��� �"%2.4Kbps �2Mbps� '������ ���� 5�� W�/.
�=��� � �����# � ���3 � WWAN
������ !�" � ���� 5� � ������ ./( '����� ��� D � ��� ���-�� � ��� �, 3%� ��0 ����9�� �� )���� �/( ���$�� '�� � ��
� ���7� ���9�� ./( '����� '� ���� TJ�F���� ���� i����� ���� ��� � �� ?�%�I����9�� ./( %�" ����� '� ���. ����9 ��$� WWAN � ����9 #�$�WPAN �WLAN ���� ���� i��� � �� 5��� B�� N� �4�%� % @ ����%� !�"
�� ��%�. �� �� , ����9� �1������ )���0� ��" '�1� � %�%*�� %��,0� K$� K%$�� WWAN.
���C��� � ����39�����<� � ����39�:
9G� � �-����� 3%� :� � � ����� ��%�9G� �� )���� �/( 3��" �-� . �* %$�� � ��7�� ����9�� �� ��0� � ��� �, ��%�9G� �� )���� �/( '������ ��4�� ��4�7� W�/.
� �F%�� 3%�9G� :� ' ��� �� ��� �" 3%��" �(0 �1 ����%; '� ���� ���� �P 4 5%F� !�; ��4��� W�/ ��$� ���$��� 5���� ��J��-�� T ���� �(.
� ��7�� ���-�� � ��� ����9 �, ��%�9G� �� )���� �/( '����� '�. !�"� 3��� � �L� !�; �,�*; ?������ � ��$, %-�� � �F%�� ��%�9G� %��$��=%�0� ��� ���� �� � �$��.
��� � ������4� � ����:
��� �� ���� % W��( � ����� � ��$� ��(����"� '� 3%���� ���� :� ,% � � �J� � , ��4�� # L�� � ����� �� )���� �/( ���$� ���� ����9�� '���� �/�� 3%�� ��� %�� D �
��0� ��4�� A����� !�� %�: ��4�� N� ' ���� 3%���� ./( '����� � ����; '�" E� ��4��. �� �� )���� �/( ���9��� ��%�� ��" !�; ������ ������� L� ��%��� ��4�� ��$�.
'���� ����: � ��4�� ��4�� �, ����� �( ��� ����- ����%; '� ���� ���� ��� � �� ���� � � � � ��9� 3%���� ���� ��$������ ��� ���� �44���� ��4�� )���� �� � �$�� �, ���$, % @ H�4� ������ �, ����� �( ��� ���,�� �����$��� 5� '� D �
��%��� ���14 K�%$��. ��4�7� ��-�0� %��-�� !�" �"� ��� ��4�� #1� �, W�%�9� '���� �� %-�0 ��� � ����� ./( �,.
Universal Knowledge Solutions s.a.l
25
'�� !"�� A���� !�; ���� ��� ' ��� � ��$�� ./( '���B �; �%��� ����$� ��,%� ����%;� ��4�� %�" ��� ��� 3��"; '�� D � ��,�( !�; ��4��� !�� �1������.
�=��� � �����# � ���3 � WWAN
���-�� � �������-�� � ��� ���0� � ��� �( ���%� E�%� !�; �(%� � 5� �* %$�� � ��7�� ����9�� 2 �4� '�� 24���� � ���
D��-��
��7� ��� � ���31G : �/( %�< ��� $��� � ��� �, ����9�� �� )���� ���� ���-�� � ���.� ��4�� ��4�� �, � ��� �/( ����9 ������ �� ?����@.
�*1����� ��4�� 3��� ����9�� ./�� 5� $�� '(� �� ����3%����� �7������
%"�C � ��� � ���32G: ���� � �F%�� � ����� ���-�� � ��� ����9 ������ ����� !�; �,�*; � ��" 3���� � ��4 ��4�� ' ��� �, % �� ��9� ��"�
� �0� ���� ���. ������ ���� #1� !�" ��4��� � ������� �� %��� ��$� ����9�� ./( ��� � !�; �,�*; ���" 3%�4� ���9�� 3A�1� E,% �������
���9�� !�" ���0� � � E,%. �� � ��� ����9 '<$� '"�� ���� ��� ��� ���-
?� ��� �������� ���-�� � ��� ����9 '(�: ����9AMPS ) �������� �������� 2������ ����� 5 ?��� �� !��TDMA(. ����9CDMA IS-95� ��������� 3%19�� 5� ' ����� ��$���� ��4��� ����9� !� ��. ����9GSM) �������� ��4�7� '�$�� '�<��� (� �$ ?�"� 9 %-�0� ��<�0� ��. ����9PDC) ��F%�� �4�9�� N� ���� ( ���� �� �, E�� ��9� '������.
%"�C � ��� � ���3� �" �(2.5G)
D��-�� � ��� ����9 .����� � ,�*; 3� � � ��� �/( ���. 3%���� ���� '����� �� ������ ����9�� �� � ��� �/( � � �� �%�� �� ����� !�; �"% !�; ��4��� ��� ��� ������� � 144Kbps���-�� � ��� ����9 �, B �" �( �� 2�$*� 3%9" ����� �� N� .
� ��� �/( �, ����9�� '(� ��: ���9CDMA 2000 1x ���9GPRS
B �C � ��� � ���3: �, ����9�� ./�� '������ %� $��� � ���� � I% ��* D��-�� � ��� ����9 % � � ���������� E �� � ������� �� % -��� ����" ?�%<��
�1���� �� �������� )���0� ./( � P %� $� !�; ��4��� � ����� B�9 �� B�� %�< '�F0� ��<�0� E� � �,����� !�" �<,�����.
B �C � ��� � ���3 ��6"7 ������ E��& B#C J�? ����?�� �� I . � %!WCDMAD CDMA2000DEDGE
Universal Knowledge Solutions s.a.l
26
A�� � ��� �:
� ���� � ����*� � $��"������ � ��"�� ������� � ����� � :
��������� �� ��� ���� ��� �T � � ���%�
����: 3���� ���� ��������� ��� � ��� ���0� ./( '(� � P� ����� ./( �, ����� ��� ���� �� ���� 3�" �������� ��� � ��� ���$�
$*��� ���0� ./( ���$� ���� ��� � ��� �" &��-�� !�; ?�,�*; ���� �� �, 2.
������� ��!�: !�" �41�� �/( �, 5�� �� 2%$� :
• �������� ��� � ��� �1������ ���� ���� • ��������� �� j���
• ���� ���� ./( �� �� ���$� ���� ��� � ��� �� �"���� K�%$�� • ��%��� � ������������ .
Universal Knowledge Solutions s.a.l
27
� ���� � ����*� � $��"
�������� ������ �$ � � ��� �, ����$�� �� % -��� ���������"��� .��� � ��� W�� �� �� ����$�� W�� '(� ��.
�(� �������� ��� � ��� �� ��� C/��� D7- �" ����� ./( �, D����: X � ��7�� ��%��� X ��������/�� ; ��%���.
����*� � $��" ������ %& �CL� %� � ����� �
������� >�*� �: '��%��� �( �� ���������� AI( '( �� � ��� �� �� D � T � ��� �, '���>��� �� ���� !�" % �� ��9� � ������� )�� %-I
�(�$�� �F ���� '����� ��(� %�� �( ��� � �����.
E�"��4�8�� � : �T � ��� 3%,����� ��� ����� '"� � ����\� ��( % �1��� 5� � � ����; ��� ����� %,�� �(� �B$� ���$��� 5�0� ��� ����� �( ��
��4�� ��� ��I � %�: ���� E� �%�� C���� ���� '� ?3%9��� ���7�� ��4��. L� !�" ������ 3%��� T�$�� ����" T��� !�; 2�*�� �J�% ��%;� ?7-� ��%���� ��4��� ����� �F� �, ��" �� %-�� � �
SMS�F��� #1� �, .
���L� � ������:
• � �� '� � �� �( �(� k�I��� E� ��4�� � ��" ��� '�� ���� � �[� �( ��) ��4� ���$ ��4�� ����USB(k • (�� ����7�� ��4�� ���� �,�>��� ���9�� )�� �����)WLAN, WPAN, WWAN� � %��F0� %�" ��4��
� "��4��(k • �� (� '��� !�; ������� T � ��� �� ����%; 5� ���� ���� ��� � �� !�" .% -L� =�� ��� '+���>��� ��4�� )��
k�I���
���L� � ��"��:
• ( ���k������� � ����� '����� .%,�� 5����� ���� ��� '��
• �� 5� � �k�I��� '��� !�" '� ������ �������� � ,% �� !�" ��� ��� E*���
• !�" ���� ��� � ��� � ��$� 3%�%* W��( �� '� ���7�� ��4�� %�" �� ���� ����� �, ���� ��� � ��� N����� �� �(
Universal Knowledge Solutions s.a.l
28
������ � ,% k • � %��� ��9� D ����� !�; C���� �(� k���� ��� ���� ��� ���� ��� �( �� '�0� %�$� �����$� �, ����� �( ��
�k������� �, ����� �( ��� � �� D ��� � ��" �1�� '� k�4%����
• k3���� 3�" '� T � ��� !�; ��4��� � �� ���� '���� �� W��� �(
• k'����� � ��� 3% ����� ��� ������ #1� '����� W�%�9� � ������� ��� �(
• �� 5%�*� W��( ��� �(k�1������ �� ,% �� �� �I��� ���� ��� D ��� =
���L� � A� ����� �: • ������ � � ������� � ����; T � ��� %,� �(�k�4�� � ��%� ������ %�" �I��� �, '�����
������ � ��*�/:
• k�4�� ��� ��� ������ !�; '������ C��� �( • ( 5�� ��� ��� ��� �,�� � !�; 3%�9; ��%; �/�� B ����� 3����� � ��$�� N� ���� 2����� 3���� '����� ��� ��, '�����
kK%P�� • k?���P� '������ ������� ������ ��� ��� �, D�� N/�� ���
$��7�: • � ����%; A��-� ����� ���� ��� � ��� ��� 2 �� ��� � � ����� ��� � � � �:� ���0� � � �(��� k������ !�"
)'��������(k • � ������ �F% � ��" �" �/��� k��� � ��� 5����� %� �0� ��� ���% 1�� %��$� �(�kB"� *
����* � ��?:
• k�� ���0� ��� �F� �� W7��� %��$ �( • k�F� �� ���7�� ��4�� W7��� =�� =�� �� • � A��-� ����9 '� �� ��� �(� k� � ��� � %� � %,��� �(k��$�
����*� � $��"
��� � ��� ���� ��� E �� E� %,����� �� ���� ����� ���� ������� T�� �� �� ?�%��� . 2���� � � �* ����� 3%�%* W��( ��� W�/������ %-�0� �� �%��� !�; ��4��� � �����.
%*� �� ����G� 3�� � � �� ����� � �$� � � �F7$�� ������ ��9�� H*� ������ � ,% !�" S���%� � �-� 3%�.
Universal Knowledge Solutions s.a.l
29
�J��1�� �,%$� K%P� W�/� �1���� �� %��$� !�" )7 �� �� �� , '��� �� ��� �� ��� ���� �� %��$��� /�� T � ��� =��� !�" �(: 1 X � ��7�� ��%��� �� �� 2 X ��/�� ������ �� �� 3 X �%��� ��� � � �� ���.
�����# � �"��"�� $��"
/( B��9�� E� �� ���� �� �� � �����, ��� T%�, E�� �� �J����� '������ E� ��4�� � �: ��� . ���� ���� ��$�� T �� ��%�
/( �,�'����� ��" �� ���� ������� 2% �� ��� �� K%$�� !�" ������� ������ N��� �� 5� , �� �� K%$�� ?��� �� ! N%P4� ������ ��������� 2% �� =%�� S��%� � �-�. ?��� �� !"�� W�/� � ��� � ��� ./(T F%�� ������ ��� � �.
/�� � �0� %4��$����� ���� :
������ �ك � ه
��� �� �����
زیدة ا�م�نت
��� زیدة ا�
��� �ك � ه
�� ����� ������
Universal Knowledge Solutions s.a.l
30
M�2� � N����� � : �� ��� %�4��� ����" N��� 5� ��%\� K%$���� '�� URL'����� !�; . �� ������ ��L� '����� �(% 1�� K%$���� '�� D � % 9L� �P� ��9 !�"�������� ������ �9�9 !�" =������ %��<;. ������%� '���� �������� � ����� ���� ��� �,IP ���� !�; ���� �� � ���� 3%��" '����� !�; ���� W��( ��� HTTP '�
5��� '��� !�; ��� ���. %���# � 5� � ����:�� ���� '7�� �, �/( 5��� '��� ���� 8��HTTP5����� �%�� ��%;� . ����� ������ ���*�
'����� !�" 8�� ��" %� ; � �-� N%� ��1���� % 9L� ��P� '����� !�; ��*%$���� ./( ����� ?�%<�� ��1������ ��*%$����%\� '�F N/�� K%$���� 5� '����� ������ � �9� �, �"� 5� �� ��.
���L� � %& ��"�� � ����: ��4��� � �: ���$� D � �I��� �, ���� ��� %��4� !�; ��4���� ���7�� 5��� '��� '�� �� �� ��4� �� �: ����� ��4��� '��� ���� ��� � ��� T�$�� ����" !�" 3���$��� ���� ��� %��4��.
$����������# � �"��"�� $��" O���� �$���� :
; � ������ $�4 � �* J�? ������ ��C� J / ���� � $����J"�7� �� �. X �"��"�� ������ M. � ��*9� A����� ���� ��%��� !�" ��$� ���� ��� � ��� �$ � ������ �� ���� �/( ��I� D � X �&� P� � ������ � �8���:�� '����� !�" � ���$� � ������� '<$� �� D � '���� � � �, K%$���� ���. X ���L� � A� ������� �:��%��� ���$� ����� �� ���� �/( �, ?� J���� ���I� �� �0� '<$� �, � ������� � ��" H�4� . X N��� � A�4�� � $���� : � ��I� �1������ �������� 3���0� !�" ��*%$���� 5���� �������� ���F� � ��" ���� W�/�
'�����.
X �C��� � ��"�� �:( ���� ��� ./�� %�4��� ��� 3% �0� ������ ���� ��� ��� �� ���� �/( ��I� � 5��� '���� W��( ��� �������� 2% !�" � ���.
X $��7�:'����� !�" ����� ���� ��� ��� .
O���� �: X %��# � ������ : 5�*�� '������ ��4�� ���� ��� !�; ��4��� � ��" ���$4 ?��� �� ��9 ��� ?� ��� ������ A��-� 8�0��
�1������ ����0� � �.
X �*�� � ������ � �8��� : '����� 5����� % @ �� �$� ��� 3����� � �� � ��%�F � %P4�� ��*%$����%,�� �� ?����@%�4��.
X >�*� � @��� : ��% A��L� % �� ��9� T � ��� A�������9�� � ��$,.
X ���>�*� � ��:� %P4�� ��*%$���� �, % ���� )����� E� �� ���� �/( �-� �, ���9� T � ��� %����� � ��" ���� . /;��� ����� 3������� �� ��%� ����� !�� 5�� ��� %����� �� F� ��%����� ����.
X ��4!�� �: 5�� � ������� E �� ��" 2F�� '����� !�" �% � �F ���9� N�.
X 7�$��:2$*�� ��� ��� %��$� �F ����� � ��7�� 3%�h�$�� ���� 5�� W�/� �J ��� !�" ����� 3% ��� .
X ���� �: '���� ��4�� # L� !�; '������ %�% *� 5�� �� ���� �/( �-� �, ?��J�" �� �0� �� % -� �, �1���� H�4� ��� � ���.
Universal Knowledge Solutions s.a.l
31
�� ��� � ��� !�" ��-�0� '(� ���( �� ���� �/�� �����: 1X ������ 3%�����4%���� : ?� �: '�� D ����� � ��" ��� � �[� %�$0� ��� ���� ��� D��� !�" ��4��� � �(� �%�� D �
5��� '��� !�".
2X �����$��� �����.
3X � ���� ����� : C�%�0��� 5�$�0������0�.
4X �������� 3%�����. %�. � $�4 � $��"
� ��9 ���7�� ��%��� ��� � � �� ��� ?� �F ?7 �� ��/�� ������ �� �.
!�; ?�,�*; ���� ��� 3�"�F !�" ?3��" S���%��� �/( N��� ������ 2% �, B� �-� '� 8�� S���%� % � � !�" � ����� ./( ���$���$�� T ��.
�, ������ ��" � ����; ������ 2% !�" S���%��� �/( ���� ��$ � ���� N����4�� !�; ������ ��� ����. ������ '��� %�" �I��� �, ���� ��� 3�"��� ������ T � ��� �4� D � ������ � ��" A�%�\� �I��� E� ������� � ��" '��.
��4�� T % �" '�� �� �������� K%P� �4�� � ��$� ��� tcp/ip�� ���� ��4�� �USB.
�%� � �-� C��� � P9��� '�<�� �$��� �4�� ������ ���� 3%�%* E� T � ��� '"�� � P9� '�<� %,�� !�; ������� ������ !�" S��?�* � ?����� ?7 �� �,�� �P�� 3%� � ��� � � '����� ��� �� ��� ��� ���������� T � ��� '�� � �/(.
Universal Knowledge Solutions s.a.l
32
%�. � $�4 � $��" ��"���
%�. � $�4 �:����� T � � ��$�� T �� !�" N��� N/�� �. �"��4� � ����: E� �I��� ���� � ������ �, B���� 8���� N/�� �������� '��� !�; ������ T � ��� �� ���� ��� ��%; '�
�������� ���� ��� �� !��0� ����� � ��$�� ./( � �L�� '�� D � ������ T � ��� ���� �. ��L� � ��� � ��"�� � ����� : ��4�� � ��� '������ �I��� �, ���� ��� %�4� !�; ��4���� �������� '��� '��
��*1���. ���� ��� ����$� �� �I��� A����� � �� �������� '���� ��4�� �������� � ��" '���� �� ��� .
$�����%�. � $�4 � $��" O����:
%�. � $�4 � $��" $����: 1 X �� � �&�� ���"��� �0: �� !�" �I��� �����$� � �$��� ��$��� '������ %�� ��� ��4�� ���� '�" ��� �, !��
?��� ��% P��� ./( ������ '��. 2X �������� �8��� J"H: � ��% ������ % � � ��� D � �?7-� � 4�9�� 5 ��� 5��� ��� �, ��/�� T � ��� � �� � .
�� ����"� ��� ��� � P9��� '�<� ��� '�� ���� 2J�<��� �� � J�� �"��WINDOWS� �@ � �� � ������ % ,��� .
3X @��7�: �"%� S��$��� �"% !�" A��0� ���$ �� ���� ��� !�; ��4��� 3%��� ��4�� ������ �, A��0� �"�*; '�� �� ������� ������ !�" ���� ��� !�; ��4���.
4X �?4�� � �� ��� �:" �; �I��� H� ��� '����� �" ��$�� A5" �� 21�� '����� 2% �� ��$�� T �� / 1�� � ���1�� �F� ������ A�%9�.
5X $��7�: �� ����� � � ���� � �: T � � H�� ) '������������ ( ��� � ���� ��� ��%� �,% !�" 3% � %��� '����h�$�� ���*%, ���� 2$*�� ��� �� 2��� W��(� ��7�� ��%��� �� �� �, 3%.
6X ���� � : � ��" A�%�; ��" �, ��4�7� ������ 5�� W�/� !��0� ���� ���7�� ��4�� 2�� 2 1�� �� ���� �/( �, N%� !��0� ���� �����>��� A��-� ��������� ���� ��� � �� � ��� '� D �� 3% 4F 3���� ��������.
. � $�4 � $��" O����%�: ���L� � A� ������ � : ��� �%����� �� � ����� %-�� ?��F� �I��� ��� � �� ��/�� ������ ��� � � � � �������� � ��" 5� ��
���7�� ��%��� �� �� ���� �, ���7�� W�� !�;.
$�4 � �* $� Q��"� � ��C�:" ������ ������ !�" T � ��� 3%��;� � �-� � ��" %��$�� �" �(I�%�; ��� � ���$4 % @ � ���J����� �� % �� ��" ���� ��� �, ?�J�" H�4� ������ �$�.
����� � ������&:���% 1�� % � '��� ������ �������� ��� ������ 8�� � P9� '�<� '����� H�1 . ���� ���� �� '@%���
���� T � ��� � �-� A��-� ��� � � ��� D �� ���9��� ./��A5$�� �� ?�� �� 2�*� B��/ ��� ���9��� ���� �� ; ��. ���*� � ����? �����: � P9��� '�<�� �$��� � ��%� ��� � � ������ '������ �(����; �������� ��� ����� % � � � ��" N%��
Universal Knowledge Solutions s.a.l
33
��� ����� �� 3% �� �"����� �$��� �� ��%� % � � � ��" �$� ��� �B� $� ����� ����� 8����� � �� ���9� . ��P��� �%,� �-� ��$�� �4�� �" �������Java���9��� ./�� B� #L� ?7� .
���*� � ����� ����: )�� ��� �1���� %������ % � � ��%�� A�9�; � �(� �%�� � P9��� ��<��� ��� ����� )���� ��$� ��� �, ��� ����� ./( �� �%����� 2��� ���.
$��" ����*�%�. � $�4 �
� ����� ��� � ��� ��/�� ������ �� �� ��� � � '(� ��:
1; ����L� � ����� � >�&: E ��� � ��" ]��� %4��" '(� �� � ����� �����$��� !�" ��4��� � ��" �$� . !�; ��$ ���� 5���� ��4� � ����; �-�� /;
; �, ?��� �� �41�� � �� ������� B������ A��-� �����$���� ��$�� ./( '��� . � ����I��� ��$ ���� T%, ��� � � �O����� !� ��)SFA( �4�� �����$�� �1���� �����$� !�; ��4��� �� ��$ ���� 5���� �
HJ���� �%�$0� HJ���� ��������� ���������� ���$�� �����$�� �?���� ��� '�F ���� A�%9�� �� ��" �����$�� ��������, ��������������� �"��� ���� �����$��� ������ 5������ ��� D � ���4���� E ��� �� ��$� W�/�� �)������ �.
2; ����� � ��� � >�& ����*����"�� � A�� �����?:
���� ��� E�� � ��� !�" � ����� ��$�� T%, ��� � � �"���"0� �, ������ !�; ������ ��� �I��� ���� � E� �������� ����F��� W���� ���� � F%���.
3; ���� � ���"� � ����*�:
A�� b� !*%��� �" � � 41� �����$� ��� � ��� ./( �-� %,���\ ��14��� ����� ���"� ���� � �L��� ���%9 E� ������$���4��.
4; � ���� � �����"�� ����*�:
������� ���� �, � ���$�� 8��90� ��� � ��� ./( �"�� '����� �� ���� �� �, �(�*F ���� ��$�� ��"� � �� !�" �I��� =�� �7��� ./( �������.
����� � $��"
� � !�; B ������ ���%���� � %��� ��9 �� C%��� ���� ����90� �� � �$�� /�L� �� ��%��� �� �� ���$� ���� ��� � ��� ���
T � � !�; T � � ��%���.
������ 3%,����� ��� � ��� � ,�*; 3� �� ��; 3��" ��%��� � ��" ' T � ��� ���� �� ���.
Universal Knowledge Solutions s.a.l
34
��%��� �� ��� �� � �$�� %,�������(0 '��� �� �� ,: 1 X '����� '���� �� �� ��%��� : ���(� �� �[� �� � �$�� '������ %�: !�; '���� �� �J�%�� ��%; � ����� ./( �, '�
%���� ����%���� ��� �B ������ �J�% �-� � ��7�� � 4��� �J�%��SMS� �� %9����� ��%���IM ��%; ��� � � �, � ��Z�>��� �J�%�� ���� '������ T���� 8���� %�4��� !�@� ������ N���� ���� �J�%��EMS �J�%�� ������ ��� �
��� , J���� 3��$�� ������ !�" � ����� J���� 3��$�� �J�%�� ���� '�����MMS. �J�%�� E ���� �� % � '����� 2% �� �� J�%�; T % �" �J�%�� ./( � ��� '� �� ��� .
2 X %� �G� �J�%� ��� ����� :
����� '������ !�" � ������� !�; ����%; ��� ����� ���$ � � ����$�� �$ � �� ��/ �J�%�� )���� �/( ��9 ��� . �O������: ��9� �����$��� ��4� ���* �� ���%9�� � ����� ./(.
��� �� ������ �/( �, �������� �� ����� '(� ��HDML �WAP Push.
3 X T � � !�; T � � �� �� ��%��� � � � ��4�� N%� �� �1� /; ��%��� ]���� ?���� � '������ �"�1� ��� ����� �� % -��� �, �I��� '��
'������ ���� !�; ������ ��� ������ T � ����. ������ ��� �� T � � � �-� !�; ?�* � C��� B�0 ��/�� ������ �� �� ��* ��%��� �� )���� �/( E� .
� W�/ �, ��4�� !�; ������ ��� ������ !�" ��-��� T � ��� '������ ���% ��%\� '�� �� '������ ��� �F�� . W��� �����$��� ����%� B , '�� %�<��� ��% ������ T � ���.
T � � !�; T � � �� ��%��� � ��� � � �� *�� ��9 �� �� ,.
Universal Knowledge Solutions s.a.l
35
����� � $��"
T � � !�; T � � �� ��%��� �� �� ������:
����� � $�4: T �� !�; ?�,�*; ��J�%�� ��% !�" N����� T � ��� �" %�$ ������ ��� �� ��$��.
����� � ����:
%�: 2% �� �I��� �, ���� ��� %�4��� ���� �� ��%��� ����� ��4��� '�� N/�� '�<��� A�� '����� ���� �-� . �J�%��� 8���� ���%� G� '� ?��� �� ��%��� '��� !�" T� MOM.
�� ���� '������ ��<�0� ./( '<$� % � � '� �J�%�� �,JMS � ����"� ��/ ��" �4�� 3% �0� W�� ���� D � � ���%���<�0� ./( �-� % � �� � ��".
���L� � %& ��"�� � ����: ��4�� ��%��� '���� ��� � ���� ��� �"���� ���� ��� %��4� �� 3% �� �"���� E� �"�1���� ���"0� ��� � �� ��%��� ��<��
=%�0�.
$���������� � $��" O����
$���� �: A&� � ���"���/ :�J�%�� E,� � �: �7� �� ��/�� ������� ���7�� ��%��0� ��� � � ��" � �� ��� . ��%��7� ������ ?7-�,
��/�� ������ �� �� ��� �, �������� � ��" A�%�; 3%�%*� '������ %� �; ��� ����7��.
$�4�� ��R���� �: /( �, '�� ���%�� ��%; !�" '������ ��$ �� ��� N� %�<��� ��% �, ��$*�� �J�%�� � ��� �� ���� ��4�� # L� ��" �J�%�� B ��� 3��"; '�� D � ��4�� '�" ���� �, !��.
%��� � �������%��# �: � ����� ��4�� '������ ��$� �� � ����� ./�� ��� ��, ���7�� � � 5� � �� �� ��%���
���7�� ��4�� '���� !�; '����.
O���� �: ./( ���$� ���� ������ ��*�� W�/� ��*�� 3�J�, ��-� '� �� ���,�*; '�� 3��"� � %���; % @ � 1 � � ��� �( ��%��� � ���
?�� �$� ��� � ��� 3�� � 7� �� , ��*�� j��� � �����.
� N� !�" � ������� � � � �$9 � ����� ./( %��$� ��� '� �(����"� � � ��4�7� �44���� W�� A�� �1������ ��� � ��� �, � 8��90�� �� %����� SJ��� ��%\� � ���� K�%@0� � ��4�F� D���0�� � ��%��� K�%@0� �, W�/� C�%�0� ��I���� %�$� �4%�����'�0�.
Universal Knowledge Solutions s.a.l
36
��� �� S��� � �S���:
��3P� � ��2 ������ � �� �� ���"�� ������� � ����� � :
% � ��=������ �% 9L� �P� �3% 9L� ��14�� �% �$� .
����: � ��7�� ��� � ��� % � � �, �������� % 9L��� ��P� ����� ��0� � �� � "�*�� � P� ����� ./( �, ������ ����� ���-��
� � ��� �� ���=�����.
������� ��!�: !�" �41�� �/( �, 5�� �� 2%$� :
• � ��7�� ��� � ��� % � � �, �����>��� % 9L��� ��P� • =������ � ��� �� ���.
Universal Knowledge Solutions s.a.l
37
�����# � ��2� ������� � �� �� ���"��
� P�� �� � "�*�� ����� ./( �, :�, �������� % 9L��� ��P� ��0� ����� ��� � ��� % � � �� ��7��� �� ��� ���-�� ����� =������ � ���.
%���# � ����� � *��"�
�� �"���� ��� T � � A�9�; �, ��� )���0� �% 9L��� ��P� �� , ��� =������ �1������ � �%�4���3��$���� J����� ��1����� T � ��� ��$� ���$���� �1������.
?����@ ���� C� X '"�� ���� ��� ������� �������� 2������� �4���� ��� � ��� '<$� �,WAP X % 9L��� �P� !�" � �%��� !�; ; � a� ��<�� � P9� !�" 3%����� ��� ����� ��*� T � ���� 2������ T��� ��� �/; ��� �� ��� %�4�� K$�Windows CE ��Symbian OS " � �%��� �� �(��" �� 7, 3��$���� J���� %4��$� � ,�*; %4��" !�� �1������ ��� � ��� ��1���
a�MSWord.
��3P� � ��2 : % 9L� �P� !�; ?����@ L��� � ���� ��%��; ��� � � % � �� '��� ����".
�P� ������ �/( �, ?�"� 9 %-�0� % 9L��� ��P� � � �� HTML��� 5�@0 =������ � -�� !�" 3%��F ��, �-� ��*%$�IE� Mozilla� Netscape...
�-� ��P� '����� '� ��� D � ���7�� '��$�� ������ ����� � � ./( 2b�HDML �WML� HTML� CHTML �XHTML ��1���� ��*%$�� !�" ��,�%P��� EF����� T�$�� ��P��� W�� �� N� %� ��� ���� N/�� ����$��� ������� )���
4�� K%$�����'������ N%P. �2 HDML
�P� ���$�� ��%�HDML �, '����7� 3%� ��� �������� ��� ����� 5�@� ���� ?�%<� � ���9�� �� %�� �� �� �, � �� 3%�4�
�P��� ./( '"�� � ���9�� �� %�� .�������� 2������� �4�� % 9L� �P� A�9�; ��P��� ./( % � � 2�� 3%�1�� ���� �F�.
�9�� B�HDML E� HTML ������ ���� �$���� �� ����G� �� 5%��� ����� � ���� D � �� HTML.
���� 2$* ��� '(� ���HDML �(%,�� ����� � � � �P� %,�� ���� �, HTML �-� Javascript� �VBscript ������� � �(%,��WML �-� WMLScript �$� ��� �HDML 1�� !�" ; 3%��F % @ '+����>��� ������� ������ !�" %,����� T ���� /; # �.
��� �� � ��%� 8�4�� ; ��� � � ��� �%����� ��$�%� � ���� ��J�%�� � ���� �����G� �� T����� �-� �� ��" �\, W�/�5����� ���� ��� �� �� �� ��� E� ��� 5� ��� ������ ��� �� �(/ 1�� ��� � '����� � ��7�� ���9�� !�" ����� � !�; �������
A��0� K1�.
��� ��P��� ./( !�" /�c��� �� '@%��� ����G�� # � � �� %�� �, ��� ����� � 7� �� '�$� ����" 8�0��� �������� �" �*�P���
Universal Knowledge Solutions s.a.l
38
� !�" ����$�� ��*%$���� '���� ����HDML.
8��� ������ ����, ���% ���h�" �,�*; � � ���� '��� 3%HDML !�; WML ��� � ��� E� ���$��� ����G�� H�4 D �� a� �4����HDML '"�� ���� ��� ����� '������ WML.
�2 $? ��C�HDML:
�P�� ���%� 8� �" ��-� �� �� ,HDML�(%�< ���� �� ���� E� .
���%��� 8���: 1. <HDML VERSION="3.0">
2. <CHOICE>
3. <CENTER><b>Inventory Search</b>
4. <CE TASK="GO" DEST="#ProductSearch">Search by Name
5. <CE TASK="GO" DEST="#SKUSearch">Search by SKU
6. <CE TASK="GOSUB" DEST=inventorylist.jsp>Inventory List
7. </CHOICE>
8. <ENTRY NAME="ProductSearch" KEY="ProductName">
9. <ACTION TYPE="ACCEPT" TASK="GO"
DEST="ProductSearch.jsp?Product=$ProductName">
10. Enter Product Name:
11. </ENTRY>
12. <ENTRY NAME="SKUSearch" KEY="SKU">
13. <ACTION TYPE="ACCEPT" TASK="GO" DEST="SKUSearch.jsp?SKU=$SKU">
14. Enter SKU:
15. </ENTRY>
16.</HDML>
�� <�7�<HDML>����� 'F%� ���� .
'�> �, ���%��� 8���hdml ��4�� !� �� !�; ���F� �. ��� ��� N%� ���� ���%��� 8��� �� �$ ��� �(� �4�� =���� �" T���� ��-��� %h�$ .
Universal Knowledge Solutions s.a.l
39
€ � �F� � �4�� �� N����� �1, ���F� � �"���� ��% 9L���� 3������ W�� �( ��F� � D7- �� �� ����-� ����<Choice> �<Entry>
€ ��41�� ��14 ���� !�" �F� � �� E� ���$��� '� € H��HDML�1������ ��F� ��� � � ������� € 3% 9L��� '����� '� B�� ����-� �, <�7�<CHOICE>0� �� % �� �(� �'������ �� ��� !�" ��4��� ����_� �*,
��%�/ ��� �������� ��� ����� !�" ����G� � ��" ���$4� ?�%<� € �14���� '����� '�DEST� �F� ��� � ���� �2���� �4����. € 3% 9L��� '����� '�<Entry>H ��1��� ���� T % �" '������ �� ��+� !�" ��4��� .
!�; 3��$�� ��� �P��� ./( ��� �����$��� �� � ��� � ����� ��4���
pdf.style_hdml/styleguides/pdf/com.openwave.demo://http. �P� ���$�� ��%�HDML� �������� ��� ����� 5�@� ���� ?�%<� � ���9�� �� %�� �� �� �, � �� 3%�4� �, '����7� 3%� ��
�P��� ./( '"�� � ���9�� �� %�� .�������� 2������� �4�� % 9L� �P� A�9�; ��P��� ./( % � � 2�� 3%�1�� ���� �F�.
B��9��HDML E� HTML ������ ���� �$���� �� ����G� �� 5%��� ����� � ���� D � �� HTML.
���� 2$* ��� '(� ���HDML ���� �, �(%,�� ����� � � � �P� %,�� HTML �-� Javascript� �VBscript ������� � �(%,��WML �-� WMLScript �$� ��� �HDML '+����>��� ������� ������ !�" %,����� T ���� / 1�� !�" ; 3%��F % @ ; # �.
�%� � ���� ��J�%�� � ���� �����G� �� T����� �-� �� ��" �\, W�/� ��� �� � ��%� 8�4�� ; ��� � � ��� �%����� ��$ � ��7�� ���9�� !�" ����� 5����� ���� ��� �� �� �� ��� E� ��� 5� ��� ������ ��� �� �(/ 1�� ��� � '������ !�; �������
A��0� K1�.
��� ��P��� ./( !�" /�c��� �� '@%��� ����G�� # � ������� �" �*�P��� �� %�� �, ��� ����� � 7� �� '�$� ����" 8�0��� ��� !�" ����$�� ��*%$���� '���� ����HDML.
8��� ������ ����, ���% ���h�" �,�*; � ���� '��� 3%�HDML !�; WML ��� � ��� E� ���$��� ����G�� H�4 D �� a� �4����HDML '"�� ���� ��� ����� '������ WML.
�2 WML
�P� �� ��%�/� T�WML � ��7�� ��� � ��� �J � �� A�� �( WAE ������%��� �, B1 %$� '� �� 5� WAP.
Universal Knowledge Solutions s.a.l
40
# L� '�WML X #�$�HDML X �P� !�" XML���%4 %-�� �� , �@� 4�� �"��F �\, �/� .
%��$��WML �1 �� HDML��� ����� !�; ����� ����� � �� 3%�4� �(% � � '� �F� � 3���L� �������� PDA 2������� �
� �/�� 2������� �� � ����.
!���WML ��� � ��� % � � �, % 9L� �P�� �*,0� %� ��� ���$� ��� �������� ��� ����� ���%9 '<$� �� ������ '"��� �������� .� %��< E� ���WAP2.0 � ���$� ����XHMTL�P��� ./( %��� ��� '�$� % 9L� �P�� '����� �, .
�2 $? ��C�WML:
5 8���� ��-��� �, �(�� �% ���� �1 <��� #1� '�� ?�-� �� �� , K%$��HDML � �P� '������ ���WML 3%��� ./(.
���%��� 8���:
1. <?xml version="1.0" encoding="UTF-8"?>
2. <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
3. <wml>
4. <card id="card1">
5. <p align="center"><i>Inventory Search</i></p>
6. <p align="left">
7. <select>
8. <option>Search by Name
9. <onevent type="onpick">
10. <go href="#ProductSearch"></go>
11. </onevent>
12. </option>
Universal Knowledge Solutions s.a.l
41
13. <option>Search by SKU
14. <onevent type="onpick">
15. <go href="#SKUSearch"></go>
16. </onevent>
17. </option>
18. <option>View Inventory List
19. <onevent type="onpick">
20. <go href="Inventorylist.wml"></go>
21. </onevent>
22. </option>
23. </select>
24. </p>
25. </card>
26. <card id="ProductSearch">
27. <!--WML code here for Product Search-->
28. <p>
29. Enter Product Name:
30. <input name="product" emptyok="false"></input>
31. </p>
32. </card>
33. <card id="SKUSearch">
34. <!--WML code here for SKU Search-->
35. <p>
36. Enter SKU:
37. <input name="sku" emptyok="false"></input>
38. </p>
39. </card>
40. </wml>
<,���WML �, �������� ��F� ���� ���4���� �P 4 !�" HDML �� 3���� �4�� ?�* � N��� <�7� ��� ����-�� D7-��F� �.
2�� �P 4 B�9� ���� �P 4�� �<�7� ����� XML:
€ �� =%� ��� H %4��� '� ? �"�� -��� )��
€ 3% 9L���� �F� ��� �" H %4��� '�<card>� � '����� 3% 9L��� '<select> '������ %� � !�" ��4���
€ 3% 9L��� '����� '�<input> 3% 9L��� '���� B��9� ��9� '������ ��� !�" ��4��� <Entry> ��-� �, HDML
€ W��( % �� B��9� �, ��% 9L��� � �WML ���% 9L� HTML
€ '���WML ��F� ��� � � �����7� T% 3�" � 3% 9L��� '������ ��-��� ����� ���� �� % �� ���� ��4����<go> E� 3% 9L���<onevent>
�, B �" � �%��� 5� �� �%��WML( � /; ��% 9L��� E� ���$��� �, 3� �9�� ���%4���� �,7� 5� � ���% 9L��� �� T7@; �� ��% 9L��� � � ��$ ��� N� ����)K$��� ��*$�� ?����� ��d�$>� ���� �� 5� (3% P4�� 2�%��� ��% 9L��� '���� �� 5� ���.
Universal Knowledge Solutions s.a.l
42
WMLScript
��*��WML !�� � � � �P� WMLScript ����� �(� javascript �, HTML.
�O���WMLScript '�� ��� ������� 2% �� ��" T �� �,�*; �� A5$�� 2 1��� �%�<��� ��� � ���� ��� ��� �� % -���
� ��7�� ���9�� !�".
�������� '(� ��WMLScript: € ����G� �� T����� �� ��" € ������ ����� ���� �7 ���� !�; ��4��� � ����; :� �'� �,�*; � ����\�������� !�" '�F%0� � �� !�; 'F% € ��� E� �"�1��� � � E,%��$�� �/( �, '����� !�; ������ ��� ������ 2% �� %����� ��$�%�� �J�%�� � ���� '���
�P� '����� �� ����� ���WMLScript W��� ��1�� �, �������� ��� ���� � ��%��� 8�4��� E*�� �� 5� ���� � ��� �,
���7��.wmls
��C�: '����� �" � ��-� �� �� ,WMLScript
<a href="validateuser.wmls#foo($(user))>Validate User</a>
E����� ������� ���� ��( =%�foo 2���� �� validateuser.wmls.
� ����� ��4��� !�; 3��$�� ��� �P��� ./( ��� �����$��� �� � ����
pdf.guide_dev_wmls/50/pdf/com.openwave.demo://http
��*��WML !�� � � � �P� WMLScript ����� �(� javascript �, HTML.
�O���WMLScript A5$�� 2 1��� �%�<��� ��� � ���� ��� ��� �� % -��� '�� ��� ������� 2% �� ��" T �� �,�*; �� �� ���9�� !�"� ��7.
�������� '(� ��WMLScript:
€ ����G� �� T����� �� ��" € ������ ����� ���� �7 ���� !�; ��4��� � ����; :� �'� �,�*; � ����\�������� !�" '�F%0� � �� !�; 'F% € !�; ������ ��� ������ 2% �� %����� ��$�%�� �J�%�� � ���� '������ E� �"�1��� � � E,%��$�� �/( �, '�����
Universal Knowledge Solutions s.a.l
43
�P� '����� �� ����� ���WMLScript W��� ��1�� �, �������� ��� ���� � ��%��� 8�4��� E*�� �� 5� ���� � ��� �, ���7��wmls
�2 HTML
�P� '����� �, 3����� 3%�� ��%� ��� '<$� W��� HTML �� ��( ����� �1� ���� ���� 4�1� �, ���� �� W�/� HTML %��$��
�(��4� ��� ���� ��� � ��� % � �� 3��$�� �� ����; %� ��� H��� 3% �� ���%� '��� ���� � �0� % 9L��� ��P� ��.
���$��HTML �( � � � ��P� E� '�$� ��� VBScript �JavaScript ��� ��$�� �� A��� '� ��� �� ������ ���� ��P� �(� �� D ��� 3��"; !�; ������'����� �� =����.
��C�:
��P��� '������ B� ���F ��� B��9� ��-� �� �� ,HDML �WML � % 9L��� �P� '������ ���HTML:
1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2. <html>
3. <head>
4. <title>Inventory List</title>
5. </head>
6. <body>
7. <P align=left><FONT size=4><STRONG>Inventory Product
List</STRONG></FONT>
8. <br>
9. <br>
10. <TABLE cellPadding=3 border=1>
11. <TR>
12. <TD><STRONG>Product </STRONG></TD>
13. <TD><STRONG>Quantity</STRONG></TD>
14. <TD><STRONG>Price($)</STRONG></TD>
15. </TR>
16. <TR>
17. <TD>Sony TRV30
18. <TD>17
19. <TD>1699.99
20. </TR>
21. <TR>
22. <TD>Hitachi VMD875L
23. <TD>24
24. <TD>599.99
25. </TR>
26. <TR>
27. <TD>Sony DCR-IP7BT
28. <TD>11
29. <TD>2199.99
30. </TR>
31. <TR>
32. <TD>JVC GR-DV2000
Universal Knowledge Solutions s.a.l
44
33. <TD>4
34. <TD>1599.99
35. </TR>
36. </TABLE>
37. </BODY>
38. </HTML>
K%$�� !�" ���%��� 8��� �/( �� �� %�<�Microsoft Mobile Internet Explorer��9�� �, ��� ������ :
�P� '����� �, 3����� 3%�� ��%� ��� '<$� W��� HTML �� ��( ����� �1� ���� ���� 4�1� �, ���� �� W�/� HTML %��$��
�(��4� ��� ���� ��� � ��� % � �� 3��$�� �� ����; %� ��� H��� 3% �� ���%� '��� ���� � �0� % 9L��� ��P� ��.
���$��HTML�$� ��� �( � � � ��P� E� 'VBScript �JavaScript ��� ��$�� �� A��� '� ��� �� ������ ���� ��P� �(� '����� �� =������ D ��� 3��"; !�; ������.
�2 CHTML
�$�CHTML ��P� %-�� �� HTML !��� �� �$9 � J���� HTML���� �, ������� ������ 5� ��$ � ����>��� i-Mode Z��>��� ���� �� �, ��4�� ���%9 %��� �� ��NTT DOCOMO =���� !�; ��4��� �, � ������� ������ ./( �"�� D �
�������� '������ �7� �� ��%���.
� � �����7� ?�� ��� � ������ �P� �" 3%��" ���� �� ���� �,� �P��� ./( !�; � �� N� �,�*; %� '�HDML �WML !�; XHTML.
Universal Knowledge Solutions s.a.l
45
%���"� � $� � ����� ����$�� /�� '� �P��� ./( A�9�; ��": € a�� ��F �� ����$��� �� ��" �, �F� �� W7��� K1� !�; B������ �3%��/�� � ����� �� , ��� ��� ����� � �����CPU �
3������� %��<G� ���� !�; ?�,�*; € ������� ������$���� ���%� ��� � � ��%��� � ��" � �������� ��� �� ��" �FL� �� ��$�� A�%�; € �������� � ��7�� ���9�� �" � �7���
' �4� '�CHTML �� 4�� !�" ?�����"� ���� ��9� W3C � E� !�� ���$��� E �� �1 1� ���$� !�" ��� ��9� � �%��� ���
T � ��� ��� ���$� !�"� �3������� %��<G� �� ����;.
%4��$�� '(��P��� ./( ����"� ���� : € %�4JPEG € )���0�� � ��� �1������ ���0� € �� 1����)� ����L��%�4( € ���0� ���14CSS
����"� �� '@%���CHTML !�" HTML #�� !�" �(I�9�; '�$� �� �� ��� �(� �� % -��� ���, ���� ; XML.
3��$�� ��� �P��� ./( ��� �����$��� �� � ��������� ��%�� !�;
19980209-compactHTML-NOTE/1998/TR/org.3w.www.
�2 XHTML
�P� %��$��XHTML �� ��� HTML ���$�� XML % 9L� ��P� ���$� ���� �� ����� '<$� B��� W�/� �X�%��� ����� ��������� ��� ����� ���7�� X�$�� �� ����; �� B���� ��� �P��� ./( '"� ������ !�; .
�������� ���"0�� �������� � ��%���� ���"0� ��� � � % � � ���� �3� � ��� � �P��� ./( �� , H��� ���� ������ '(� ��.
��� �����XHTML1.0 a� � �%�� % �$��� ��� !�; W3C '�" �, 2000 � ���� � �(� �HTML4.01 � E� ���
� �� E� ���,��� ���*� �"����� K$� �,�*;XML.
�.�� XHMLT �A��XHTML �P� %��� 3%�4� �h ��� ��� ��9� HTML 2�9��� �� ����; W��� ���� ��*%$���� !�� ����� D ��
���9� ��� ��$� ��$�� �� A� �0� ������.
Universal Knowledge Solutions s.a.l
46
�� �� ��XHTML $? HTMLT 2����XHTML �" HTML� ����� � �0� ����� �, :
X ���14 T �� %� �� 5� XHTML �"���� ?��,� � � ��9� XML X E ��� ��� H �4 ��9� K$��� ��*$�� ��% 9L��� 5 �$� %� �� 5� X ��% 9L��� '���� �� 5� �3% P4�� 2�%��� ��14���� X % 9L��� E �� T7@; 5� �, ��XHTML �, T7@; 3% 9L� '���� ���� W�� !�� HTML <BR> �, 5���� ����
XHTML <br/> X ��%�9; ��* ��% 9L��� ' F E �� %4� %� �� 5� < > X �� -��� )�� �" H %4��� 5� .
��C�:
������ HJ�%9�� �, �%���� ��-��� #1� �� �� , � $�� �P�� ���XHTML
1. <?xml version="1.0"?>
2. <!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
"http://www.openwave.com/dtd/xhtml-mobile10.dtd">
3. <html xmlns="http://www.w3.org/1999/xhtml"xml:lang="en">
4. <head>
5. <title>Inventory List</title>
6. </head>
7. <body>
8. <p align="left"><font size="4"><strong>Inventory Product
List</strong></font></p>
9. <br/>
10. <br/>
11. <table cellPadding="3" border="1">
12. <tr>
13. <th>Product</th>
14. <th>Quantity</th>
15. <th>Price($)</th>
16. </tr>
17. <tr>
18. <td>Sony TRV30</td>
19. <td>17</td>
20. <td>1699.99</td>
21. </tr>
22. <tr>
23. <td>Hitachi VMD875L</td>
24. <td>24</td>
25. <td>599.99</td>
26. </tr>
27. <tr>
28. <td>Sony DCR-IP7BT</td>
29. <td>11</td>
30. <td>2199.99</td>
31. </tr>
32. <tr>
Universal Knowledge Solutions s.a.l
47
33. <td>JVC GR-DV2000</td>
34. <td>4</td>
35. <td>1599.99</td>
36. </tr>
37. </table>
38. </body>
39. </html>
�P� %��$��XHTML �� ��� HTML ���$�� XML % 9L� ��P� ���$� ���� �� ����� '<$� B��� W�/� �X ��%��� �����
�������� ��� ����� ���7�� X�$�� �� ����; �� B���� ��� �P��� ./( '"� ������ !�; .
� � % � � ���� �3� � ��� � �P��� ./( �� , H��� ���� ������ '(� ���������� ���"0�� �������� � ��%���� ���"0� ��� .
��� �����XHTML1.0 a� � �%�� % �$��� ��� !�; W3C '�" �, 2000 � ���� � �(� �HTML4.01 � E� ��� � �� E� ���,��� ���*� �"����� K$� �,�*;XML.
�.�� XHMLT �A��XHTML �P� %��� 3%�4� �h ��� ��� ��9� HTML 2�9��� �� ����; W��� ���� ��*%$���� !�� ����� D ��
���9� ��� ��$� ��$�� �� A� �0� ������.
���� ��XHTML $? HTMLT 2����XHTML �" HTML� ����� � �0� ����� �, :
X ���14 T �� %� �� 5� XHTML �"���� ?��,� � � ��9� XML X *$�� ��% 9L��� 5 �$� %� �� 5� E ��� ��� H �4 ��9� K$��� �� X ��% 9L��� '���� �� 5� �3% P4�� 2�%��� ��14���� X �, ��% 9L��� E �� T7@; 5� XHTML �, T7@; 3% 9L� '���� ���� W�� !�� HTML W <BR> �, 5���� ����
XHTML <br/> X ��%�9; ��* ��% 9L��� ' F E �� %4� %� �� 5� < > X " H %4��� 5� �� -��� )�� �.
�2 XHTML-MP
( �� T,� � ��7�� ��� � ��� �J � ���$�� %� $� �, ����WAP2 a� ������� � �9���� !� �� XHTML� � B �" T� ��XHTML-MP.
�P� �� � J�� �"���� � �9��� �/( %��$ XHTML( �� 5� � .��� N/�� 2 %$��� �, �%��W3C.
�2 VoiceXML
� =��; �(���"�*�� �� A���� �/( �, %�/�� T��� ���� ������ % 9L��� ��P.
Universal Knowledge Solutions s.a.l
48
!�" � ��� % 9L� �P� �" 3%��" �(XML K%$�� �" ?�*�" 2����� T % �" 5��� ��� � � =���� !�; ��4���� H�� 5��� . �P� % 1�� '�� ���4 K%$�� K%P�� �/�� '���> VoiceXML) � 5��� K%$�� �$1 ��� ?����� �-� ��P�
XHTML� �WML( W%�� '������ '�� '- �TTS'������ !�; �����$��� B�� � ��4 !�; 8��� � ���� '�� N/�� .
��4�� ���� �, ����$�� ���%9�� �� % �� ��" �� '"��� �P��� ./( !����� �-� �������AT&T� Motorola �IBM � � �$���(% @.
��� �7 41��� �, K��� �� �P��� ./(��P��� ./( �-� T � �� 8���� �� ���� H*� ��9 %��<\� �1��� ���.
$? ��C�VoiceXML:
�P�� ���%� 8�� � ��-� ��% \� '���VoiceXML: 1.<?xml version="1.0"?>
2. <vxml version="2.0">
3. <meta name=" author" content=" Martyn Mallick"/>
4. <form>
5. <block>
6. Welcome to the voice time entry system.
7. <goto next="#options"/>
8. </block>
9. </form>
10. <!-- allow user to choose one of three options -->
11. <menu id=" options" dtmf=" true">
12. <prompt> What would you like to do? Say one of:
<enumerate/></prompt>
13. <choice next="#entry">add entry</choice>
14. <choice next="
Universal Knowledge Solutions s.a.l
49
http://www.timeentry.example.com/vxml/delete.vxml">
delete entry</choice>
15. <choice next=" http://www.timeentry.example.com/vxml/list.vxml">
list entries </choice>
16. <noinput count="1"> <reprompt/></noinput>
17. <noinput count="2"> Please state what action you would like
<enumerate/></noinput>
18. </menu>
19. <!-- collect data for new time entry -->
20. <form id=" entry">
21. <catch event=" nomatch noinput" count="3">
22. <prompt> Sorry, too many attempts. Please try again later.
Goodbye. </prompt>
23. <throw event=" telephone.disconnect.hangup"/>
24. </catch>
25. <field name=" jobtype">
26. <prompt>What is the job type for your entry? </prompt>
27. <option>design</option>
28. <option>development</option>
29. <option>meeting</option>
30. <option>travel</option>
31. <option>vacation</option>
32. <help>You must enter a valid job code to continue. Your options
are design, development, meeting, travel, and vacation.
<reprompt/></help>
33. </field>
34. <field name=" hours" type="digits">
35. <prompt> How many hours for job <value expr="jobtype"/>?
</prompt>
36. <help> use the keypad to enter the number of hours worked
</help>
37. </field>
38. <field name=" proceed" type=" boolean">
39. <prompt>Do you want to proceed with the entry for <value
expr="hours"/> hours for job type <value expr="jobtype"/>? </prompt>
40. <filled>
41. <if cond=" proceed">
42. <prompt bargein=" false">
43. Your entry is being entered into the time system.
44. </prompt>
45. <!-- submit time entry to servlet for entry into database -
-
>
46. <submit next="/servlet/entry" namelist=" jobcode hours"/>
47. </if>
48. <clear namelist=" jobcode hours proceed"/>
49. <goto next="#options"/>
50. </filled>
51. </field>
52. </form>
53. </vxml>
Universal Knowledge Solutions s.a.l
50
�� -��� �� � ���� ����� ���� ��( <�7�)XML (���� '- �� -��� H�, 3% 9L� ���<vxml> .( ���( B �" � �%��� ��� �� ���� ��
� �� ��4 3%�4� %� ��� %�/� ��; � �� % ��L� '�� ����G� � ��"�� 1����� H ��1��� ���� �� 'F% %� ����. �2 XHTML-MP
( �� T,� � ��7�� ��� � ��� �J � ���$�� %� $� �, ����WAP2�9���� !� �� a� ������� � XHTML� � B �" T� ��XHTML-MP.
�P� �� � J�� �"���� � �9��� �/( %��$ XHTML( �� 5� � .��� N/�� 2 %$��� �, �%��W3C.
�2 VoiceXML
��"�*�� �� A���� �/( �, %�/�� T��� ���� ������ % 9L��� ��P� =��; �(�. !�" � ��� % 9L� �P� �" 3%��" �(XML�� K%$�� �" ?�*�" 2����� T % �" 5��� ��� � � =���� !�; ��4���� H
5��� . �P� % 1�� '�� ���4 K%$�� K%P�� �/�� '���> VoiceXML) �-� ��P�� 5��� K%$�� �$1 ��� ?�����XHTML� �WML( W%�� '������ '�� '- �TTS� !�; �����$��� B�� � ��4 !�; 8��� � ���� '�� N/�� '�����.
��4�� ���� �, ����$�� ���%9�� �� % �� ��" �� '"��� �P��� ./( !����� �-� �������AT&T� Motorola �IBM � � �$��
�(% @. ����� � �� �� ���"��
�� �4���� �� ����� K$� !�" )7d � �� ��� �� �������� � ��7�� % 9L��� ��P� '(� !�" ��$�d � �� �$�=������ � ��.
� � ��� ��� � ��7�� ��� � ��� A�9�G �� ����� ./( '+����� . T �� E�� �I��� ���� � E� �"�1� �� �: �� ����� ./( �� �� W�����
���� ���� 3���� � �� ��� � � A�9�G �������� %� ��� �"� ��� ��� W�/� �'����� !�" E*����� ��$��.
( ���O����5� �� ��%\� '�F N/�� ������� ������ �$ � !�" � ��� �1���� ������� A�9�; �� ?�* � �� ����� ./ . ���� T � �� ��� /; ��P� '������ ������ ?7-�HDML� ��WML� ��XHTML ������ 8�0��� � �(0� 3� �9 � �� 3� ��� ./( ��9� D �
� � N%� ���� � ���� ��� � ���� ������� �� E�� %����� �(% .
./( =��; �, %� ��� =�� 3%,����� ��%������ %�%��� �/( ��% �� ?����@ ���� ��(��� %� ��� 5$4�� �� H�4 �� ����� ./( )��� E�1� ����� � ������ ��� � ��� � ��� �� ?�4�4� �I��� �, �������� =%�0� �� ����� �"������� ��� ����� !�" ��1� K%
� ��7�� ��� � ���.
�(� �� ����� ./( �� �"���� ����� �� A���� �/( �, K%$��:
X Perl – CGI
Universal Knowledge Solutions s.a.l
51
X Java servlet
X Java server page
X Active server page
X XML E� XSL Stylesheets
����� � �� �� ���"�� ; CGI ������� PERL ;
� ��� %��$�CGI ��� )���� %-�� ��� 5��� ������ )���� E �� �, ?�� %�� ���"�� �(� ?������� =������ � ��� �� .
N����CGI ��14 �� ���� ��� ����$�� '�� N/�� S���%���� 5��� '��� � � ��4�� � �L� �, �$� ���� %���0� �� �"���� 5��� .� EF����� A�9�G �%,�� ���� �� ����� !��� �� � ����� ./( �$��� � ��� ��.
��1�� / 1�� %� Perl8� �P 4� 3��" ��� N/�� ���-�� =������ #�$� �� ���� ������ . � ��� ���1���� ./( / 1�� A��-� �N%� � �� ��� � ��9� =������.
S��%� ����� ��� CGI �( ?�%�9��� ������ �/( �, �������� ��P��� %-�� ���� �P� � L� C/C++ �Fortran � E� ���Perl
�Java . �P� %��$�� /;Perl �P� !�" � ��� C���� =�� !�" � %� ��� �� 2[� ��F �� �(% � � '� D � . �P� �P��� ./( �$�� ����$� � ��" !�; C���� ���� N� 3%1�� �-� =%�� ��P� !�; ��� 3� � ./( �$� D � ��m� � $ � �� �P���� ��1�� !�; � ���C
�Fortran
� ��� �, 2$*�� ��� '(� ��� ����CGI S���%��� �" ��� A�9�; � ��" N%��� =�� !�" N%� 5� �� E� ���$��� �� �,
BJ��� K�1���� '����� 2����� ������� N�I ��� ������ �4�� ������� ����� 8 4��� 5� ��� ������.
��C�:
�P�� ?�����%� �� �� , �%��Perl �4�� � ���� '�� WML3� �� �F� � N���� .
1. #!/usr/bin/perl
2. print "Content-type: text/vnd.wap.wml\n\n";
3. print "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
4. print "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\" http://www.wapforum.org/DTD/wml_1.1.xml\">\n";
5. print "<wml>\n";
6. print " <card id='card1'>\n";
7. print " <p>Hello Wireless World!</p>\n";
8. print " </card>\n";
9. print "</wml>\n";
Universal Knowledge Solutions s.a.l
52
�� �$� =� S���%��� �/( �, '���� '� ���� <�7� Print %G 5� � ������� C%��� �/( ��%; N%� D � S���%��� �� C%� ��B��%; '� ��.
Java servlet
��%9 ���FSun Microsystem '�� � ��� ' ���� Java servlet� �J�" ������ : 3�" !�" ��$�� TJ�"� �A��0� TJ�" ��(��4��.
!�; ���%��� 8��� ���%� � ��" � ����� ./( �, N%�� �� �� ���%Bytecode �,�� ��: '������ .%��� B���%� N%�� N/���
� *�%�,�JVM5��� '��� !�" .
�P�� 5������ ���%��� 8��� ��� �, � ����� ./( �"��Java servlet N��� ��" �4�� � � !�; JVM . N%� , A��b� ������ ��� N/ 1�� W�� A�9�;(Thread)� ��$ D � 5� ��� �%����� %,� ��� ���� A����� ��" W����� ./( '����.
'����java servlet �, �4� ��� B��9� ��9� �,�� ���% CGI?� � ��� � �������� � ���� .
��C�:
� ��� '����� !�" � ��-� �� �� ,Javaservlet. %�� '����� ��-��� �/( �, <�7�Import�� ������ ��% � a� �4��Servlet .% � � '� N/�� ��$�� %� ; �� A�� ��9� �����
� ?��,�J2EE . '����� <�7� ���out.println'������ ������� C%��� ��%G .
1. // Import the required Java libraries
2. import java.io.*;
3. // Import the required Java Servlet libraries
4. import javax.servlet.*;
5. import javax.servlet.http.*;
6. public class HelloWorld extends HttpServlet
7. {
8. public void doGet(HttpServletRequest req, HttpServletResponse
res)
throws ServletException, IOException
9. {
10. res.setContentType("text/html");
11. PrintWriter out = res.getWriter();
12. out.println("<!DOCTYPE html PUBLIC \"-//OPENWAVE//DTD XHTML
Mobile 1.0//EN\" \" http://www.openwave.com/dtd/xhtml-
mobile10.dtd\">");
13. out.println("<html
xmlns=\"http://www.w3.org/1999/xhtml\"xml:lang=\"en\">");
14. out.println("<head>");
Universal Knowledge Solutions s.a.l
53
15. out.println("<title>XHTML Servlet</title>");
16. out.println("</head>");
17. out.println("<body>");
18. out.println("<p align=\"left\"><b>Hello XHTML Wireless
World!</b></p>");
19. out.println("</body>");
20. out.println("</html>");
21. }
22. }
��%9 ���FSun Microsystem '�� � ��� ' ���� Java servlet� �J�" ������ : 3�" !�" ��$�� TJ�"� �A��0� TJ�" ��(��4��.
�� �� ���% !�; ���%��� 8��� ���%� � ��" � ����� ./( �, N%��Bytecode �,�� ��: '������ .%��� B���%� N%�� N/���
� *�%�,�JVM�� '��� !�" 5�.
�P�� 5������ ���%��� 8��� ��� �, � ����� ./( �"��Java servlet N��� ��" �4�� � � !�; JVM . N%� , A��b� ������ ��� N/ 1�� W�� A�9�;(Thread)�%����� %,� ��� ���� A����� ��" W����� ./( '����� ��$ D � 5� ��� .
'����java servlet��9� �,�� ���% �, �4� ��� B��9� CGI?� � ��� � �������� � ���� .
���� � ���� � �&�� �����
JSP
%��$��JSP ������ ���� ��$�� �4�� �" �7��� 3� � !�" ��4��� � % N/�� %� ��� N%��� ���� Servlet #1�� � % � ��,�� �P� '������ ��$�� �F���.
%��$�JSP14��� 3���� � ��� �������� % 9L��� �P� T� ��* 5�� ��� ��$�� T �� C�%�; ��� B�� N� ��� . ����$� ��( %��0�,
�P� ��* % 9L��� �P� C�%�; �" ?�*�" /;Java �, Javaservlet% 9L��� �P� ��* � ��%� 8�4� C�%�; '� .
���14 �� ����� ��� JSP � �� � 1 �4� !�; 2e�4�� �� :
X ���"� �: a� �� �9 ��% 9L� �" 3%��" �( XML S���%��� % !�" 3% �� �, '����� ��,�� T �� N���� . W��(��( %4��$�� ./�� )���� ���:
o �������� :( �������� ����?7-� ��14�� B���: <%@page import=”java.util.*” %>
Universal Knowledge Solutions s.a.l
54
o ��� %4��� : )�� �� ����� �" H %4��� ���� �, ���Date �, ��-��� �/( Date theDate = new Date();
o ��% �$��� : ��14 C%� ��* �� �� %9��� C�%�; �" 3%��" �(JSP
<%= new java.util.Date() %>
o ��4 4��� : ��% �$��� B��9� ��9� ��$�� ?�� �$� %-�0� !���� �, '���� ����� <%
String queryData = request.getQueryString();
out.println("Attached GET data: " + queryData);
%>
o ��$,0�: � �� '����XML� ��14 �, 8� C�%�\� ��$,L� '� ��� W%��� '����� � =%�� !�; ��14 5� � ����=%�� ��$,�.
<jsp:useBean id="inventoryBean" class="sample.InventoryData" />
X 5 ��� � �������:" �� %�: A�9 N� �( �(%�/ '� ���� %4��$�� �� .� W%�� ��� �� 3��"JSP �����$��� ./( � �1��
�( ��� �(% %��� .
��C�:
��14 H*� ��-� �� �� ,JSP % 9L��� �P� ��9� C%� � ���� '��� HDML
1.<%@ page contentType="text/x-hdml"%>
2. <%@ page language="java"%>
3. <!-- string declaration -->
4. <%! String item1_id="101"; %>
5. <%! String item2_id="102"; %>
6. <%! String item3_id="103"; %>
7. <!-- HDML code to display Inventory list -->
8. <HDML VERSION="3.0">
9. <display name="item1">
10. <action type="accept" task="go" dest="#item2" label="Skip">
11. <action type="soft1" task="go"
dest="details.jsp?product_id=<%=item1_id %>" label="Details">
12. Sony-TRV30 Digital Video Camcorder
13. </display>
14. <display name="item2">
15. <action type="accept" task="go" dest="#item3" label="Skip">
16. <action type="soft1" task="go"
dest="details.jsp?product_id=<%=item2_id %>" label="Details">
17. Hitachi-VMD875L Digital 8 Camcorder
18. </display>
19. <display name="item3">
20. <action type="accept" task="go" dest="#finish" label=" finish">
21. <action type="soft1" task="go"
dest="details.jsp?product_id=<%=item3_id %>" label="Details">
22. Sony-DCR-IP7BT Micro MV Network Handycam
23. </display>
Universal Knowledge Solutions s.a.l
55
24. <display name="finish">
25. <action type="accept" task="return" label="Done">
26. <!-- Java scriptlet -->
28. <%
29. String username = request.getParameter("user");
30. out.println("Thank-you for visiting "+ username);
31. %>
32. </display>
33. </HDML>
%��$��JSP��� ������ ���� ��$�� �4�� �" �7��� 3� � !�" ��4��� � % N/�� %� ��� N%��� �Servlet #1�� � % � �
�,�� �P� '������ ��$�� �F���.
%��$�JSP�������� % 9L��� �P� T� ��* 5�� ��� ��$�� T �� C�%�; ��� B�� N� ���14��� 3���� � ��� . ����$� ��( %��0�," /; �P� ��* % 9L��� �P� C�%�; �" ?�*�Java �, Javaservlet% 9L��� �P� ��* � ��%� 8�4� C�%�; '� .
���14 �� ����� ��� JSP � �� � 1 �4� !�; 2e�4�� �� :
X ���"� �: a� �� �9 ��% 9L� �" 3%��" �( XML S���%��� % !�" 3% �� �, '����� ��,�� T �� N���� . W��(����( %4��$�� ./�� )���� �:
o �������� o ��� %4��� o ��% �$��� o ��4 4��� o ��$,0�
X 5 ��� � �������:�(%�/ '� ���� %4��$�� ��" �� %�: A�9 N� �( .� W%�� ��� �� 3��"JSP �����$��� ./( � �1��
�( ��� �(% %��� .
���� � �����ASP
��� W��� ����9� ��%�F � ����� ./( W���� �P� ������ �JSP 2% �� ��������� � ��%��� 8�4���� % 9L��� �P� � � S����� '��� ��,
���7�� ! $ ���� 2�� �, '�����.ASP
'����� �� %��� � ��$, � ����� ./��CGI '��� !�" ��$�� !�" 3%��F �(� IIS3��$���� � / 1���� W����� �J � '"��� .
� ����� ./( '����� '� � ��� '����� ��FJSP ?�%�9��� E�� �(� � ��P��� �� � "�� E� �������� ��� Java script �VBscript.
Universal Knowledge Solutions s.a.l
56
��C�:
�, '������ ���%��� 8��� ��-��� #1� � $� �� �� ,JSP � '������ 3%��� ./( ���ASP.
1. <% response.ContentType = "text/vnd.wap.wml" %>
2. <%@ Language=VBScript %>
3. <!-- variable declaration -->
4. <% Item1_id="101" %>
5. <% Item2_id="102" %>
6. <% Item3_id="103" %>
7. <?xml version="1.0" encoding=" UTF-8"?>
8. <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
9. <wml>
10. <card id="item1">
11. <do type="accept" label="next">
12. <go href="#item2"/>
13. </do>
14. <do type="cancel" label="details">
15. <go href=" details.asp?product_id=<%=Item1_id %>"/>
16. </do>
17. <p align="center"><b>Inventory Items</b></p>
18. <p> Sony-TRV30 Digital Video Camcorder </p>
19. </card>
20. <card id="item2">
21. <do type="accept" label="next">
22. <go href="#item3"/>
23. </do>
24. <do type="cancel" label="details">
25. <go href="details.asp?product_id=<%=Item2_id %>"/>
26. </do>
27. <p align="center"><b>Inventory Items</b></p>
28. <p> Hitachi-VMD875L Digital 8 Camcorder </p>
29. </card>
30. <card id="item3">
31. <do type="accept" label="next">
32. <go href="#finish"/>
33. </do>
34. <do type="cancel" label="details">
35. <go href="details.asp?product_id=<%=Item3_id %>"/>
36. </do>
37. <p align="center"><b>Inventory Items</b></p>
38. <p> Sony-DCR-IP7BT Micro MV Network Handycam </p>
39. </card>
40. <card id="finish">
41. <do type="accept" label="start over">
42. <go href="#item1"/>
43. </do>
Universal Knowledge Solutions s.a.l
57
44. <!-- VBScript to get URL parameter -->
45. <% userName = request.queryString("user") %>
46. <p> Thank-you for visiting <%= userName %> </p>
47. </card>
48. </wml>
��$�� %� ; ���$ � ����� ./�� � �� %��4; %�< �, � ����� ./�� 3% �0� ����� �( ����� ./( � �.NET �(� �� � �$�� '��
A��0� ��9� ���� ��� ������ %� $���. ����� ./( ���� �F �J � ����"� ���� �, 5�0�%� ��� � Windows '���� � P9��� '�<� E� � ������� �� ��%� !�"� W��� �����
5���� �� ��%�Microsoft =%�0� .
�P� ������ ���� W��� ����9� ��%�F � ����� ./( W����JSP��������� � ��%��� 8�4���� % 9L��� �P� � � S����� '��� ��, 2% ��
���7�� ! $ ���� 2�� �, '�����.ASP
'����� �� %��� � ��$, � ����� ./��CGI '��� !�" ��$�� !�" 3%��F �(� IIS3��$���� � / 1���� W����� �J � '"��� .
� ��� '����� ��F � ����� ./( '����� '�JSP ?�%�9��� E�� �(� � ��P��� �� � "�� E� �������� ��� Java script
XML � *��"7� ����� �������XSL
% 9L��� �P� ���� � � ��� � ��� �( ����� ./( �, �� �" 2%$�� ���� 3% �0� =������ � ��� � ���XML ���14 ��1�� '������
���0�XSL.
�� ��� �� %� ��� �, <�7�CGI �javaservlet a� �� ��� !�; ASP �JSP�(0� ��� �� �4, ���� W�� % � ��� � ��$� 2�����G� %�F �(%��<; � �: �" ���� ���.
���14 T���XML �XSL ' ����� � � ���� �4, !�" �"�� �/; � ��" 3A�1�� 2���� ./( � !�" ���� �/( T�1� D � ���� ���
����ASP �JSP������ �/( �, .
��14 �, ���� � �� �� ��� �/; ��-��� � � !�$, XML � �1���� % 9L� ��P�� ���� ��� ./�� C%� !�" ��4��� ���WML
CHTML �XHTML ��14 A�9�; !�; A����� � ��� ����� XSL��P��� ./( �� 3���� ��� �4�� .
��C�: 2�� �" ��-� �� �� ,XML 2�� '������ 2���� �/( ���� � ' ���� '��� D � XSL.
Universal Knowledge Solutions s.a.l
58
<?xml version="1.0"?>
<inventory>
<product id="101">
<name>
<manufacturer>Sony</manufacturer>
<model>TRV30</model>
</name>
<description>Digital Video Camcorder</description>
<digitalstill>1360 x 1020</digitalstill>
<format>Mini DV</format>
<quantity>17</quantity>
<price>1699.00</price>
</product>
<product id="102">
<name>
<manufacturer>Hitachi</manufacturer>
<model>VMD875L</model>
</name>
<description>Digital 8 Camcorder</description>
<format>Digital8</format>
<quantity>24</quantity>
<price>599.00</price>
</product>
<product id="103">
<name>
<manufacturer>Sony</manufacturer>
<model>DCR-IP7BT</model>
</name>
<description>Micro MV Network Handycam</description>
<digitalstill>640 x 480</digitalstill>
<format>Micro MV</format>
<quantity>11</quantity>
<price>2199.99</price>
</product>
<product id="104">
<name>
<manufacturer>JVC</manufacturer>
<model>GR-DV2000</model>
</name>
<description>High-Band Digital Video Camcorder</description>
<digitalstill>1600 x 1200</digitalstill>
<format>Mini DV</format>
<quantity>4</quantity>
<price>1599.00</price>
</product>
<product id="105">
<name>
<manufacturer>Canon</manufacturer>
Universal Knowledge Solutions s.a.l
59
<model>ES8200V</model>
</name>
<description>8 MM Camcorder</description>
<format>HI8MM</format>
<quantity>37</quantity>
<price>399.00</price>
</product>
</inventory>
24� ���� ��� �������� �� �"���� N��� )���� �����$� 2���� �/( �-� �%$ �� �� ..g�;
2�� ����� �[� �����XSL 2�� �, 3�%���� ���� ��� ' ����� � ��" � �9�� XML. 2�� �%� 8���� % �� �,�*; �� XML 2��� XSL ���� ��� �� ���� !�" �4��� 5�� ��� ��$�� ./( '�� ./( �,�*\� � �
!�; �P 4�� 2�� � ���XML: <?xml-stylesheet href="inventory.xsl" type="text/css"?>
2�� =����� �% �� �� ,XSL 2�� ���� � C%� � ���� '�� N/�� XML % 9L��� �P� !�; WML
1. <?xml version="1.0"?>
2. <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3. <xsl:output method="xml" indent="yes" doctype-
system=" http://www.wapforum.org/DTD/wml_1.1.xml" doctype-public="-
//WAPFORUM//DTD WML 1.1//EN" />
�� -��� )�� 2 %$�� ?�� ������ �9� H*� 5��F 2 %$� !�; ����� 2�� �� ����%��� '� ���� ���� ��� �XML
4. <xsl:template match="inventory">
5. <wml>
6. <card id="inventory">
7. <p align="center">Inventory Items</p>
8. <p>
9. <select name="productId" multiple="false">
10. <xsl:apply-templates select="product"/>
11. </select>
12. </p>
13. </card>
14. </wml>
15. </xsl:template>
% �$� '����� ���F <�7� ��� )������ �����$� %��<\� 8���� 5����� ���� � ���� ./( �, XSL ��$�� �����$� ��<\� 8���� 3������� ������ �, �(Product
<xsl:apply-templates select="product"/>
Universal Knowledge Solutions s.a.l
60
3��$�� �����$� %��<; � 1 � ��� ��-��� �/( �, ������ A���� Product� % �$� '������ W�/XSL <xsl:template match="product">
% �$��� '�� � � �,
<xsl:variable name="product_id">
'�� ����� 2 %$��Product_id �� B��* E* �� ��id 2�� �� �(��% ��� '�� ���� XML % �$���� <xsl:apply-templates select="@id" />
16. <xsl:template match="product">
17. <xsl:variable name="product_id">
18. <xsl:apply-templates select="@id" />
19. </xsl:variable>
20. <option value="{$product_id}">
21. <xsl:apply-templates select="name"/>
22. <onevent type="onpick">
23. <go href="details.wml">
24. <postfield name="product_id" value="{$product_id}"/>
25. </go>
26. </onevent>
27. </option>
28. </xsl:template>
29. <xsl:template match="name">
30. <xsl:value-of select="manufacturer"/>-<xsl:value-of
select="model"/>
31. </xsl:template>
32. </xsl:stylesheet>
% 9L��� �P� ���� � � ��� � ��� �( ����� ./( �, �� �" 2%$�� ���� 3% �0� =������ � ��� � ���XML ���14 ��1�� '������ ���0�XSL.
�� ��� �� %� ��� �, <�7�CGI �javaservlet a� �� ��� !�; ASP �JSP �4, ���� W�� % � ��� � ��$� 2��(0� ��� �� �: �" ���� �������G� %�F �(%��<; �.
���14 T���XML �XSL ' ����� � � ���� �4, !�" �"�� �/; � ��" 3A�1�� 2���� ./( � !�" ���� �/( T�1� D � ���� ���
����ASP �JSP������ �/( �, .
��14 �, ���� � �� �� ��� �/; ��-��� � � !�$,XML �� ��P�� ���� ��� ./�� C%� !�" ��4��� ����1���� % 9L
WML CHTML �XHTML ��14 A�9�; !�; A����� � ��� ����� XSL��P��� ./( �� 3���� ��� �4�� .
Universal Knowledge Solutions s.a.l
61
$��C �� A�� � ��� �:
� ���� � 5� � U.��" ���� ���"?
������� � ����� � : D�� ��4�� ��14�� �3% 9L� �% 9L� �P� ������ �'��� %4�" .
����: ��� ./( �, 2%$���������� 5��� C/��� '��� %4��" !�" �� . �� �0� �� ����� %4��$�� ����� ./( � P�� �������� W���4���� K�%@b�.
������� ��!�: !�" �41�� �/( �, 5�� �� 2%$� :
• � ����� 5��� C/��� '��� %4��" • � �0� 5��� C/��� '��� %4��" • %@0� ��/ 5��� C/��� '��� %4��"�4���� K�.
Universal Knowledge Solutions s.a.l
62
� ���� � ���� � ���*� ���3� ��
�� ����� �� � �$�� � *���� ����� �, ���(�9��������� ������ % � �� �������� ��P���. �K%$�� �9�9 ���� D � �� ����14���� ��� ����� % ���� )����� E� '�� � =������ ���F� %� ��� !�" 5��� B�� ��<��
�0������'������ N%P4�� K%$����� � % 9L��� ��P� �� ���� !�; A����� �������� a�HTML� WML �CHTML �HDML. ...g��.
k����$� � ����\� ������ ��� � � ����� !�" ��$��� '�� �� %� ��� ��� 2 � W��%G� �/( �� E�
���� � ����� �$� ������ �, ��I�� �/( �" ����G� ���� '��� !�" � �� � '������ �� �(� ��/ % @ ������ 2% �� ����
B1� ������ �" ��� ���� ���� ���� ��� �4���� ���� ����� '���(� !��� � 5���.
���F ASP.NET '������ T � � % � � N%� �� �1� /; �����G� ./( '�%� ?��$� ?7� asp.net 5� '��� !�" IIS !��� � ;��$�� %� .NET ��%-�� !�" %Z� ��� T � ��� � P9� ���* 200 ��14����� �1���� ���%9 �� �������� ��� ����� �� )��
n�� �1���� B� �4���� % 9L��� �P� '������ �5����� �9�9�� '��.
'��� %� G� �/( � �74 %�%��� ���*�Microsoft����� ��� ����� ��9 � ?� %�� B- ���� T��0� �, 3%,.
� ����� ./( �� , ��$� ���� � � %���� � �[� H*� ��9 �� �� ,.
� ���� � 5� � U.��" ������� ���*� � ��+����J����� �������� ��� ����� ������� ���� % 9L��� �P� �" %<��� KP� ���14 A���� �������� 5��� C/��� '.
Universal Knowledge Solutions s.a.l
63
����� !�" ��( %� ��� ��$ ���� � �0� �������� �-�� K�%@� '������ 3�%���� ��N%� �-� �(%��<; ��% 9L���� 4��� �
����G� ��$�%��. 3�%���� �������� ./( /�� � P9��� �J � T��" !�" E�� � � �, � ���"� ���� �4���� % 9L��� �P� !�; ��� ���������� ������.
�������� 5��� C/��� K�%@� ���� �P�� 5���� �4� 2�� '����� �7� �� ��$*��� '����� N%� � ��%� K�%@� �" 3%��"
XMLK�%@0� ./( '�� . %,��ASP.NET'������ ����� %4��" �� %4�" ��� � -��� � � ��� C/����� ����9� ������ 5� C/��� .
��C�:
���� 5� C/��� %4�" %��<; � 1 � �%� � ��-� �� �� , )�� �� �label. <%@ Page Language="vb"
Inherits="System.Web.UI.MobileControls.MobilePage" %>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form id="Form1" runat="server">
<mobile:Label id="Label1" runat="server">Hello,
World</mobile:Label>
</mobile:Form> B��� ��-��� �, �������Page �������� �P��� � ���� � 2�4�� '�����MobilePage� ����� ��14�� D %��� . ���� '-mobile
%4��" A��0 ���� ��9�� ���%�� ���� �, �������� �� ������ �������� �������� '����� . � ����� ���� �� ' ��� K%P� �J ���� 3%��/�� �, B$*�� T � ��� A��� N%� � 3%� ��0 ��J�"��� ��" ��14�� ./( ���%� N%��
��14�� #1�� . � �%� 8�1� '�� T � ��� ��$ ����"HTTP �P� )�� �������� 5� �� ��%\� '�F N/�� ������ )�� � ���� ���� ��� % 9L��� .
5� �� E� o������� ������� % 9L��� �P� � ���� T � ��� '�� �(�$�.
� ���� � 5� � U.��" �������
%��$�� ��$�� 5��� C/��� '��� %4��" �� 8�� �� �������� '����� %4��". ����� !�; %4��$�� ./( ' �� 2��4� �� �� , �(�%��:
��7� ���� � ���"?���: �8��� E�%� �-� � %� $��� '����� %4��" �� ��� �" 3%��" �( � �'�����%�4���(% @� �� �4���������� ��� � ����.
>��� � ���� ���"?: ����� ��� �� ��9 ��� ����G� �� T����� � ��" ��I� �� ��� ����(���� !��.
Universal Knowledge Solutions s.a.l
64
*�& ����� � $�4 � ���� � ���� � ���"?: '����� %4�" �-� ������� ������ !�" �, ��� � � ��� 2J�<� %4��$�� ./(� '��� 1��( ������ # L�� 8����.
���� ����� 4�8� ��" ���� � ���� � ���"?: � $� ����� T � ��� �* � ��$� %4��$�� ./( H��%�" ?7-� �� $� �� F A� ";
��08J�4�� � $� )�� ��� �� '����� %4�" 3���0� �.
5 ��� �: )�� �� '����� %4��" '"��Form� �Panel ��List ��ObjectListControls 5������� .�"�� �� (Template) D � ������ �/�� � $� =���� 5��F �%� ���� ���� � ��� �4���� '����� %4��" W�� '����� %4��" '����.
������� � ���� � ���"? ������� ���� �
F '����� %4��$� �4���� � �%��� � ���� � �$�� � ��� ��� � ��9� H*�� � %� $��� �������� '����� %4��" '(� K�%$��� A���� ����������.
Universal Knowledge Solutions s.a.l
65
� ���� � ���� � ���"� ���� � �0��� �
� �������� 5��� C/��� '��� %4��" 2�14 5�@� %���� 24�� �� ��4J�4� 5�@� D%�System.Web.UI.MobileControl 24�� .%��� D% N/��System.Web.UI.Control.
K%P�� �������� '����� %4��" E �� N���System.Web.UI.MobileControls.Style �/( !�; ��4��� ��� D �
Universal Knowledge Solutions s.a.l
66
' F !�; ���* ��9� % 9� ���" 8J�4� T % �" �� ?3%9��� K%P�� 8J�4�style '��� %4�" �� N�� ��-��� � � !�$, � �4���� �����Font K%P�� �, 3����� � ���� �4�� !�; % 9� ����� Style � ������ �4���� �� F '������� � �-� W��� D ��
��9�� �� % �$� '������ S���%��� ����� A��-�Font.Italic?7-� .
/( ' F � $� ��� ��� N� !�" �� �P 4 ����� ����� D �� '����� ��� �� '����� %4�" ��14�� T % �" ?3%9��� 8J�4��� .��9��:
<mobile:aMobileControl
runat="server"
id="id"
BreakAfter=="{True|False}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
ForeColor="foregroundColor"
BackColor="backgroundColor"
Alignment="{NotSet|Left|Center|Right}"
StyleReference="styleReference"
Visible="{True|False}"
Wrapping="{NotSet|Wrap|NoWrap}"
<!-- Events -->
OnDataBinding="EventHandlerMethodName"
OnDisposed="EventHandlerMethodName"
OnInit="EventHandlerMethodName"
OnLoad="EventHandlerMethodName"
OnPreRender="EventHandlerMethodName"
OnUnLoad="EventHandlerMethodName"
</ mobile aMobileControl >
%�4���� 8J�4��� ./( �� �� ������ ������ �, ]%9�: �4���� ' ��� 24���
Alignment
Alignment.NotSet|Left|Center|Right
��* %4�$�� 3�/����� .���� ���� �� ����� � ������ '�" ��� �,
�, 3������ 3�/����� /�L� ��� $���� � ���� ��� �, % 0� .����
� ����� �� F � $� '�"
BackColor
None|hexadecimal RGB values|standard
HTML color identifiers|color constants
%4�$� '������ � 1���� ���'����� . �( � *�%�,� �� ���
Color.Empty
BreakAfter
True|False
�$� % �4�, �,�*; ���� '����� %4�" . �� ��� ����
Universal Knowledge Solutions s.a.l
67
�( � *�%�,�True
Font.Size
FontSize.NotSet| Normal| Small| Large
'���� '������ ��� % P4� N%� ������ ��%��� 5� ������
������. Font.Bold
BooleanOption.NotSet|False|True
'� W � 8��� ��� �/; �� , ����.
Font.Italic
BooleanOption.NotSet|False|True
�J�� ��� ��� ����.
ForeColor
None|hexadecimal RGB values|standard
HTML color identifiers|color constants
�, 8��� '������ ����� ����'����� %4�".
'����� '� ��� �,None D% �� �4���� ./( %4�$�� �, 8���
B �� N/�� %4�$��.
ID String
��� �, �14���� ./( '���� %4�" !�; E�%�� �� F ��J� ";
B , �+������ N/�� '�����. ./�� �� F A� "; %� '� ��� �, E*�� ?� J���� '�<��� '�� �4����
� J���� �� F.
UniqueID '�<��� ��F �� ��� $� '� �� F
./( �� F �" H %4��� ��� !�" E��� ��4���� '�<��� T��"��� �� F � ��� ���� . ./( �����
�4���� �� F �� �� ��� �$����� %4�$��ID �4���� ' F �� �� ID
%4�$�� �/( N��� %4�" N0.
Visible True|False
�� ��� ���; '� ��� �,False !�; ?������ %4�$�� !�� �4���� ./(
���%� K%P� ��14�� !�". Wrapping
Wrapping. NotSet|Wrap| NoWrap
��" 2�� 8��� ��� �/; �� , ���� '� ��14�� ���� B ��.
24�� �� ��4J�4� 5�@� D%�� �������� 5��� C/��� '��� %4��" 2�14 5�@� %����System.Web.UI.MobileControl
24�� .%��� D% N/��System.Web.UI.Control.
Universal Knowledge Solutions s.a.l
68
'����� %4��" E �� N��� K%P�� ��������System.Web.UI.MobileControls.Style �/( !�; ��4��� ��� D � 8J�4� ' F !�; ���* ��9� % 9� ���" 8J�4� T % �" �� ?3%9��� K%P��style '��� %4�" �� N�� ��-��� � � !�$, �
�4���� �����Font K%P�� �, 3����� � ���� �4�� !�; % 9� ����� Style D �� � ������ �4���� �� F '������� � �-� W��� ��9�� �� % �$� '������ S���%��� ����� A��-�Font.Italic?7-� .
� ���� � ���� � ���"� ���� � B���7�
���(�� D���0� K$�� �������� '����� %4��" �� � �$�� W%�9�:
D���� 24���
DataBinding �% ��" D���� �/( %�< ���� � %�4� E� %4�$��. Disposed '����� %4�" �(��� ���� 3%��/�� ���� % %�� ��" D�� �/( %�< .
Init
3� � 3%�� �, !��0� ���%��� �(� '����� %4�" � (L� N%� ����" D���� �/( %�< '����� %4�".
�4���� �� ��� ���� ���%��� ./( �,ViewState W�/� 3%,��� ��� ��4���D���� �/( S��$� ��* �� %�: '��� %4�" �� �� F N0.
Load
K%P�� ��* %4�$�� � ��� =�� %�< MobilePage. �� F !�; ��4��� ��� ViewState �/( S��$� ��* �� =%�0� '����� %4��"�
D����. PreRender K%@ ��* '����� %4�" E*� ��F D���� �/( %�< MobilePage� N/�� B �.
Unload 3%��/�� �� '����� %4�" i %1� �$� D���� �/( %�< .
���� �� ��0� � ���$� D���0� ./( E ��� D���0� �����$� /�L�Object �� ���-��� D���� � ���� '�F N/�� '����� %4�" ��� ��System.EventArgsB1� D���� �" �����$� ��� .
EventHandlerMethodname(Object sender, EventArgs e)
�P 4�� '����� ����� , D���� T7 ; ��" ��� P9� '� ���� �� % �� '� � ����.
<mobile:aMobileControl
runat="server"
id="id"
OnLoad="methodName"
.
.
.
�� % �� � P9� N%� D �methodName D���� T7 ; ��" OnLoad.
Universal Knowledge Solutions s.a.l
69
��"?����� � ���� � �
=%�0� '����� %4��" E ��� �� ������ ���� '����� %4��" !�" '� �/( T� . '����� %4�" %4��$�� W�� '(�Form N/�� � ��%� ����� ��* =%�0� '����� %4��" E ��� � ��" �, �"� .�, ���-�� %4�$�� ���� '����� %4�"Panel �, �"� N/��
�� %4��" E ��� %4�" ��* '���Form ������ .
'����� %4�" ��* E*�� ���� %4��$�� D%�Panel� �Form ���� ������ %4�$�� �/( 8J�4� Style ' F � ��� '� �/; ; � ��%,; 3%�4� '����� %4��$� �4��.
'��� %4��" �-�� �� ?����@Panel�� %4��" �� �"���� !�" ���� �� T � �� � ��" � �: �� ��� ���� '��� .
�� �� , %4��$�� � �%��� � ���� H*� N/�� ��� ��� ��9�� Form �Panel:
@������ �?��<: W�/� �5��� T � �� � �� ( A� "G ���$, � �: � ����� '����� %4��" %,���� ./( � � ��������� A����� �"���� � � ��9� '���G� ��
%4��"� %4��$��=%�0� '�����. %�4��7��'����� %4��" � � ��������� A����� �"��F H*� N/�� ��� ��� ��9�� �%�� %��� ]�*��:
Universal Knowledge Solutions s.a.l
70
����� � ���� � ���"? ; ���� � ��"? Form ;
'����� %4�" %��$ Form K%@ ��* ��%���� %4�$�� MobilePage��� %4�" !�; 5��� C/��� ��14 C���� D � � 'Form
=%�0� '����� %4��" A���� �F0� !�" ����.
'����� %4�" 3%�F !�; �,�*G��Form '����� %4�" E � �=%�0� '����� %4��" A����� !�" Form C%�� 8��� A����� �-� T ����� �4���� ��% 9L��� '������ 8��� �/( T �� ��� D � �������� '����� %4��"<p></p>� <br/>� <b></b>�
<i></i>� <a href=””></a>
���! �6�#�: '����� %4�" ��* %��� 8��� �, W��� T ���� ��% 9L� '����� ��� Form 8�4��� ������ �������� ��� � �� �4 ���� �� � ����� �P 4�� �� N� �=%�0� �������� '����� %4��" ��*.
<mobile:Label runat="server"><b>Hello World</b></mobile:Label>
Universal Knowledge Solutions s.a.l
71
�� , �%�� '����� %4�$� ���$���� ��4���� '<$� N���� �P 4 �� Form:
<mobile:Form
runat="server"
id="id"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
ForeColor="foregroundColor"
BackColor="backgroundColor"
Alignment="{NotSet|Left|Center|Right}"
StyleReference="styleReference"
Visible="{True|False}"
Wrapping="{NotSet|Wrap|NoWrap}"
Action="url"
Method="{Post|Get}"
OnActivate="onActivateHandler"
OnDeactivate="onDeactivateHandler"
Paginate="{True|False}"
PagerStyle-NextPageText="text"
PagerStyle-PageLabel="text"
PagerStyle-StyleReference="styleReference"
Title="formTitle">
Child controls
</mobile:Form>
�/( '����� %4�" � �� ���� 8J�4��� �� �� , ]%9��:
�4���� ���� 24���
Action String
a�� ����" �-� URL '������ B �; C/����� =���� ��%; N%� N/�� � �� % �� =��;POST� �GET.
%� ��4���� ./�� �� F � $� %� '� ��� �, #1� !�; C/����� ��%; N ����"URL� ����� ��14�� .
ControlToPaginate Control
'� �� �� C/����� !�" ���� '��� %4�$� ]���� �� �4���� ./( ���� �4���� �� F ���� �;� !�� ���14 3�" !�; B� ���Paginate %4�" �,
�� ��� N��� C/����� '���False.
CurrentPage Integer !�; ' �� � ��" D��� ���� �, � ����� ��14�� � �� 3��"\� �4���� ./( '���
���14.
Method
System.Web.UI.
MobileControls.
FormMethod
Post | Get
5� ��%G �������� �� % �� ����HTTP � �� ��� =��; /�L� D � Post� �Get ��, � *�%�,� �� ��� ��� FormMethod.Post
Universal Knowledge Solutions s.a.l
72
PageCount Integer ./( D��� ��� �, �� �; C/����� ' �� '� ���� ���14�� ����� ��$�� � $�
� ��$��.
PagerStyle
System.Web.UI.
MobileControls.
PagerStyle
� � ���� '���� K%P�� �� F 3��"\�PagerStyle N/�� 8��� ��� N/�� .%��<; N%� .
� J���� 3%�4� '�<��� '�� �74� � ����)Next – Previous( Paginate True | False ��14 �� %-�� !�; C/����� � ���� ]���� 5��� � � ���� �� ��� ./( ����.
Title String C/����� ����" �-� �� ��14�� !�"� �, 3��" %�< � ?�����"� =%�� ����� �,
K%$���� !�"
�6�#� : � J������ ������ �, !�" ����� � � 5 %�� ��" �4�� �F W�/� ���14 !�; C%��� ' ��� C/����� '��� %4�" H�C%��� K%" 5��0 ������ '"� '�" ���� A� ��.
'����� %4�" %��$ Form K%@ ��* ��%���� %4�$�� MobilePage '��� %4�" !�; 5��� C/��� ��14 C���� D � �Form
�" A���� �F0� !�" ����=%�0� '����� %4�.
'����� %4�" 3%�F !�; �,�*G��Form '����� %4�" E � �=%�0� '����� %4��" A����� !�" Form C%�� 8��� A����� T ����� �4���� ��% 9L��� '������ 8��� �/( T �� ��� D � �������� '����� %4��"
����� � ���� � ���"?
; ���� � ��"? Form ; �� '����� %4�" W�Form ��*�� D���0� �� �"���� Activate �Deactivate �Paginate 9��� ��%� � C/����� 2�� ;����14 !�; ' ���� � ��$� W�/�.
5������� �%�� � ����; C/����� '��� %4�" '"� ���HeaderTemplate� �FooterTemplate ��ScriptTemplate.
�� �� , -� C%�� ������� C/����� '��� %4�" '����� � 1 � �" � ��.
'��� %4�" '������ ���� � ��%���� ]����� � �/��� A�9�\� ��-��� �/( '�� Link
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<%@ Page language="c#"
Inherits="System.Web.UI.MobileControls.MobilePage" %>
<mobile:Form id="Form1" runat="server">
Universal Knowledge Solutions s.a.l
73
<mobile:Label id="Label1" runat="server">
Form 1
</mobile:Label>
<mobile:Link id="Link1" runat="server" NavigateUrl="#Form2">
Link
</mobile:Link>
</mobile:Form>
<mobile:Form id="Form2" runat="server">
<b>
<i>Phew, you made it!</i>
</b>
<br>
<mobile:Label id="Label2" runat="server">
Form 2
</mobile:Label>
</mobile:Form>
��9�� !�" � ���� 8���� ������� !�" S���%��� �/( C%� %�< :
'����� %4�" W��� Form ��*�� D���0� �� �"���� Activate �Deactivate �Paginate 9��� ��%� � C/����� 2�� ;
����14 !�; ' ���� � ��$� W�/�.
5������� �%�� � ����; C/����� '��� %4�" '"� ���HeaderTemplate� �FooterTemplate ��ScriptTemplate.
����� � ���� � ���"? ; ���� � ��"? Panel ;
'����� %4�" W��� Panel �J%� C%� N� � =%�0� �������� '����� %4��$� �� ���� E ����� '+���> B���) '��� %4�" ��"
C/����� .(� %4�" N��� �� C/��� '��� %4�$� ��� /; '��Panel� ���� �%4�$� ��� W�/� �%-��Panel %4�" N��� �� '���Panel� � %-��.
Universal Knowledge Solutions s.a.l
74
'��� %4�$� ���%��� 8��� ����� N%��Panel�� ��� :
<mobile:Panel
runat="server"
id="id"
BreakAfter=="{True|False}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
ForeColor="foregroundColor"
BackColor="backgroundColor"
Alignment="{NotSet|Left|Center|Right}"
StyleReference="styleReference"
Visible="{True|False}"
Wrapping="{NotSet|Wrap|NoWrap}"
Paginate="{True|False}" >
Child controls
</mobile:Panel>
'��� %4�" ��* ��$*� ��%��� =%�0� '����� %4��" %4� N%� Panel��% 9L� � � �/( :
<mobile:Panel></mobile:Panel>
'����� %4�" �� !�; .����� T���� ���%��� 8��� �� ����� Panel �4���� '�� Paginate �, .��%�/ �h�" � ,�*; �4���
'����� %4��" 8J�4�.
�� ./( B��� '��� %4�" ��* �$*������ %4��$�� A���; ������ 3%�%* !�; � P9��� ��� W%�� �4��Panel ��14�� #1� �, )���� �;.(
'��� %4��" �$�%� ������ ��-��� %�<> Label . '��� %4�" ��* ����� ���-; E*�� Panel '��� %4�" .%��� N��� N/�� Panel '��� N%4�" N��� %�: LabelF���� � :
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<%@ Page language="c#"
Inherits="System.Web.UI.MobileControls.MobilePage" %>
<mobile:Form id="Form1" runat="server">
<mobile:Panel id="Panel1"
runat="server"
Font-Bold="True">
<mobile:Label id="Label1" runat="server">
Label 1 Panel 1
</mobile:Label>
Universal Knowledge Solutions s.a.l
75
<mobile:Label id="Label2" runat="server">
Label 2 Panel 1
</mobile:Label>
<mobile:Panel id="Panel2"
runat="server"
Font-Italic="True">
<mobile:Label id="Label3" runat="server">
Label 1 Panel 2
</mobile:Label>
<mobile:Label id="Label4" runat="server">
Label 2 Panel 2
</mobile:Label>
</mobile:Panel>
</mobile:Panel>
</mobile:Form>
'����� %4�" �� '������ ��� ��� �-�%��� � ��" ��( <�7�Panel '����� %4��" !�; LabelB��* 3������� .
� !�" S���%��� �/( C%� %�< ��9�� !�" � ���� 8���� ������:
'����� %4�" W��� Panel �J%� C%� N� � =%�0� �������� '����� %4��$� �� ���� E ����� '+���> B���) '��� %4�" ��"
C/����� .( '��� %4�" N��� �� C/��� '��� %4�$� ��� /;Panel� ���� �%4�$� ��� W�/� �%-��Panel �" N��� �� %4 '���Panel� �%-��.
�����7� ���� � ���"?
� �0� '����� %4��" !�" A���� ./( �, 2%$��� '��� %4�$� K%$���� ��* ��7��� �" ���I��� W�� ��*�� �(Command � '��� %4�"Link . '��� %4��" �-� C%���� �4���� '����� %4��" !�" W�/� 2%$��Label ��TextView �
Universal Knowledge Solutions s.a.l
76
�Image %9����� ����G� '��� %4�" !�; �,�*G�� �TextBox.
���� � ��"?Command:
'����� !�; ���� ��� ��%; � ��$� �/( '����� %4�" H� . ��4�� !�" �/( '����� %4�" %��<; �� , N%� ���� �� % �� 2����(� �1������ ��$���C%� '"�� ���� ��*%$���� �, %� ��9� %�< �� 3��" % 9L��� �P� HTML� � �, ��%� .%��<; '�
��*%$��WML.
�� , 8J�4��� H*� N/�� ���%��� 8��� �� ��/( '����� %4�" �(��� ���� D���0�:
<mobile:Command
runat="server"
id="id"
Alignment="{NotSet|Left|Centre|Right}"
BackColor="backgroundColor"
BreakAfter=="{True|False}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
ForeColor="foregroundColor"
StyleReference="StyleReference"
Visible="{True|False}"
Wrapping="{NotSet|Wrap|NoWrap}"
CausesValidation="{True|False}"
CommandArgument="commandArgument"
CommandName="commandName"
ImageUrl="softkeyLabel"
OnClick="clickEventHandler"
OnItemCommand="commandEventhandler"
SoftkeyLabel="softkeyLabel"
Text="Text">
TextContent
</mobile:Command>
'����� %4�" D% Command 24�� �� ��%�9��� D���0�� 8J�4��� MobileControl 8J�4��� �, �� �� , �%�� W�/�
�/( '����� %4�" ����� ���� � ,�*G� D���0��: � ���� ��B�� � *�" � � � �
CauseValidation True|False %4�" N��� N/�� C/����� =���� ��� �, �, �4���� ./( � 1� �-� T������ �4�� '��� %4��" !�" '�����
CompareValidator�CustomValidator�RangeValidator� RequieredFielValidator.
��%; ��" T������ �4���� '����� %4��" T7 ; '� �� 3��"
Universal Knowledge Solutions s.a.l
77
%� P*� ���� ���Command � �� �0� �� % -��� �, ���( ��� �?���� � %�0� �/( ��� � %� '����� ��" �����
Command C/��� ��* g %���� %� ���� �4�� ���� %��<G � 4�9�� �����$��� ����G.
CommandName String � $� �4���� �� F CommandName K%P�� �$����� CommandEventArgs D���0� S��$�� B� �� N%� N/��
OnItemCommand CommandArgument String � $� �4���� �� F CommandArgument K%P�� �$�����
CommandEventArgs D���0� S��$�� B� �� N%� N/�� OnItemCommand
Format System.Web.UI.
MobileControls.
CommandFormat
Button | Link
$�� /�L �� ��\, B �; '����� %4�" ��9 � ��� '� N/�� ��9��� %� ��9� ��% ��9.
'"�� ���� ��*%$���� ���� �, ; �4���� ./( ��$� JavaScript
ImageUrl String '����� %4�" ' ��� ��"Command ./( � ��� ��" ��� �%�� � ��� ����� !�" %� 3%�4 %��<; N%� �� �4���� '"�� ���
%�4��. D����Click D���� S��$� �� % '� � $ D���� S��$� �� % '� . %4�" !�" '������ P* ��$,
'�����Command '�� � �'����� !�; '����� %4�" 3��"; N%�� �4���� ./�� �� �� 3������ �� % �� A�"���� � P9��� ��� W%��.
D����ItemCommand �$� �� % '�D���� S� D�� E� ����� �( ���Click� S��$� �� % D���� �/( ��� D����. ��� D���� �/( �, � � C�%�; � ���$�� ��* ���@%� �� F
CommandEventArgs � �4���� '������ W�/� CommandName �CommandArgument
SoftKeyLabel String '���������� 2������� �������� ��� ����� K$� � ����; �'������ N/�� 8��� % P�� �4���� ./( H�� �� ��%� %�%�L�
�%�0� ./( ��* %�< % . � ��%��� %�%�b� � J������ �� ��� ���� �(GO.
Text String �� � N/�� 8��� � ��� N%� ��; �/( '����� %4�$� .%��<; � '����� %4�$� �4���� 3% 9L��� ��* 8��� �/( E*�������\
���� ��� �� ���.
�/( '����� %4�" ��" ������ ��� ��-��� H*� :
Universal Knowledge Solutions s.a.l
78
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<%@ Page language="c#" Codebehind="CommandExample.aspx.cs"
Inherits="MSPress.MobWeb.CmdEx.MyWebForm" %>
<mobile:Form id="Form1" runat="server">
<mobile:Command id="Command1" runat="server" CommandName="RED"
OnItemCommand="Command_SelectEvent" BackColor="Red">
Red
</mobile:Command>
<mobile:Command id="Command2" runat="server" CommandName="BLUE"
OnItemCommand="Command_SelectEvent" BackColor="Blue"
ForeColor="White">
Blue
</mobile:Command>
<mobile:Command id="Command3" runat="server" CommandName="GREEN"
OnItemCommand="Command_SelectEvent" BackColor="Lime">
Green
</mobile:Command>
<mobile:Label id="Message" runat="server"></mobile:Label>
</mobile:Form>
�� �� ,� ���%��� 8��� CommandExample.aspx.cs �P�� 5������ C#:
using System;
using System.Web.UI.WebControls;
namespace MSPress.MobWeb.CmdEx
{
public class MyWebForm :
System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.Label Message;
protected void Command_SelectEvent(
Object sender, CommandEventArgs e)
{
if(e.CommandName=="RED")
Message.Text="You selected the Red option";
else if(e.CommandName=="BLUE")
Message.Text="You selected the Blue option";
else
// Catchall case
Message.Text="You selected the Green option";
}
}
}
Universal Knowledge Solutions s.a.l
79
� �0� '����� %4��" !�" A���� ./( �, 2%$��� '��� %4�$� K%$���� ��* ��7��� �" ���I��� W�� ��*�� �(Command � '��� %4�"Link . '��� %4��" �-� C%���� �4���� '����� %4��" !�" W�/� 2%$��Label ��TextView �
�Image %9����� ����G� '��� %4�" !�; �,�*G�� �TextBox.
���� � ��"?Command:
'����� !�; ���� ��� ��%; � ��$� �/( '����� %4�" H� . ��4�� !�" �/( '����� %4�" %��<; �� , N%� ���� �� % �� 2����(� �1������ ��$������ �, %� ��9� %�< �� 3��" % 9L��� �P� C%� '"�� ���� ��*%$�HTML� � �, ��%� .%��<; '�
��*%$��WML. �����7� ���� � ���"?
���� ��"?Image:
�"� %4�$�� �/( �,%�4 ��1�� %��<; . 27��7� ?�%<� %� ��� ������ ���9� %4�$�� �/( ��9 � ��1�� ��� �� � � ���1��� ����� ���"�� ���� %�4���1������ �������� ����?�,�*; ��� ����� ./( ��9�9*%" ��%�F � � 27��� !�; .
�/� T �� �� %-�L� 3%�4�� 2�� � �L� 5� � ���� ������ �� '�F N/�� ������ 5� 5����� T ���� ��%G ��� ����� �� )�� 5� �� ��%\�.
�6�#� :� %4�" '������ �� % �� ./( 5��� ��� !���� 8���� '����DymamicImage T �� � ���� ?� J���� '�� N/��
?��� � 41���� �/( '����� %4�" ]%9 !�" ��L� D � 5����� T ���� !�; 3%�4��.
�� �� , 8J�4��� H*� N/�� ���%��� 8��� ��/( '����� %4�" ����� ���� D���0�: <mobile:Image
runat="server"
id="id"
Alignment="{NotSet|Left|Centre|Right}"
BackColor="backgroundColor"
BreakAfter=="{True|False}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
ForeColor="foregroundColor"
StyleReference="StyleReference"
Visible="{True|False}"
Wrapping="{NotSet|Wrap|NoWrap}"
AlternateText="AltText"
ImageUrl="masterImageSource"
NavigateUrl="targetURL"
SoftkeyLabel="softkeyLabel">
Optional DeviceSpecific/Choice construct here.
</mobile:Image>
Universal Knowledge Solutions s.a.l
80
���(� %�/� � ,�*G� 8J�4��� �� �"���� �/( '����� %4�" '�� ����" D ���� ��� T� ���� ���$�� 8J�4��� !�; �,�*;:
�4���� ��"�� 24���
AlternateText String
N/�� 8��� ��� %�< � ����� !�" %��<; '"�� ���� ��%�4����������� 3%�4�� �" ?�*�" . ��� ���� ����
�� 3%�4�� ./( � ��� %�<���� K%$���� !�" 3%�4��'�����.
ImageURL String
����������� 5�� ��� 3%�4�� 2�� %�4� �. ��� �� ��( � ����� %���� '������ 2�� EF�� 5� T� ��� %����
%��� 3%�4���(%��<; ��.
NaviagteURL String
���F �/;'������ ��% !�; 3%�4�� ����� �4���� ./( � ����$�� �-� �NaviagteURL �� ������ '� N/�� ����$
3%�4�� ��% !�" P*�� ��" B �;. 3%�9G�� �� ��� ./( A�� ��� �,)# (N%�� ����$�� ���%�
� �� �ID '��� %4�$� Form� #1� �, ��14�.
�/( '����� %4�" ���"� ���� %�4�� ��1�� ���� '(� �� :gif� �wbmp� �jpg� �Png.
�����7� ���� � ���"?
���� � ��"? �������Image:
%�4�� '����� ��� B�L� ?���� ��%�/%�" T,����� 3%�4�� 2�� � ��� � T ��������� B�"� N/��. � � � 1 � ������ ��-��� 3% 9L��� T � � <DeviceSpecific> 3% 9L��� E� <choice> '����� %4�" ��* Image '����
T ���� �/�� ������ '"� 5�� �1���� %�4 ��� ��:
<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage"
Language="c#" %>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form runat="server">
<mobile:Image runat="server" id="Image1"
AlternateText="Northwind Corp.">
<DeviceSpecific>
<Choice Filter="isHTML32"
ImageUrl="Northwind.gif"/>
Universal Knowledge Solutions s.a.l
81
<Choice Filter="isWML11"
ImageUrl="Northwind.wbmp"/>
</DeviceSpecific>
</mobile:Image>
</mobile:Form>
�� 2 %$� ��$�� �/( '���G %�71��>��� +��� ���"G� 2�� ��* ��Web.config ������ 8��� N��� N/��� :
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<deviceFilters>
<!-- Markup Languages -->
<filter name="isHTML32"
compare="preferredRenderingType" argument="html32" />
<filter name="isWML11"
compare="preferredRenderingType" argument="wml11" />
</deviceFilters>
</system.web>
</configuration>
��� � ��������4��� ����� � : � $ '��� %4�" Image �4���� ImageUrl� ��% !�; % 9� �� F �������� ������ ��* �� �� 3%�4 .��eF% ���%�� ./( ' ?3��"
�� ?�A�����Symbol:0000� � �P 4�� ��� ����� )���� K$� �, /�L�Symbol:X00 ��� �� ��� D � X 2%�0� ��� G� �E ��F ��� �00 �" %�$ , 'F%N%9" �.
������ ��9��� ��%�� '� '����� Symbol:cloudy D � cloudy��� �" %�$��� ��%�� '� ��( �'J�P�� . B�9 ������ ��-���� ��-�� ��% '��� B���� �� %9�� ./( �, T����Symbol:cloudy :
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage"
Language="c#" %>
<mobile:Form runat="server">
<mobile:Label runat="server">
The Weather today will be...</mobile:Label>
<mobile:Image runat="server"
AlternateText="Cloudy!"
ImageUrl="cloudy.jpg">
<DeviceSpecific>
<Choice ImageUrl="symbol:cloud" Filter="isUP4x">
</Choice>
</DeviceSpecific>
</mobile:Image>
Universal Knowledge Solutions s.a.l
82
<br>
<mobile:Image runat="server"
AlternateText="GoTo MSN"
ImageUrl="MSNlogosmall.gif"
NavigateUrl="http://mobile.msn.com">
<DeviceSpecific>
<Choice ImageUrl="MSNlogo.gif" Filter="isPocketIE">
</Choice>
</DeviceSpecific>
</mobile:Image>
</mobile:Form>
2�� '���� 3%�%* W��(Web.config 2 %$�� %�71��: <?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<deviceFilters>
<!-- Device Browsers -->
<filter name="isGoAmerica"
compare="browser" argument="Go.Web" />
<filter name="isMME" compare="browser"
argument="Microsoft Mobile Explorer" />
<filter name="isMyPalm" compare="browser" argument="MyPalm" />
<filter name="isPocketIE" compare="browser" argument="Pocket
IE" />
<filter name="isUP3x"
compare="type" argument="Phone.com 3.x Browser" />
<filter name="isUP4x"
compare="type" argument="Phone.com 4.x Browser" />
</deviceFilters>
</system.web>
</configuration>
K%$���� 5�� ������� S���%��� �/( C%� ��� :
Universal Knowledge Solutions s.a.l
83
���� � ��"? �������Image: %�4�� '����� ��� B�L� ?���� ��%�/%�" T,����� 3%�4�� 2�� � ��� � T ��������� B�"� N/��.
��� � ������������ � 4��� �:
� $ '��� %4�" Image �4���� ImageUrl�% !�; % 9� �� F � ��������� ������ ��* �� �� 3%�4 .��eF% ���%�� ./( ' ?3��" �� ?�A�����Symbol:0000� � �P 4�� ��� ����� )���� K$� �, /�L�Symbol:X00 ��� �� ��� D � X 2%�0� ��� G� �E
��F ��� �00 �" %�$ , N%9" � 'F%.
�����7� ���� � ���"? ���� � ��"?Label:
�"� � %4�" �/( '�����,������� ������ �9�9 C%� !�" 3A�%��� 84�� % 4F 8� %��<; . �� , �/( '����� %4�" C�%�G �������� �P 4�� �� . �F� �1������ 8J�4��� �(/�L� ���� ' ��� H *�� �� , '�:
<mobile:Label
runat="server"
id="id"
Alignment="{NotSet|Left|Centre|Right}"
BackColor="backgroundColor"
BreakAfter=="{True|False}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
ForeColor="foregroundColor"
StyleReference="StyleReference"
Visible="{True|False}"
Wrapping="{NotSet|Wrap|NoWrap}"
Text="Text">
TextContent
</mobile:Label>
'�� �( 3���� �4�� =� '����� %4�" Text !�; �,�*; 8J�4���?���� ��*���� ��%�9��� .�"�� �4���� ./( �, � ���
�/( '����� %4�" ��* .%��<; ��%��� 8��� !�; �� F . 3% 9L� ��* 8��� E*�� ?7 �� �� % �� ./( %��$�<mobile:Label></mobile:Label>
H*� ������ ��-��� �/( '����� %4�" '����� :
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<%@ Page Inherits="MSPress.MobWeb.LblEx.MyWebForm"
AutoEventWireup="False"
Language="c#" CodeBehind="LabelExample.aspx.cs" %>
Universal Knowledge Solutions s.a.l
84
<mobile:Form runat="server" id="Form1">
<mobile:Label id="Label1" runat="server"
StyleReference="title"
Alignment="Center">
Centered Title
</mobile:Label>
<mobile:Label id="Label2" runat="server"></mobile:Label>
</mobile:Form>
� 1���� �, B������ '� N/�� ���%��� 8��� ���� '� /�L N/��LabelExample.aspx.cs. 8��� �� F � $�� '�� ��( 8��� '����� %4�$�Label2��14�� � ��� ��" .
using System;
using System.Web.UI.MobileControls;
namespace MSPress.MobWeb.LblEx
{
public class MyWebForm : System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.Label Label2;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
protected void Page_Load(Object sender, EventArgs e)
{
Label2.Text = "This was set in code";
Label2.Font.Italic = BooleanOption.True;
}
}
}
���� ��9�� !�" ���%��� 8��� �/( / 1�� �� ��:
Universal Knowledge Solutions s.a.l
85
���� � ��"?Label: �"� �/( '����� %4�" �,������� ������ �9�9 C%� !�" 3A�%��� 84�� % 4F 8� %��<; .
�����7� ���� � ���"?
"? ���� � ��Link : �"� %4�$�� �/( �,������� 5��� C/��� ��14 !�" ��$9� ��% A�9�; � � #1� ��* %�: C/��� %4�" E� �%��� '��
� ��14��� %�4� E���> ��%��� !�" ����$� ���URLB� .
� � �� ���� D���0�� 8J�4��� '(�� %4�$�� �/( '����� �P 4 ������ ���%��� 8����(/�L� �� ��� ���� ' ���� ���. <mobile:Link
runat="server"
id="id"
Alignment="{NotSet|Left|Centre|Right}"
BackColor="backgroundColor"
BreakAfter=="{True|False}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
ForeColor="foregroundColor"
StyleReference="StyleReference"
Visible="{True|False}"
Wrapping="{NotSet|Wrap|NoWrap}"
NavigateUrl="target"
Universal Knowledge Solutions s.a.l
86
SoftkeyLabel="softkeyLabel"
Text="Text">
TextContent
</mobile:Link>
D7- '�� %4�$�� �/( �� <�7� T���� 8��� ��8J�4��(�� @� T� ���� ���$�� W�� �" � ,�*; . �4���� ���� 24���
NavigateUrl String B �; ��4��� ��%��� �� ��� %�4��� ����" �4���� ./( � $�. SoftKeyLabel String �"�� �,���%��� %��� � *�%�,� �� ��� 8� % P� .%,�� N/��
�� ��*%$���� K$�GO=%�� ���@%� �� F N� !�; . Text String ./( �7� �� ��%�� 8�� .%��<; 5����� 8��� � ��� �����
�4����.
H*� �/( '����� %4�" '����� ������ ��-���: <%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage"
Language="c#" %>
<mobile:Form runat="server" id="Form1">
<mobile:Link id="Link1" runat="server"
SoftkeyLabel="->Hello"
NavigateURL="#Form2">
GoTo Hello
</mobile:Link>
<mobile:Link id="Link2" runat="server"
SoftkeyLabel="->Bye"
NavigateURL="#Form3">
GoTo Goodbye
</mobile:Link>
<mobile:Link id="Link3" runat="server"
StyleReference="subcommand" SoftkeyLabel="MSN"
NavigateURL="http://mobile.msn.com">
MSN Mobile
</mobile:Link>
</mobile:Form>
<mobile:Form id="Form2" runat="server">
<B><I>Hello!</I></B>
</mobile:Form>
<mobile:Form id="Form3" runat="server">
<B><I>Goodbye</I></B>
</mobile:Form>
Universal Knowledge Solutions s.a.l
87
H*�� � ��� ����� !�" ��-��� �/( C%� � ����� � ����� �����IE
���� � ��"?Link :
�"� %4�$�� �/( �,������� 5��� C/��� ��14 !�" ��$9� ��% A�9�; � � #1� ��* %�: C/��� %4�" E� �%��� '�� � ��14��� %�4� E���> ��%��� !�" ����$� ���URLB� .
���� � ���"?�����7�
���� � ��"?TextBox :
�� ��� ./( � �$� �� '������ � ��� E� � J���� �� F N��� �� %4�$�� �/�� ��� ��� � �� % ����\� �/( '����� %4�" H� ����������.
'��� %4�" '����� �P 4 �� �� ,TextBox: <mobile:TextBox
runat="server"
id="id"
Alignment="{NotSet|Left|Centre|Right}"
BreakAfter=="{True|False}"
StyleReference="StyleReference"
Visible="{True|False}"
Wrapping="{NotSet|Wrap|NoWrap}"
MaxLength="maxlength"
Numeric="{True|False}"
Password="{True|False}"
OnTextChanged="textChangedEventHandler"
Size="textBoxLength"
Text="Text"
Title="Text"
WmlFormat="formatMask">
TextContent
</mobile:TextBox>
��" �����(; '� B�0 � 1����� B���� ���� ���$���� ��14���� ��$���� ���F ���� <�7�� ���%4�$�� �/( . ������ ���8J�4���
Universal Knowledge Solutions s.a.l
88
��, ���$�� W�� �" �1������ =%�0�:
� �4�����D���� ���� 24��� MaxLengh Integer � � $�� '������� ����G ]����� !4F0� �� �� 3��";8.
�� ��� !�; �4���� ./( � $� ��� �, 3����� % @ �� ��� ./( %��$�0.
Numeric True|False ����]��� ��� �/; �� , �, � �F%�� ' ��� ����; . Password True|False � � $�� '���� '� ����G� ��� ���� ���� � � ���� �� ��� 3��";
.% 19� � ��%�9; !�; B� ��� *��%�9;=%�� ��. Size Integer �� ��� 2%����� ��� '� N/��� ���%4�$�� �/( �� �; Text String '����� %4�" ��* 8��� �" %�$� � 8��� �/( � ��� ��� �
�/( '����� %4�" 3% 9L� T7@;� H�, � � 8��� E*�� ��; � �� % ��4���� ./�� �� F A� "\���.
Title String ��+�� ./( ���*%$���� �� % -��� �, �� ���. D����
TextChanged
�� % '�D���� S��$�
D���� S��$� �� % '� ���� . =���� � �$� ��" D���� �/( %�< '����� %4�"TextBox '����� !�; ���$��� �� ��� ��%;� .
wmlFormat String ����WML� $� )���� ����G� � ��" � �� �� .� !�$, ��-��� � )����� ��� NNNN� �F% 2%��� E�%� ����; .
H*� 8��� E�%� '��� %4�" ��" ������ ��-���TextBox:
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<%@ Page Inherits="MSPress.MobWeb.TBEx.MyWebForm"
AutoEventWireup="False"
Language="c#" CodeBehind="TextBoxExample.aspx.cs" %>
<mobile:Form runat="server" id="Form1" title="Confirm Password">
<mobile:Label runat="server" id="Label1">
Enter new password</mobile:Label>
<mobile:Label runat="server" id="Label2" Visible="False"/>
<mobile:TextBox runat="server" id="TextBox1"
Password="True">
</mobile:TextBox>
<mobile:Label runat="server" id="Label3">
Confirm password
</mobile:Label>
<mobile:TextBox runat="server" id="TextBox2"
Password="True"/>
<mobile:Label runat="server" id="Label4"/>
<mobile:Command runat="server" id="cmdButton">OK</mobile:Command>
</mobile:Form>
Universal Knowledge Solutions s.a.l
89
��%��� ���%��� 8��� ����=������ 2���� �, TextBoxExample.aspx.cs �, ��� ���:
using System;
using System.Web.UI.MobileControls;
namespace MSPress.MobWeb.TBEx
{
public class MyWebForm : System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.Label Label1;
protected System.Web.UI.MobileControls.Label Label2;
protected System.Web.UI.MobileControls.Label Label3;
protected System.Web.UI.MobileControls.Label Label4;
protected System.Web.UI.MobileControls.TextBox TextBox1;
protected System.Web.UI.MobileControls.Command cmdButton;
protected System.Web.UI.MobileControls.Form Form1;
protected System.Web.UI.MobileControls.TextBox TextBox2;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.TextBox2.TextChanged +=
new System.EventHandler(this.Verify_OnTextChanged);
this.cmdButton.Click +=
new System.EventHandler(this.cmdButton_Click);
}
protected void Verify_OnTextChanged(Object sender, EventArgs e)
{
if (TextBox1.Text != TextBox2.Text)
{
Label2.Visible = true;
Label2.StyleReference = "error";
Label2.Text = "No match - please reenter";
}
}
protected void cmdButton_Click(Object sender, EventArgs e)
{
if (TextBox1.Text == TextBox2.Text)
{
Label1.Visible = false;
Label2.Visible = false;
Label3.Visible = false;
TextBox1.Visible = false;
Universal Knowledge Solutions s.a.l
90
TextBox2.Visible = false;
Label4.Text = "Confirmed - Thanks";
}
}
}
}
'��� %4�" '������ =%�� 3%� ������\� ������ ��4 � �L�� % ���� ����; �� '������ � ���� ���%��� 8��� �/( '��
TextBox . %� !�" P*�� ��" ���� ��� ��%; �$� ���%��� 8��� '�� OK'��� %4�" B�-� N/�� Command �� T������ � T�� ��� '�" ��� �, L � ���% %��<;� ������� ������� � � T�� ����T�� ��� ��" � �L� ���% %��<;.
������ C%��� S���%��� %�< :
���� � ��"? TextBox :
�� %4�$�� �/�� ��� ��� � �� % ����\� �/( '����� %4�" H� � �� ��� ./( � �$� �� '������ � ��� E� � J���� �� F N��� � ��������.
�����7� ���� � ���"?
���� � ��"?TextView :
8� %��<\� �/( '����� %4�" H� ��� � � '����� %4�" '������ .%��<; Label.
Universal Knowledge Solutions s.a.l
91
#�$�Label ���14 !�; ������� ' ���� %4�$�� �/( '"� D ��N%� %9� ���14�� �� �"���� !�; � � �� 8��� ' ��
'����� %4�" N�� N/�� C/����� %4�" �� � ��$�� ./( � ��� TextView.
H*� '��� %4�" '����� �P 4 ������ 8���TextView: <mobile:TextView
runat="server"
id="id"
Alignment="{NotSet|Left|Centre|Right}"
BackColor="backgroundColor"
BreakAfter=="{True|False}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
ForeColor="foregroundColor"
StyleReference="StyleReference"
Visible="{True|False}"
Wrapping="{NotSet|Wrap|NoWrap}"
Text="Text">
TextContent
</mobile:TextView>
�, B� P�� ���F �h�" � ,�*; 3���� �4�� ���� <�7� ?�* � �/( '����� %4�" ���� �,8J�4��� �4���� �(� ���$�� Text D � %4�$�� �/( ��* %�< N/�� 8��� �4���� ./( ����.
���(� ������4���� ./( %,�� ���� '����� %4��" '<$� �,� %4� T % �" ?�* � �4���� ./( �* ��� ��% 9L� � � 8��� H�1����/( '����� %4�$� T7@G�.
H*� ?� ��" %4�$�� �/( '����� � 1 � ������ ��-���:
<%@ Page language="c#"
Inherits="System.Web.UI.MobileControls.MobilePage" %>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form runat="server" id="Form1" Paginate="True">
<mobile:Label id="Label1" runat="server" StyleReference="title"
Alignment="Center">
TextView In Use
</mobile:Label>
<mobile:TextView id="TextView1" runat="server">
The TextView control is used for larger blocks of text.
<br />
<br />
Universal Knowledge Solutions s.a.l
92
This control supports internal pagination so that if you set
the <b>Paginate</b> control of the <b>Form</b> control to
<b>true</b>, this control will page its output as
appropriate for the client browser.<br />
<br />
It also supports a set of markup elements so that <b>bold</b>,
<b><i>bold&italic</i></b>, or <i>italic </i>are supported.
The line breaks in this text are actually <br/> tags.
You can also embed <a> hyperlinks to other resources:
<br />
<a href='http://mobile.msn.com'>http://mobile.msn.com</a>
</mobile:TextView>
</mobile:Form>
%�<� ���%��� 8��� �/( / 1�� �� ����� �� :
���� � ��"?TextView :
8� %��<\� �/( '����� %4�" H� ��� � � '����� %4�" '������ .%��<; Label.
#�$�Label ���14 !�; ������� ' ���� %4�$�� �/( '"� N%� D ��8��� ' �� %9� ���14�� �� �"���� !�; � � �� '����� %4�" N�� N/�� C/����� %4�" �� � ��$�� ./( � ��� TextView.
���� � N��H7� ���� ���"?
'��� %4��" ��*��ASP.NET-7- �������� ��������� 5��� ��� � � A��@; �, W%�9� �4�� K�%@� ��/ '��� %4��" . ./( �( %4��$��Clendar� PhoneCall� AdRotator.
Universal Knowledge Solutions s.a.l
93
���� ��"?Calendar: D � ������� 5��� T � � ��* g %���� %� ��� � ��" ������ �� %4�$�� �/( ��� '���� ��$�� ./( ��� �� �4�� ����� .
( �� ���� �� $*� 3�" �/( '����� %4�" %,� ��'� ?7-� B�� %� ��� '������ ��� N/�� g %���� �� ������ ��)��� ���%�9. '"�� ���� ��� ����� !�" ���� ��9� ?����@ %4�$�� �/( %�< HTML � �������� ��� ����� ���� �, ���%�� �� � �%( � �� ��9�
'"�� ����WML. �� , � 1���� � *%$�� ��* %4�$�� �/( ��9 H*�� � �� �� :
4�$�� �/( '����� �P 4 ������ ���%��� 8��� � � �(%,� ���� D���0�� 8J�4��� '(�� %:
<mobile:Calendar
runat="server"
id="id"
BreakAfter="{True|False}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
ForeColor="foregroundColor"
BackColor="backgroundColor"
Alignment="{NotSet|Left|Center|Right}"
StyleReference="styleReference"
Visible="{True|False}"
Wrapping="{NotSet|Wrap|NoWrap}"
CalendarEntryText="prompt string"
FirstDayOfWeek="{Default|Sunday|Monday|Tuesday|Wednesday|
Thursday|Friday|Saturday|Sunday}"
OnSelectionChanged="selectionChangedHandler"
SelectedDate="selectedDate"
SelectionMode="{None|Day|DayWeek|DayWeekMonth}"
ShowDayHeader="{True|False}"
VisibleDate="visibleDateMonth"
/>
Universal Knowledge Solutions s.a.l
94
?�* � ��( H*��8J�4��� A��-� ��� P�� '�� '� ���� � ,�*G� ���7� �" 8J�4����$�� '����� %4��" : �4���� ���� 24���
CalendarEntry-
Text String � � $�� '���� �, '������ 8��� 3��";WML �CHTML
�" !�; ������ ��%� '��� %4Calendar
FirstDayOfWeek
System.Web.UI.
WebControls.FirstDay
OfWeek enumeration
(FirstDayOfWeek.Friday)
'� 0� ��J�F .��" ���� N/�� )��� �, ��0� '� �� ����.
SelectedDate DateTime � � $��'����� %4�" � ��� .%� ��� '� N/�� g %���� � $� . ����������� '� �� g %�� �( � *�%�,� �� ��.
SelectedDates K%@SelectedDateCollection K%P� 3%������ g %����� 3��"\� '���
SelectedDateCollection
SelectionMode
System.Web.UI.WebControls.
CalendarSelectionMode
None|Day|DayWeek
|DayWeekMonth
�� g %���� ����� ��� �(%� ��� '������ E � �� . '� �/;� ��� �� ��� ./( a� None%� ��7� � ����; W��( ��� �� .
showDayHeader True | False � %��<; ���� � � �� �� F� g %���� !�; '� �� '� �,�*; A�P�;
%������.
VisibleDate DateTimeObject ��� .%��<; '� N/�� %�9��� '������ '�� N� � ���� W�/� '���
%�9�� �/( ��* '� .
WebClendar System.Web.UI.WebControls.
Calendar
K%P�� 2�P MobileControls.Calendar K%P�� �� � -�System.Web.UI.WebControls.
Calendar
��4���� ./( �7� �� B �; ��4��� ��� N/��. D����
SelectionChanged S��$� �� % '�D����
'�� ����" �(I�"��� '� ���� D���� S��$� �� % '� ��� '����� %4�" ��* %������ g %���� % P�� '������.
�/( '����� %4�" '����� ������ ��-��� H*� :
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<%@ Page language="c#" Codebehind="CalendarExample.aspx.cs"
Inherits="MSPress.MobWeb.CalEx.CalendarExampleMobileWebForm" %>
<mobile:Form id="Form1" runat="server">
<mobile:Calendar id="Calendar1" runat="server"
SelectedDate="2001-07-21"
SelectionMode="DayWeek"
Alignment="Center"
OnSelectionChanged="Calendar1_SelectionChanged">
Universal Knowledge Solutions s.a.l
95
</mobile:Calendar>
<mobile:Label id="Label1" runat="server" Alignment="Center"/>
</mobile:Form>
2���� ���%��� 8��� ������ ���CalendarExample.aspx.cs �, � �������:
using System;
using System.Web.UI.MobileControls;
namespace MSPress.MobWeb.CalEx
{
public class CalendarExampleMobileWebForm :
System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.Calendar Calendar1;
protected System.Web.UI.MobileControls.Form Form1;
protected System.Web.UI.MobileControls.Label Label1;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Calendar1.SelectionChanged +=
new System.EventHandler(this.
Calendar1_SelectionChanged);
}
protected void Calendar1_SelectionChanged(
object sender,
System.EventArgs e)
{
Label1.Text=Calendar1.SelectedDate.ToShortDateString();
}
}
}
'����� %4�" '����� ��-��� �, <�7�Calendar� �F B� � ��0� �� ��� A� "; '�21/7/2001%� ��� � ����; � ��� '� '- .
�"� % @ %�: g %�� N� %� ��� 21/7/2001 D���� T7 ; '� SelectionChanged � �� % �� � P9� �������
calendar1_SelectionChanged '����� %4�" �� F � $�� '��� ���� Label1�� g %���� !�; � ��. ��9�� �� ���%��� 8��� �/( / 1�� �� �� ����:
Universal Knowledge Solutions s.a.l
96
���� � N��H7� ���� ���"?
���� � ��"?PhoneCall: '����� %4�" '��� PhoneCall%� ��� �/( '"� ������� 2����� ��� ��� �, �1����� ��4�7� %9����� 5� �� . '�" ��� �, ���
�/( '����� %4�" %�< �4���� ./( '"�� ��4�� � $1�� �������� '������ ��� ��4� ���� ���% %��<G !�; '������ B��4�� �/( # L� !�" ��,����� 3%�%*.
Universal Knowledge Solutions s.a.l
97
�(%,� ���� D���0�� 8J�4��� '(�� %4�$�� �/( '����� �P 4 ������ ���%��� 8��� � � : <mobile:PhoneCall
runat="server"
id="id"
BreakAfter="{True|False}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
ForeColor="foregroundColor"
BackColor="backgroundColor"
Alignment="{NotSet|Left|Center|Right}"
StyleReference="styleReference"
Text="text"
Visible="{True|False}"
Wrapping="{NotSet|Wrap|NoWrap}"
AlternateFormat="alternateText"
AlternateURL="targetURL"
PhoneNumber="phoneNumber"
SoftkeyLabel="text"
Text="text">
innerText
</mobile:PhoneCall>
?�* � ��( H*��8J�4��� �" ������ A��-� ��� P�� '�� '� ���� � ,�*G� 8J�4����$�� '����� %4��" : �4���� ���� 24���
AlternateFormat String
N/�� ������ !�" �(%��<; 5� ���� ���%�� T �� ��� � ��4�� ��4�� # L� E �.
� �� ��� ��� ������� 2%����� ��� ��*�� �� ��� � � �����{0} �{1}.
�4�� ������ '� Text �� ���� {0} �4����� PhoneNumber.
�( �4���� ./�� � *�%�,� �� ���“{0}{1}”
AlternateURL
���� �" %�$ URL� ����� ���� ��14�� T� ��� �N%� ��4�� # L� �� ������ ���� '�" ��" ��� ��� � �1��������4��� '������ ��@% '�" ��".
PhoneNumber String
T ����� ?7-�� B� ��4�� ��%��� 'F%�� �-� ����� ��%|N% ��� ��%��|% 4��� 'F%��.
� ����� ���%�� '������ W�� T ���� � ��" '�� �� ��� ( ).
Universal Knowledge Solutions s.a.l
98
- r�%1�� !�; �,�*; .
SoftkeyLabel String
'��� ��*%$�� K$� WML �1� �, ���%� %� �9�9�� . %�< �, � *�%�,� �� ��� %��� �/(Go � �����
� ���� �� ��� ./( % P�SoftkeyLabel �� ��� !�; ���� ���.
Text
String
�� 8���� ��%�� �(%��<; '� ���� ���%�� ��� # L��4��.
�/( '����� %4�" '����� ������ ��-��� H*� :
<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage"
Language="c#"%>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form id="Form1" runat="server">
<mobile:PhoneCall runat="server"
AlternateFormat="Call {0} on {1}"
AlternateURL="http://www.northwindtraders.com"
phoneNumber="123-456-7890"
Text="Northwind Traders">
</mobile:PhoneCall>
</mobile:Form>
Universal Knowledge Solutions s.a.l
99
�3�� �� A��� � ��� �:
��7� E�=�� �:� ���� � 5� � U.��" ���� ���"? ������� � ����� � :
D�� ��4�� ��14�� �3% 9L� �% 9L� �P� ������ �'��� %4�"
����: �������� 5��� C/��� '��� %4��" !�" ����� ./( �, 2%$�� . �� �0�� �� ����� %4��$�� ����� ./( � P���� �������� W
�4���� K�%@b�.
������� ��!�: !�" �41�� �/( �, 5�� �� 2%$� :
• � ����� 5��� C/��� '��� %4��" • � �0� 5��� C/��� '��� %4��" • �4���� K�%@0� ��/ 5��� C/��� '��� %4��".
Universal Knowledge Solutions s.a.l
100
���� ���"? ���#� �
%��$�� C/����� �7��� � �74 �� T����� � ��" A��?�T � � N� �� '�� . /;K�%@� 3�$� � �74�� �� T����� � ��" N%�� ���(� : • C/����� ������ �� T�����. • ?7-� ���%���� � %��� ����� ����� ��� � $� T �� '����� �� T�����. • �� ��� #1� !�" � ��� A����� �� T����� .�� T����� ����� ���� %�� ������� ���(� �L� .
�?� � ���'����� ��� �� � ��%� 8�4� '����� ./( �-� A��� 5� � .� �� ?����@ �(!�; C����3��$��� � ��<��� % ��$��� '����� .
%,��ASP.NET '����� ��� �� '��� %4��" '������ C/����� � �74 �� T����� � ��$� 3� �� �� % !"��� '��� %4��"
� �74�� .��$�� ./( H��5��� ��14 ��* '����� %4�$� �4���� 3% 9L��� C�%�; �%��� 3��$� T��� �� ��" A�%�\� %4.
H*� � �74�� '��� %4��" 2�14� � �%��� � ���� ������ ��9��:
<�7� ���� T���� ��9�� ��5�( � �74�� �� T������ �4�� '��� %4��" : X N%���G� ����� '��� %4�"
Universal Knowledge Solutions s.a.l
101
X �� '��� %4�"� ��<��� % ��$� X ������ � �74 '��� %4�" X >��� � �74�� '��� %4�"+4�8 X ��%����� '��� %4�".
���� � ����� ����#� � ���� ���"�
%4�$�� ��" � �74�� '��� %4��" E �� D%�ValidationSummary � 24�� ��
System.Web.UI.MobileControls.BaseValidator ��4����IsValid.
�� ��� �4���� ./( /�L�True�� �4 T����� �%9 ���� �/; ��� ���� False� �74�� �� T����� � ��" ��9, �/; .
'�� 24�� System.Web.UI.Page) (�� 24�� 50� 24��MobilPage (�4���� IsValid �� � ��" �� ��9�� ��)AND ( 8J�4� E �� � � � � ��IsValid��� � �74�� %4��$� ��14�� �, 3����.
8���� � � ����� �� % �� �, �� ��� %������ � �74�� �� T����� '��� %4��" '�����IsValid W�� �� W%����� ]���� ��F ��14�� ��14��.
�" E�%� !�; ��4����-��� System.Web.UI.Page 24�� �� MobilePage �4���� '���� MobilePage.Page.
��C�: K%$ � D�� S��$� ������ ��-��� ��%� P*�� %�Command1 �4���� �� F �� T��� N/��� IsValid ������ ��F ��14��
C/����� !�;Form2: protected void Command1_Click(object sender, System.EventArgs e)
{
// Move onto second Form only if input on first page has
// passed validation by all the validation controls on the
page
if (Page.IsValid)
{
ActiveForm = Form2;
}
} ��� %4�" �� ��� �� ���% E� � �� �� C/����� %�< L � ���� ���� �, � �74 '� 5� �,L ��� �/(.
� �� � ��9� �J�%�� � �74�� '��� %4��" %�<�:
• C/����� !�" � �74�� '��� %4�" C�%�\� B , ��F N/�� ������ #1� �, ��0� • � �4���� K%$�� ���� ��* ���-��� '��� %4�$ValidationSummary.
Universal Knowledge Solutions s.a.l
102
N%� 0� ��9��� %�<� ���� L ��� ���% � ��� �4���� '������ ��Text . '����� %4�" '����� ���� �, ���
ValidationSummary N%� , � �4���� '�����ErrorMessage � 5� ������ ./( �, �� ��� ���;None !�; �4���� �� F DisplayB1� � �74�� '��� %4�$� �'����� %4�" T % �" 3%� �� �%� L ��� ���% %��< '�" ���*�
ValidationSummary �B1� � �74�� '��� %4�" T % �" 3%�.
� � � �74�� �� T����� %4��$� ��%�9��� 8J�4��� '(� ������ ������: �4���� ���� 24���
ControlToValidate String 2Q%$>� ID ��%��� '����� %4�$� B�� T�����.
Display
System.Web.UI.WebControls
.ValidatorDisplay
None|Static|Dynamic
� L ��� ���% %��<; �����.
ErrorMessage String
���� ���%�� 8� �" %�$�N%� '����� %4�" C%� ��* �(%��<;
ValidationSummary
IsValid True | False ����4 ���� ��� ���� �/; �� , ����.
Text String
���� ���%�� �-��N%� %��<;�(.
'� ��� �,%� ./�� �� F � $� �4���� N%� � �� F %��<; �4����ErrorMessage ?�*�"
���". C%� ��* �� ��� ./( C%��; '�
'����� %4�"ValidationSummary . �/�� �� ��� ��� ; '� K%P��
ErrorMessage.
���#� � ���� ���"?
��� � ���� ��"?RequiredFieldValidator
%��$ �� �/(?������� �(%-��� � �74�� '��� %4��" ���9� �� %4�$ . '������ '�F �/; �� , T������ � ��� %4�$�� �/( '�� '� � $� ����; %4�$� �� F A� "\�.
Universal Knowledge Solutions s.a.l
103
���� ���� �P 4���, �"�� '����� �� �/(� ����� �( ������� 5��� C/��� ��14 �, %4�$:
<mobile:RequiredFieldValidator
runat="server"
id="id"
BreakAfter="{True|False}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
ForeColor="foregroundColor"
BackColor="backgroundColor"
Alignment="{NotSet|Left|Center|Right}"
StyleReference="styleReference"
Visible="{True|False}"
Wrapping="{NotSet|Wrap|NoWrap}"
ControlToValidate="IdOfTargetControl"
Display="{None|Static|Dynamic}"
ErrorMessage="ErrorTextForSummary"
InitialValue="initialValueInTheControl"
Text="ErrorText">
innerText
</mobile:RequiredFieldValidator>
E ��8J�4� �" �-�%�� %4�$�� �/( 8J�4��� 24�� �(%,� ����� � �74�� �� T����� %4��$� ���$�� BaseValidator. � ���� � ��"? ������RequierdFieldValidator:
]%9 '����� %4�" '����� ������ ��-���RequierdFieldValidator ��"� C/����� ��* B�� ����; '������ �� 5� D � C/����� ��%;N%� �� F .I� "; '� �F ����� ��� �� T����� :
<%@ Page Inherits="MSPress.MobWeb.ReqEx.RequiredExample"
CodeBehind="RequiredExample.aspx.cs"
Language="C#"%>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form id="Form1" runat="server">
<mobile:Label id="Label1" runat="server">
Your name:
</mobile:Label>
<mobile:TextBox id="userName" runat="server"/>
<mobile:RequiredFieldValidator id="RequiredFieldValidator1"
runat="server"
Display="Dynamic"
ErrorMessage="Your name is required! "
Universal Knowledge Solutions s.a.l
104
ControlToValidate="userName"/>
<mobile:Command id="Command1" OnClick="Command1_Click"
runat="server">
Submit
</mobile:Command>
</mobile:Form>
<mobile:Form id="Form2" runat="server">
<mobile:Label id="Label2" runat="server">
Input validated OK.
</mobile:Label>
</mobile:Form>
�, � 1���� �, ���$�� ���%��� 8��� ���� '��RequiredExample.aspx.cs using System;
namespace MSPress.MobWeb.ReqEx
{
public class RequiredExample :
System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.Label Label1;
protected System.Web.UI.MobileControls.TextBox userName;
protected System.Web.UI.MobileControls.RequiredFieldValidator
RequiredFieldValidator1;
protected System.Web.UI.MobileControls.Command Command1;
protected System.Web.UI.MobileControls.Form Form1;
protected System.Web.UI.MobileControls.Label Label2;
protected System.Web.UI.MobileControls.Form Form2;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Command1.Click +=
new System.EventHandler(this. Command1_Click);
}
protected void Command1_Click(object sender, System.EventArgs
e)
{
if (Page.IsValid)
{
ActiveForm = Form2;
}
}
}
}
Universal Knowledge Solutions s.a.l
105
���� ��9�� �� ��-��� �/�� / 1���� �� ��
���#� � ���� ���"?
�"���� � ���� ��"?CompareValidator
> +��� '�� �/( �� �� ��%��� � ��" �, %4�$' F �� � %4�"����; '��� .
���� ���� �P 4���"�� �, '����� �� �/(� ����� �( ������� 5��� C/��� ��14 �, %4�$: <mobile:CompareValidator
runat="server"
id="id"
BreakAfter="{True|False}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
ForeColor="foregroundColor"
BackColor="backgroundColor"
Alignment="{NotSet|Left|Center|Right}"
StyleReference="styleReference"
Visible="{True|False}"
Wrapping="{NotSet|Wrap|NoWrap}"
ControlToCompare="IdOfControl"
ControlToValidate="IdOfTargetControl"
Display="{None|Static|Dynamic}"
Universal Knowledge Solutions s.a.l
106
ErrorMessage="ErrorTextForSummary"
Operator="{DataTypeCheck|Equal|GreaterThan|
GreaterThanEqual|LessThan|
LessThanEqual|NotEqual}"
Text="errorText"
Type="{Currency|DateTime|Double|Integer|String}"
ValueToCompare="Value">
innerText
</mobile:CompareValidator>
�"���� �/( '����� %4�" D% 8J�4��� 24�� �(%,� ���� ���$�� BaseValidator?���� �(%�/ !�" ��%%� ���� . !�; �,�*;8J�4��� ./(� %4�$�� �/( %,� 8J�4���� ����� � ,�*G� :
�4���� ���� 24���
Operator System.Web.UI .WebControls .ValidationCompareOperator DataTypeCheck|Equal|GreaterThan
|GreaterThanEqual
|LessThan|LessThanEqual|NotEqual
���" �4���� ./( �-�� � � ��%������ �� ���
>��� E*��� D � � ����� ��-���� �� ���a
ControlToValidate �/�� % 0� A���� �,
���$��� a� ��-���� �� ���ControlToCompare
0� A���� �,B� ��
Type System.Web.UI
.WebControls
.Validatio-DataType
String|Integer|Double|Date|Currency
'�� � � ���� 3��$�� � �� ��� ���� ��� ��
�����%��� ��%���. N%� ' ��� � ��� �(��"
�� !�; ?� %F ������� ��F ������ ���� ���
��%����� � ��" A�%�;.
9, �/; ��� � ��" �� � ��" �\, W�� � �����
?�* � �91� T�����. ValueTo-Compare String N%� !�; �� F ���;
���%� �/; �4���� ./( �4���� ��%���Text '��� %4�$�
ControlToValidate
Universal Knowledge Solutions s.a.l
107
�� $� ����- �� F E� E� B��%��� �" ?�*�"
�4����Text %4�$� %�: '���.
ControlToCompare String �-� 2Q%$>��� ID ��%��� '����� %4�$� D � B$� ��%�����N%��
� �4���� ��� F ��%���Text N%4�" �� ���
� ������ N�/ '�����ID
ControlToCompare �ControlToValidate
���� � ��"? �������CompareValidator:
]%9 '����� %4�" '����� ������ ��-���CompareValidator> D � �� '����� %4�" ��* %�� ���� ����; '������ �� 5password1 � %�: '��� %4�" ��* ������\� �(� �L� 3��";password2 . C/����� ��%; ��"N%� �� T����� T�� �� �� ��� .
<%@ Page Inherits="MSPress.MobWeb.CmpEx.CompareExample"
CodeBehind="CompareExample.aspx.cs"
Language="C#"%>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form id="Form1" runat="server">
<mobile:Label runat="server">
Your Password
</mobile:Label>
<mobile:TextBox id="password1" runat="server" password="true"/>
<mobile:Label runat="server">
Retype password
</mobile:Label>
<mobile:TextBox id="password2" runat="server" password="true"/>
<mobile:CompareValidator id="CompareValidator1"
Type="String"
Operator="Equal"
runat="server"
ErrorMessage="Passwords do not match!"
ControlToCompare="password1"
ControlToValidate="password2"/>
<mobile:Command id="Command1"
OnClick="Command1_Click" runat="server">
Submit
Universal Knowledge Solutions s.a.l
108
</mobile:Command>
</mobile:Form>
<mobile:Form id="Form2" runat="server">
<mobile:Label runat="server">
Passwords match!
</mobile:Label>
</mobile:Form>
�, � 1���� �, ���$�� ���%��� 8��� ���� '��CompareExample.aspx.cs using System;
namespace MSPress.MobWeb.CmpEx
{
public class CompareExample :
System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.Label Label1;
protected System.Web.UI.MobileControls.TextBox password1;
protected System.Web.UI.MobileControls.Label Label2;
protected System.Web.UI.MobileControls.TextBox password2;
protected System.Web.UI.MobileControls.CompareValidator
CompareValidator1;
protected System.Web.UI.MobileControls.Command Command1;
protected System.Web.UI.MobileControls.Form Form1;
protected System.Web.UI.MobileControls.Label Label3;
protected System.Web.UI.MobileControls.Form Form2;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Command1.Click +=
new System.EventHandler(this. Command1_Click);
}
protected void Command1_Click(object sender, System.EventArgs
e)
{
if (Page.IsValid)
{
ActiveForm = Form2;
}
}
}
}
Universal Knowledge Solutions s.a.l
109
���� ��-��� �/�� / 1���� �� �� !�" ��9��
���#� � ���� ���"?
���� � ����� ���� ��"?RangeValidator
���� ���� ��* �� F )�F� �� T����� �, �/( '����� %4�" '��� .
���� ���� �P 4���, �"�� '����� �� �/(� �( ������� 5��� C/��� ��14 �, %4�$� ����: <mobile:RangeValidator
runat="server"
id="id"
BreakAfter="{True|False}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
ForeColor="foregroundColor"
BackColor="backgroundColor"
Alignment="{NotSet|Left|Center|Right}"
StyleReference="styleReference"
Visible="{True|False}"
Wrapping="{NotSet|Wrap|NoWrap}"
ControlToValidate="IdOfTargetControl"
Display="{None|Static|Dynamic}"
ErrorMessage="ErrorTextForSummary"
MinimumValue="minValue"
MaximumValue="maxValue"
Text="errorText"
Type="{Currency|DateTime|Double|Integer|String}">
innerText
</mobile:RangeValidator>
Universal Knowledge Solutions s.a.l
110
D% �� �/( �"���� %4�$8J�4��� 24�� �(%,� ���� ���$�� BaseValidator?���� �(%�/ !�" ��%%� ���� . ./( !�; �,�*;
%4�$�� �/( %,� 8J�4���8J�4���� ����� � ,�*G� :
�4���� ���� 24���
MinimumValue String
� ���� �� ��� 5����� �(%,�� N/ %4�$��2Q%$>���
ControlToValidate N%� !�� B� ��
]����.
MaximumValue String
� ���� �� ��� 5����� �(%,�� N/ %4�$��2Q%$>���
ControlToValidate N%� !�� B� ��
]����. �-�� D � ���4����
MinimumValue �MaximumValue
5� � %���; ?�� F������;.
Type
System.Web.UI.WebControls.ValidationDataType
String|Integer|Double|Date|Currency
'�� � ���� 3��$��� ���� ��� ���4����
������%��� ��%��� �� ��. �� ��� � ��� �(��" '�
>��� �� !�; ?� %F ���� ��F ������ ���� �����%����� � ��" A�%�;.
� ��" �9, ��� �, ��� � ��" �\, W�� � �����
T�����?�* � �91�.
���� � ��"? �������RangeValidator:
]%9 '����� %4�" '����� ������ ��-���RangeValidator N/�� '��� %4�" ��* .�7 � g %�� ����; '������ �� 5� TextBox �D ����� !�; ��� �7 � g %�� �( ������\� ]����� � �$�� �� ��� 21 ��� B� %�� �� ?���" g %���� ��, � ���� �� ���
Universal Knowledge Solutions s.a.l
111
1/1/1900. �4���� � J����� �� ��� A� "\� 8���� A���� / 1�� '� B�� ��( <�7�MaximumValue ���%��� 8��� ��*
RangeExample.aspx.cs. �� �� , ���%��� 8��� RangeExample.aspx <%@ Page Inherits="MSPress.MobWeb.RgeEx.RangeExample"
CodeBehind="RangeExample.aspx.cs"
Language="C#" AutoEventWireup="False" %>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form id="Form1" runat="server">
<mobile:Label runat="server">
Date of birth:
</mobile:Label>
<mobile:TextBox id="dob" runat="server"></mobile:TextBox>
<mobile:RangeValidator id="RangeValidator1" runat="server"
MinimumValue="01/01/1900"
ControlToValidate="dob"
ErrorMessage="Sorry, you are not 21.">
</mobile:RangeValidator>
<mobile:Command id="Command1" runat="server" text="Submit">
</mobile:Command>
</mobile:Form>
<mobile:Form id="Form2" runat="server">
<mobile:Label id="Label2" runat="server">
Welcome, you are over 21.
</mobile:Label>
</mobile:Form>
�, � 1���� �, ���$�� ���%��� 8��� ���� '��RangeExample.aspx.cs
using System;
namespace MSPress.MobWeb.RgeEx
{
public class RangeExample : System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.RangeValidator
RangeValidator1;
protected System.Web.UI.MobileControls.Label Label1;
protected System.Web.UI.MobileControls.TextBox dob;
protected System.Web.UI.MobileControls.Command Command1;
protected System.Web.UI.MobileControls.Form Form1;
protected System.Web.UI.MobileControls.Label Label2;
protected System.Web.UI.MobileControls.Form Form2;
override protected void OnInit(EventArgs e)
{
Universal Knowledge Solutions s.a.l
112
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
this.Command1.Click +=
new System.EventHandler(this. Command1_Click);
}
protected void Command1_Click(object sender, System.EventArgs
e)
{
if (Page.IsValid)
{
ActiveForm = Form2;
}
}
private void Page_Load(object sender, System.EventArgs e)
{
DateTime now = DateTime.Now;
DateTime dt21yearsago =
new DateTime(now.Year - 21, now.Month, now.Day, 0, 0,
0);
RangeValidator1.MaximumValue =
dt21yearsago.ToShortDateString();
RangeValidator1.Type =
System.Web.UI.WebControls.ValidationDataType.Date;
}
}
}
������9�� �� ��-��� �/( / 1�� �� ��:
Universal Knowledge Solutions s.a.l
113
���#� � ���� ���"? ���� ��"?RegularExpressionValidator
H� �� �/(�� $� �P 4 T,��� ���L� ��L���� ��� �� F %������ %4�$., ��-��� � � !�$� ����; �� T����� %4�$�� �/( '����� �����
����%���� � %��� �� F� �N� %��� ��%����� ��� 'F%��.
��$�� ������ �� ?�� �$� �F� �< B��" ���� �[� !�� ���9F���� ���F ���� =%�0� � �74�� %4��" �� ?�� �$� %-�� %4�$�� �/( �$ �/( '����� %4�" '����� ��� � ��<��� % ��$��� E� 3%9���.
���� ���� �P 4���"�� �,��� %4�" '����� 'RegularExpressionValidator � ����� �( ������� 5��� C/��� ��14 �, : <mobile:RegularExpresssionValidator
runat="server"
id="id"
BreakAfter="{True|False}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
Universal Knowledge Solutions s.a.l
114
ForeColor="foregroundColor"
BackColor="backgroundColor"
Alignment="{NotSet|Left|Center|Right}"
StyleReference="styleReference"
Visible="{True|False}"
Wrapping="{NotSet|Wrap|NoWrap}"
ControlToValidate="IdOfTargetControl"
Display="{None|Static|Dynamic}"
ErrorMessage="ErrorTextForSummary"
Text="ErrorText">
ValidationExpression="regexp" >
innerText
</mobile:RegularExpressionValidator>
�"���� �/( '����� %4�" D% 8J�4�� 24�� �(%,� ���� ���$�� BaseValidator?���� �(%�/ !�" ��%%� ���� .
� ����� � ,�*G� �4���� %4�$�� �/( %,� 8J�4��� ./( !�; �,�*;:
�4���� ���� 24��� ValidationExpression String �� 5� N/�� ���<��� % �$��� �4���� ./( �-��B� �.
���� � ��"? �������RegularExpressionValidator:
A�9�� K$� ���%� � ��<��� ��% �$��� ����� � ��" ���� ?�%<�� �J � %,�� Visual Studio %4�" �,�*; =�� %�< S��$� RegularExpressionValidator �?������� � ��<��� ��% �$��� %-�� �� �"���� %,� .$��� �/( %�< ��9�� �� �9�9 S��:
]%9 '����� %4�" '����� ������ ��-���RegularExpressionValidator
Universal Knowledge Solutions s.a.l
115
�� , ���%��� 8��� �� RegularExample.aspx <%@ Page Inherits="MSPress.MobWeb.RegEx.RegularExample"
CodeBehind="RegularExample.aspx.cs" Language="c#"%>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form id="Form1" runat="server">
<mobile:Label runat="server">
ZIP Code
</mobile:Label>
<mobile:TextBox id="zip" runat="server"/>
<mobile:Command id="Command1" runat="server"
OnClick="Command1_Click">
Submit
</mobile:Command>
<mobile:RegularExpressionValidator
id="RegularExpressionValidator1"
runat="server"
ErrorMessage="Invalid ZIP Code"
ControlToValidate="zip" ValidationExpression="\d{5}(-\d{4})?"/>
</mobile:Form>
<mobile:Form id="Form2" runat="server">
<mobile:Label runat="server">
Valid ZIP Code
</mobile:Label>
</mobile:Form>
��$�� ���%��� 8��� ����, � 1���� �, �� '��RangeExample.aspx.cs
using System;
namespace MSPress.MobWeb.RegEx
{
public class RegularExample :
System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.Label Label1;
protected System.Web.UI.MobileControls.TextBox zip;
protected System.Web.UI.MobileControls.Command Command1;
protected
System.Web.UI.MobileControls.RegularExpressionValidator
RegularExpressionValidator1;
protected System.Web.UI.MobileControls.Form Form1;
protected System.Web.UI.MobileControls.Label Label2;
protected System.Web.UI.MobileControls.Form Form2;
Universal Knowledge Solutions s.a.l
116
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Command1.Click +=
new System.EventHandler(this. Command1_Click);
}
protected void Command1_Click(object sender, System.EventArgs
e)
{
if (Page.IsValid)
{
ActiveForm = Form2;
}
}
}
}
'����� %4�" �� F ��� �� ��L��� �� S���%��� �/( '�� TextBox �� �� ������ ID=zip���<��� % �$��� T��
"\d{5}(-\d{4})?".
���#� � ���� ���"? ���� ��"?CustomValidator
2��� �� �/(9��� 3%�4� � �74�� �� T����� �1 <� %,� B�0 '����� %4��" � �� �" %4�$3%.�"� � %4�$�� �/( �, A�9�;
� �74�� �� T����� �� % .
���� ���� �P 4���, �"��'��� %4�" '����� CustomValidator � ����� �( ������� 5��� C/��� ��14 �, : <mobile:CustomValidator
runat="server"
id="id"
BreakAfter="{True|False}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
ForeColor="foregroundColor"
BackColor="backgroundColor"
Alignment="{NotSet|Left|Center|Right}"
StyleReference="styleReference"
Universal Knowledge Solutions s.a.l
117
Text="ErrorText"
Visible="{True|False}"
Wrapping="{NotSet|Wrap|NoWrap}"
ControlToValidate="IdOfTargetControl"
Display="{None|Static|Dynamic}"
ErrorMessage="ErrorTextForSummary"
OnServerValidate="EventHandler"
Text="ErrorText">
innerText
</mobile:CustomValidator>
�"���� �/( '����� %4�" D% 8J�4��� 24�� �(%,� ���� ���$�� BaseValidator?���� �(%�/ !�" ��%%� ���� .
( �,�*; D�� %4�$�� �/( %,� 8J�4��� ./( !�; �,�*;�������: D���� ���� 24���
ServerValidate D�� S��$� �� %
N%� ��14�� �� T����� ��" D���� �/( T7 ; '����� !�" . ���$��� D���� S��$� ����
ServerValidateEventArgs S��$� !�" 5� �/� D���� ���;True!�; �� F IsValid �4����
K%P���ServerValidateEventArgs ���� �/; �� �4 T����� � ��".
�� �� ��� ��� D���� �/( S��$� ��9 � �� :
void ServerValidate (Object source, ServerValidateEventArgs args )
{
args.IsValid=false;
// Code to validate the user's input
if (validationIsSuccessful)
args.IsValid=true;
}
���� � ��"? �������CustomValidator:
]%9 '����� %4�" '����� ������ ��-���CustomValidator
�� �� , ���%��� 8���CustomExample.aspx
<%@ Page Inherits="MSPress.MobWeb.CusEx.CustomExample"
Universal Knowledge Solutions s.a.l
118
CodeBehind="CustomExample.aspx.cs"
Language="C#"%>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form id="Form1" runat="server">
<mobile:Label runat="server">
Enter an integer
</mobile:Label>
<mobile:TextBox id="number" runat="server"/>
<mobile:CustomValidator id="CustomValidator1"
runat="server"
ErrorMessage="Not a factor of four"
ControlToValidate="number"
OnServerValidate="ServerValidate"/>
<mobile:Command id="Command1"
OnClick="Command1_Click" runat="server">
Submit
</mobile:Command>
</mobile:Form>
<mobile:Form id="Form2" runat="server">
<mobile:Label runat="server">
A factor of four.
</mobile:Label>
</mobile:Form>
�, � 1���� �, ���$�� ���%��� 8��� ���� '��RangeExample.aspx.cs
using System;
using System.Web.UI.WebControls;
namespace MSPress.MobWeb.CusEx
{
public class CustomExample :
System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.Form Form2;
protected System.Web.UI.MobileControls.Label Label1;
protected System.Web.UI.MobileControls.CustomValidator
CustomValidator1;
protected System.Web.UI.MobileControls.Command Command1;
protected System.Web.UI.MobileControls.Form Form1;
protected System.Web.UI.MobileControls.Label Label2;
protected System.Web.UI.MobileControls.TextBox number;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
Universal Knowledge Solutions s.a.l
119
base.OnInit(e);
}
private void InitializeComponent()
{
this.Command1.Click +=
new System.EventHandler(this.Command1_Click);
this.CustomValidator1.ServerValidate +=
new ServerValidateEventHandler(this.ServerValidate );
}
protected void Command1_Click(object sender, System.EventArgs
e)
{
if (Page.IsValid)
{
ActiveForm = Form2;
}
}
protected void ServerValidate (
object source,
ServerValidateEventArgs args)
{
args.IsValid=false;
try
{
int x = Int32.Parse(number.Text);
if (x % 4==0)
{
args.IsValid=true;
}
}
catch(FormatException e)
{
// Exception may be caused by
// non-integer input on HTML clients
}
}
}
}
'��� %4�" �, ������ 'F%�� ��� �� ��L��� �� S���%��� �/( '�� TextBox !���� number( � ��$�� ��1"�*� ��4.
'����� %4�" �,�*; =%� ��� '�CustomValidator1 � �� % ��� '����� !�" � �74�� �� T����� D�� �%ServerValidate
���%��� 2���� ��* ����" � 41� '� �����CustomExample.aspx.cs
���#� � ���� ���"?
Universal Knowledge Solutions s.a.l
120
���� ��"?ValidationSummary
'�� �� �/( �� ���� ���� 5��� C/��� ��* �������� � �74�� �� T����� %4��" E �� �� C%��� �" 8��� 3��"\� %4�$��14��.
��� H� ��� 3���� � 4� ���� ��* L � ���% � �9�� H� B��� �������� ��� � ��� �, 3% �� 3�J�, �/( '����� %4�" C%��
�� � ���3������� K%$�� ��14��� ��/ ��� ����� !�" T � ��� '���.
����� ����� �( �/( '����� %4�" ������ ���� �P 4��:
<mobile:ValidationSummary
runat="server"
id="id"
BreakAfter="{True|False}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
ForeColor="foregroundColor"
BackColor="backgroundColor"
Alignment="{NotSet|Left|Center|Right}"
StyleReference="styleReference"
Visible="{True|False}"
Wrapping="{NotSet|Wrap|NoWrap}"
BackLabel="BackLabel"
FormToValidate="FormID"
HeaderText="HeaderText">
</mobile:ValidationSummary>
D7- ���� ��( <�7�8J�4� �( �,��L� % @ � ,�*; :
�4���� ���� 24��� BackLabel String �4���� ./�� �� F A� "; '� �/;
N%� , ��%�� 8�� �������� C/��� !�; '������ � $ N/�� �� 8��� ����; 3��"G ����G�
� ��. FormToValidate String 2Q%$>� ID N/�� C/����� T����� '�
B� �74 ��. HeaderText String ��J�F T� N/�� ����$�� �-��
A� �0�.
Universal Knowledge Solutions s.a.l
121
N%� �, �4���� ./( �� F %��<; ���� �, ��14�� !�"� '���� ���� ��*%$����
HTML �, L � ���% �� ��F� ��*%$��WML
�� '��� %4��" N��� N/�� C/����� #1� ��* '����� %4�" E*� '� �/; !�" T����� � ��" A�%�; �$� '� � �74�� �� T���
'����� %4�" 3��"; '�����ValidationSummary �4���� ?�%�<� ErrorMessage ���� � �74�� �� T����� %4��" E ��� �4���� �� F �� � ��IsValid �( ��� False.
'����� %4�" E*� '� �/; ���ValidationSummary�P� C/��� ��* � �74�� �� T����� '��� %4��" !�" N����� W�/� %
'��� %4�" !�" P*�� D�� S��$� !�" 5� �(��$, =%�0�Command �� F %����� ��14�� ��%\� '�F N/�� IsValid ��14��� �4���� ./( �� F �� H*�� �/\, )IsValid ( �(False �4���� �� F � $� 5� , ActiveForm !�; % 9� D �� C/�����
'����� %4�" !�" N�����ValidationSummary. �4���� �� F A� "; 5� ������ ./( �,BackLabel ��� ��/ ���� D �� 7-� '������Retry.
�4���� �� F A� "; ��"BackLabel %4�$�� '�� ValidationSummary �� T����� '� N/�� C/����� E� �%��� ?� J����
B� �74.
���� � ��"? �������ValidationSummary:
]%9 '����� %4�" '����� ������ ��-���ValidationSummary
�� �� , ���%��� 8��� SummaryExample.aspx <%@ Page Inherits="MSPress.MobWeb.SumEx.SummaryExample"
CodeBehind="SummaryExample.aspx.cs"
Language="C#"%>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form id="Form1" runat="server">
<mobile:Label id="Label1" runat="server">
Your name:
</mobile:Label>
<mobile:TextBox id="userName" runat="server"/>
<mobile:Label id="Label2" runat="server" >
Password
</mobile:Label>
<mobile:TextBox id="password" runat="server" Password="True"/>
Universal Knowledge Solutions s.a.l
122
<mobile:RequiredFieldValidator id="RequiredFieldValidator1"
runat="server"
ControlToValidate="userName"
Display="None"
ErrorMessage="Your name is required!"/>
<mobile:RequiredFieldValidator id="RequiredFieldValidator2"
runat="server"
ControlToValidate="password"
Display="None"
ErrorMessage="A password is required!"/>
<mobile:Command id="Command1" runat="server"
OnClick="Command1_Click">
Submit
</mobile:Command>
</mobile:Form>
<mobile:Form id="Form2" runat="server">
<mobile:ValidationSummary id="ValidationSummary1"
runat="server"
HeaderText="Missing Values:"
FormToValidate="Form1"
BackLabel="Retry"/>
</mobile:Form>
<mobile:Form id="Form3" runat="server">
<mobile:Label runat="server">
Error free submission.
</mobile:Label>
</mobile:Form>
�, � 1���� �, ���$�� ���%��� 8��� ���� '��SummaryExample.aspx.cs
using System;
namespace MSPress.MobWeb.SumEx
{
public class SummaryExample :
System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.Command Command1;
protected System.Web.UI.MobileControls.Form Form2;
protected System.Web.UI.MobileControls.Form Form3;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
Universal Knowledge Solutions s.a.l
123
private void InitializeComponent()
{
this.Command1.Click +=
new System.EventHandler(this.Command1_Click);
}
protected void Command1_Click(object sender, System.EventArgs
e)
{
if (Page.IsValid)
{
ActiveForm = Form3;
}
else
{
ActiveForm = Form2;
}
}
}
}
���%��� 8��� �/( � P9� �� �� �������,��9�� !�" :
C����#� � ���� ���"? ������� ��� ���3 ��
��$� ��-��� �/( �,!�"� %��� ����" � �L�� ���%���� � %��� �����$� ����; 5� ����; C/��� ' �4� � )%���� i��� � ��� '-
�� � % � �I�� . 4�� ��9��� ���%���� � %��� �P 4 ����; �� ?�� T����� ���%��� 8��� !�" 5� H �� � �� ��� � � T�� ����
Universal Knowledge Solutions s.a.l
124
� %��� �/�� � �������. ����G� � ��" ��F �� F ��� ������ E �� ��� �� T����� '� �� 5� W�/�. ��� �� �F� ��� � 5� )%����� 8���� i�����5 �� %-�� 1000.
��-��� �/( �, �� �" ��4��� EF����� ������� ��9:
����: <%@ Page Inherits="MSPress.MobWeb.ValEx.ValidationExample"
CodeBehind="ValidationExample.aspx.cs" Language="c#" %>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form id="Form1" runat="server">
<mobile:Label runat="server" BreakAfter="false">
E-mail address:
</mobile:Label>
<mobile:TextBox id="email1" runat="server"/>
<mobile:RequiredFieldValidator id="RequiredFieldValidator1"
runat="server"
ErrorMessage="E-mail address required"
ControlToValidate="email1"
Display="None"/>
<mobile:RegularExpressionValidator id="RegularExpressionValidator1"
runat="server"
ControlToValidate="email1"
ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-
.]\w+)*">
Not a valid e-mail address
</mobile:RegularExpressionValidator>
<mobile:Label id="Label2" runat="server" BreakAfter="false">
Re-type e-mail
</mobile:Label>
<mobile:TextBox id="email2" runat="server"/>
<mobile:RequiredFieldValidator id="RequiredFieldValidator2"
runat="server"
ErrorMessage="You must re-type e-mail"
ControlToValidate="email2"
Universal Knowledge Solutions s.a.l
125
Display="None"/>
<mobile:CompareValidator id="CompareValidator1"
runat="server"
ErrorMessage="E-mail addresses do not match. "
ControlToValidate="email2"
ControlToCompare="email1"
Display="None"/>
<mobile:Label id="Label3" runat="server" BreakAfter="false">
Donation (min. $5)
</mobile:Label>
<mobile:TextBox id="donation" runat="server" Password="True"/>
<mobile:RequiredFieldValidator id="RequiredFieldValidator3"
runat="server"
ErrorMessage="You must enter an amount"
ControlToValidate="donation"
Display="None"/>
<!-- The RangeValidator Control requires that a maximum value is
set.
This value could represent the payment ceiling accepted by the
online payment service provider -->
<mobile:RangeValidator id="RangeValidator1"
runat="server"
ControlToValidate="donation"
Type="Currency"
MinimumValue="5"
MaximumValue="1000">
Minimum donation is $5
</mobile:RangeValidator>
<mobile:Command id="Command1" runat="server">
Donate!
</mobile:Command>
<mobile:ValidationSummary id="ValidationSummary1"
runat="server"
FormToValidate="Form1"/>
</mobile:Form>
<mobile:Form id="Form2" runat="server">
<mobile:Label id="Label4" runat="server">
Thank you for donating.
</mobile:Label>
</mobile:Form> ��, � 1���� �, ���$�� ���%��� 8��� ���:
using System;
namespace MSPress.MobWeb.ValEx
{
public class ValidationExample :
System.Web.UI.MobileControls.MobilePage
{
Universal Knowledge Solutions s.a.l
126
protected System.Web.UI.MobileControls.Label Label1;
protected System.Web.UI.MobileControls.TextBox email1;
protected System.Web.UI.MobileControls.RequiredFieldValidator
RequiredFieldValidator1;
protected
System.Web.UI.MobileControls.RegularExpressionValidator
RegularExpressionValidator1;
protected System.Web.UI.MobileControls.Label Label2;
protected System.Web.UI.MobileControls.TextBox email2;
protected System.Web.UI.MobileControls.RequiredFieldValidator
RequiredFieldValidator2;
protected System.Web.UI.MobileControls.CompareValidator
CompareValidator1;
protected System.Web.UI.MobileControls.Label Label3;
protected System.Web.UI.MobileControls.TextBox donation;
protected System.Web.UI.MobileControls.RequiredFieldValidator
RequiredFieldValidator3;
protected System.Web.UI.MobileControls.RangeValidator
RangeValidator1;
protected System.Web.UI.MobileControls.Command Command1;
protected System.Web.UI.MobileControls.ValidationSummary
ValidationSummary1;
protected System.Web.UI.MobileControls.Form Form1;
protected System.Web.UI.MobileControls.Label Label4;
protected System.Web.UI.MobileControls.Form Form2;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Command1.Click +=
new System.EventHandler(this.Command1_Click);
}
protected void Command1_Click(object sender, System.EventArgs
e)
{
if (Page.IsValid)
{
ActiveForm = Form2;
}
}
}
}
Universal Knowledge Solutions s.a.l
127
�3�� �� A��� � ��� �:
%"�C � E�=�� �: �0��� � ���� � 5� � U.��" ���� ���"?
������� � ����� � : '��� %4�"������ �% 9L� �P� �3% 9L� ��14�� ��4�� � D��
����: '��� %4��" ����� ./( � P� D � �'J������ �4���� 5��� C/��� '��� %4��" !�" ����� ./( �, 2%$�� ��J����
SelectionList , List , ObjectList.
������� ��!�: !�" �41�� �/( �, 5�� �� 2%$� :
• '����� %4�"SelectionList • '����� %4�"List • '����� %4�"ObjectList.
Universal Knowledge Solutions s.a.l
128
��0�� � ���� ���"?
� P� �,-7- 2J�<� A���� �/( � '��� %4��" '���0� �� ��J�F '������ K�%@: X '��� %4�"SelectionList X '��� %4�"ListControl X '��� %4�"ObjectList. X
%4��$�� W��� �4���� 2�14�� � �%( � �� %4��" ./( ��� %��� '�1� ��4����:
�� �� , ���� � ������ ��F�%1�� '(� ��9� ��J�F �� ����� %4�"������ '����� %4��" ��:
3� ��� SelectionList List ObjectList � ����� ��J�F ��9� .%��<; ��� �� %� ��� ��J�F� ��%� �
��%� ��*%$�� !�"HTML √ X X
��%� ��� ��$� '"� √
� �"�1� % @ ����- ��J�F ��9 !�" .%��<; ��� √ √
� � �� ���$� ��J�F ��9 !�" .%��<; ��� ���F% √
Universal Knowledge Solutions s.a.l
129
' �� � ��" '"� � 'J���� ���14 !�; �� � �� √ √
���� 3%�4� %��<G� %4��" �" H %4��� ��� √ √
���� � %�4�� �� �% ��� √ √ √
� � ��� %��<; ����� ����� � %4�" �� %-�� √
%4�" %� ��� =�� D�� T7 \� '��� √ √ √
5������ '������ 84���� %��<G� '"�� √ √
��0�� � ���� ���"?
%4�" '��� SelectionList
5�� '��� %4�" SelectionList ��� � �� 'J����� ������ ���14 !�; E ���� � ��" '"� B��� 3% P4�� 'J���� . ��� ����� ����� ��J�F ��9� ��J���� %��<; %4�$�� �/��� ��% %4��" ��J�F�%4��$�� ./( '"�� ���� ��*%$���� !�".
K%$ '����� %4�" ���� ���" �� ����� ��J�F '� ���3%(�< �� F ��� � 1�� �� F �% � ����; . ����� � ��� �7� �� �� ��� ./( �14����Value%4�$��� � ��%��� <item>� � �4���� �� F � ���DataValueField � ��%��� ��J���� ���� �, ����� � %�4�.
���� �/( '����� %4�" '����� �P 4 !�"��9��:
<mobile:SelectionList
runat="server"
id="id"
Alignment="{NotSet|Left|Center|Right}"
BackColor="backgroundColor"
BreakAfter="{True|False}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
ForeColor="foregroundColor"
StyleReference="StyleReference"
Wrapping="{NotSet|Wrap|NoWrap}"
DataMember="dataMember"
DataSource="dataSource"
DataTextField="DataTextField"
DataValueField="DataValueField"
SelectType="{DropDown|ListBox|Radio|MultiSelectListBox|CheckBox}"
Title="String"
OnItemDataBind="itemDataBindHandler"
OnSelectedIndexChanged="selectedIndexChangedHandler">
<!-- Optional statically declared list items -->
<Item Text="Text" Value="Value" Selected="{True|False}"/>
</mobile:SelectionList>
Universal Knowledge Solutions s.a.l
130
8J�4����D���0�:
�� �� , '(� 8J�4��� � '����� %4�" ����� ���� D���0�SelectionControl
� �4�����D���� ���� 24���
DataMember String
����" �4���� ./( '��� %4�" ��� �� )�� �� K%P� ?� ��%� '�����
System.Data.DataSet ��
System.Data.DataTableObject
DataSource Object
�4���� ./( ������ K%PDataSet ��CollectionB$� �%�� '� N/��
%�4�� ?� ��%� '����� %4�" ��� ����"���� �.
DataTextField String
%4�" �% ��� �, K%P� '����� DataSet� � K%P�Collection ���� �4����DataTextField ����� '�
��* ��J���� ��* B�� ���� %�<� N/������ ��� %�4�.
DataValueField String
K%P� '����� %4�" �% ��� �,DataSet� � K%P�Collection ���� �4����DataValueField ����� '� �� N/���� '��� ���� ��� ' F ��* B�� ��
��* %4�" �� E� � ��%��� � 1������J����
Items System.Web.UI.MobileControls
.MobileListItemCollection
K%@ !�; ��4��� �4���� ./( %,��MobileListItemCollection
K�%@� E �� N��� N/��
System.Web.UI.MobileControls.
MobileListItem $���������� ��J���� K�%@� �" 3%�.
Rows Integer
'� ����"���; ListBox ��MultiSelectListBox !�; �4����
SelectTypeN%� � �4���� '����� Rows � ���� �� � J%��� 2�14�� ��"
'����� %4�"� ��*%$���� �, W�/
Universal Knowledge Solutions s.a.l
131
'"�� ����HTML �CHTML
SelectedIndex Integer
� 3��"\� '����� ���%������ %4�$�� � �� . �, '����� %4�" ��� ��� �, ���
��$���� %� ��� � $*�N%� , 3��"; %������ ��0� %4�$�� � ��.
Selection MobileListItem
%������ %4�$�� K%@ 3��"\� '����(� ���� ��MobileListItem� �� $�
null%4�" N� %� ��� '� '� ��� �, .
SelectType
System.Web.UI.
MobileControls. ListSelectType
DropDown|ListBox|Radio|
MultiSelectList-Box|CheckBox
%��<; �� �4���� ./( ����� �, ��J���%������ ���� K%$���� '"� ���.
Title String
��*%$�� !�" %�< N/�� ����$��WML.
'�"�� % @ ����$�� �/(�, �� � �$�� ��*%$��WML
D����ItemDataBind D�� S��$� �� %
����D���� S��$� �� % '� OnItemDataBind(Object Sender ,
ListDataBindEventsArgs e)
N%� ����" D���� �/( T7 ; N%� ���� � %�4� E� '����� %4�" �%.
� ��" N%�� D���� �/( T7 ; 3��"; ��" ��J���� !�; %4�" �,�*;.
D����SelectedIndexChanged
D�� S��$� �� %
'� �/;���"; '����� %4�" SelectionList %� ��� � $*�� ��$��
� ����� T7 ; N%� �� �, D���� �/( 3%�N%���� , � ��" E� C/����� ��%;
%������ %4�$�� �, % P�.
���� � ��"? �������SelectionControl: '�����/(�� 3% 9L��� '������ ��J���� %4��" � ��� ����� %4�$<item>� %4�$�� �/�� �4���� 3% 9L��� ��* � �%��� %4�$
���� � %�4��. �4���� �7� �� �/( '����� %4�" �� � ��� ����� SelectType D � %�<� �1������ ���0� ?�$�� ���� K%$���� '"� .
Universal Knowledge Solutions s.a.l
132
��C�1: � � � ��-���'����� %4�" '����� �����:
<%@ Page Inherits="MSPress.MobWeb.SelListEx.ExampleWebForm"
Language="c#"
CodeBehind=" SingleSelectionListExample.aspx.cs"%>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form runat="server" id="Form1">
<mobile:Label runat="server" StyleReference="title" id="Label1">
Season 2003 results
</mobile:Label>
<mobile:Label runat="server" id="Label2">Select a
team:</mobile:Label>
<mobile:SelectionList SelectType="ListBox"
id="SelectionList1" runat="server">
<item Text="Dunes" Value="Posn:1 Pl:38 Pts:80"/>
<item Text="Phoenix" Value="Posn:2 Pl:38 Pts:70"/>
<item Text="Eagles" Value="Posn:3 Pl:38 Pts:69"/>
<item Text="Zodiac" Value="Posn:4 Pl:38 Pts:68"/>
</mobile:SelectionList>
<mobile:Command runat="server" id="Command1">
Get Stats!
</mobile:Command>
</mobile:Form>
<mobile:Form runat="server" id="Form2">
<mobile:Label runat="server" id="Label3">Team Full
Stats:</mobile:Label>
<mobile:Label runat="server" id="Label4"/>
</mobile:Form>
Universal Knowledge Solutions s.a.l
133
'�� � �/��� A�9�\� T���� ���%��� 8���:N��� '���� ��J�F ��0�SelectionList ��* ���" � ,�*; �����$� %�<�
�14����Value �� � ��%��� 3% 9L��<Item>.
�� �� , � 1���� �, ���$�� 8��� SingleSelectionListExample.aspx.cs
using System;
namespace MSPress.MobWeb.SelListEx
{
public class ExampleWebForm :
System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.Label Label4;
protected System.Web.UI.MobileControls.SelectionList
SelectionList1;
protected System.Web.UI.MobileControls.Command Command1;
protected System.Web.UI.MobileControls.Form Form2;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Command1.Click +=
new System.EventHandler(this.HandleTeamSelection);
}
private void HandleTeamSelection(Object source, EventArgs args)
{
// Display the Stats page
this.ActiveForm = Form2;
String selectedTeamStats = SelectionList1.Selection.Value;
Label4.Text = SelectionList1.Selection + ": "
+ selectedTeamStats;
}
}
}
��C�2:
�� ��-��� �/( 3��"; ������� ����; ' ������$���� %� ��� ���9�� !�" ����-� H�4 : <%@ Page Inherits="MSPress.MobWeb.MultSelListEx.ExampleMobileWebForm"
Language="c#" CodeBehind="multipleselectionlistexample.aspx.cs"%>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Universal Knowledge Solutions s.a.l
134
Assembly="System.Web.Mobile" %>
<mobile:Form runat="server" id="Form1">
<mobile:Label runat="server" StyleReference="title">
Season 2003 results
</mobile:Label>
<mobile:Label runat="server">Select 2 or more teams:</mobile:Label>
<mobile:SelectionList SelectType="MultiSelectListBox"
id="SelectionList1" runat="server">
<item Text="Dunes" Value="Posn:1 Pl:38 Pts:80"/>
<item Text="Phoenix" Value="Posn:2 Pl:38 Pts:70"/>
<item Text="Eagles" Value="Posn:3 Pl:38 Pts:69"/>
<item Text="Zodiac" Value="Posn:4 Pl:38 Pts:68"/>
</mobile:SelectionList>
<mobile:Command runat="server" id="Command1">
Compare Stats!
</mobile:Command>
</mobile:Form>
<mobile:Form runat="server" id="Form2">
<mobile:Label runat="server">Teams Full Stats:</mobile:Label>
<mobile:TextView runat="server" id="TextView1"/>
</mobile:Form>
� 1���� �, ���$�� ���%��� 8��� ������ ,:
using System;
using System.Web.UI.MobileControls;
namespace MSPress.MobWeb.MultSelListEx
{
public class ExampleMobileWebForm :
System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.TextView TextView1;
protected System.Web.UI.MobileControls.SelectionList
SelectionList1;
protected System.Web.UI.MobileControls.Command Command1;
protected System.Web.UI.MobileControls.Form Form2;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Command1.Click +=
new System.EventHandler(this.HandleMultiTeamSelection);
}
protected void HandleMultiTeamSelection(Object source,EventArgs
Universal Knowledge Solutions s.a.l
135
args)
{
this.ActiveForm = Form2;
// Get the list items collection.
MobileListItemCollection colItems = SelectionList1.Items;
String strDisplaytext = "";
foreach (MobileListItem item in colItems)
{
if (item.Selected)
{
strDisplaytext += (item.Text + ": " + item.Value +
"<BR>");
}
}
TextView1.Text = strDisplaytext;
}
}
}
D � 5 �%��� '������ ���Fforeach 3%������ %4��$�� �� T����� ��(%��<;.
%�<� � �$��� �$� ��-��� / 1�� �� ���, ��������� ��9�� :
Universal Knowledge Solutions s.a.l
136
��C�2: ������ ��-��� ����� '����� %4�$� �% � ��" E� ������ 3%�1�� #1� SelectionList ���� � %�4� E� ��( B�-� N/��� K%P��
array ���� �� ArrayList:
<%@ Page Inherits="MSPress.MobWeb.DBListEx.ExampleWebForm"
Language="c#"
CodeBehind="DataboundListExample.aspx.cs" AutoEventWireup="False"
%>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form runat="server" id="Form1">
<mobile:Label id="Label1" runat="server" StyleReference="title">
Season 2003 results
</mobile:Label>
<mobile:Label id="Label2" runat="server">
Select 2 or more teams:
</mobile:Label>
<mobile:SelectionList id="SelectionList1" runat="server"
DataValueField="Stats" DataTextField="TeamName"
SelectType="MultiSelectListBox">
</mobile:SelectionList>
<mobile:Command id="Command1" runat="server">
Compare Stats!
</mobile:Command>
</mobile:Form>
<mobile:Form runat="server" id="Form2">
<mobile:Label id="Label3" runat="server">Teams Full
Stats:</mobile:Label>
<mobile:TextView id="TextView1" runat="server"></mobile:TextView>
</mobile:Form>
��, � 1���� �, ���$�� ���%��� 8��� ���:
using System;
using System.Collections;
using System.Web.UI.MobileControls;
namespace MSPress.MobWeb.DBListEx
{
public class ExampleWebForm :
System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.TextView TextView1;
protected System.Web.UI.MobileControls.SelectionList
SelectionList1;
protected System.Web.UI.MobileControls.Command Command1;
protected System.Web.UI.MobileControls.Form Form2;
Universal Knowledge Solutions s.a.l
137
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
this.Command1.Click +=
new System.EventHandler(this.HandleMultiTeamSelection);
}
private void Page_Load(Object sender, EventArgs e)
{
if (!IsPostBack)
{
ArrayList array = new ArrayList();
array.Add(new TeamStats("Dunes", "Posn:1 Pl:38
Pts:80"));
array.Add(new TeamStats("Phoenix", "Posn:2 Pl:38
Pts:70"));
array.Add(new TeamStats("Eagles", "Posn:3 Pl:38
Pts:69"));
array.Add(new TeamStats("Zodiac", "Posn:4 Pl:38
Pts:68"));
SelectionList1.DataSource = array;
SelectionList1.DataBind();
}
}
private void HandleMultiTeamSelection(
Object source, EventArgs args)
{
this.ActiveForm = Form2;
// Get the list items collection.
MobileListItemCollection colItems = SelectionList1.Items;
String strDisplaytext = "";
foreach (MobileListItem item in colItems)
{
if (item.Selected)
{
strDisplaytext += (item.Text + ": " + item.Value +
"<br/>");
}
}
TextView1.Text= strDisplaytext;
}
}
class TeamStats
{
Universal Knowledge Solutions s.a.l
138
private String teamName, stats;
public TeamStats(String teamName, String stats)
{
this.teamName = teamName;
this.stats = stats;
}
public String TeamName { get { return this.teamName; } }
public String Stats { get { return this.stats; } }
}
}
��0�� � ���� ���"?
'��� %4�"List
�� �/( B�9 '��� %4�" %4�$SelectionList?���� B�9F���� ���F N/�� � '����� %4�" �� T%1� List ��J���� C%� ' �� � ��" '"�
%��<G� ��9�9 ��/ �������� 3���0� !�" �� � �� 'J����� ���� �, 3% �� 3�J�, '�� ��� ���14 3�" !�;���� ����G� 3�����.
� �"�1� % @� � �"�1� 'J��F K%$� ��@%�� ���� �, ?�* � %4�$�� �/( '����� ����� . �"�1��� 'J����� ���� �, %� !�; ����� ��� � '����� !�; ��� ��� ��%; � ��$� 8��� %���� =�� ���� ��� ��%; � ��" �/( '����� %4�" !��� /; �%4��$�� ��� %� ���.
'����� %4�" '"� List ������ )��� � ��%��� 3��$���� ������� ���%� ���� �, ?����� �/( '����� %4�" �$� ��� 5������
��'����.
����� ����� �( �/( '����� %4�" '������ �4���� �P 4��: <mobile:List
runat="server"
id="id"
Alignment="{NotSet|Left|Center|Right}"
BackColor="backgroundColor"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
ForeColor="foregroundColor"
StyleReference="StyleReference"
Wrapping="{NotSet|Wrap|NoWrap}"
DataMember="dataMember"
DataSource="dataSource"
DataTextField="DataTextField"
DataValueField="DataValueField"
Decoration="{None|Bulleted|Numbered}"
Universal Knowledge Solutions s.a.l
139
ItemsAsLinks="{False|True}"
ItemCount="itemCount"
OnItemDataBind="onItemDataBindHandler"
OnItemCommand="onItemCommandHandler"
OnLoadItems="loadItemsHandler">
<!-- Optional statically declared list items -->
<Item Text="Text" Value="Value" Selected="{True|False}" />
</mobile:List>
�� �"���� =%� ��� �/( '����� %4�" '�� 8J�4������(� %�/� D���0�� :
DataMember String ������� %4�" ���%� ��" �4���� ./( '��� �/( '�-� ���� � %�4�� K%@DataSet
��DataTable . ��* ������ '� ���� D � K%@DataSet '����� %4�" �% 5� N/��
B�. DataSource Object ���� � %�4�� %4�$�� �/( ���%� ��" � ./( ����
K%@ �4����Collection� �DataSet �-� ���� ��� %�4�.
DataTextField String ���"K%P� ?� ��%� '����� %4�" ��� �
DataSet� �Collection '� �4���� ./( ���� .%��<; '� N/�� ���� ��� %�4� ��* �����
��J���� ��*. DataValueField String K%P� ?� ��%� '����� %4�" ��� ����"
DataSet� �Collection '� �4���� ./( ���� N/�� ���� ��� %�4� ��* �����'�� ' ���
��J���� %4��" �� %4�" ��� � ��%��� � 1����. Decoration System.Web.UI
.MobileControls.
ListDecoration
None|Bulleted|Numbered
'"�� ���� ��*%$���� !�" �4���� ./( ����HTML��J���� %4��" %��<; ��9 .
ItemsAsLinks False | True �4�� ��� �, '���� ����" � ' F '����� � %Text �Value 8� ���-�� ��J���� �, %4�" ��� ���%�� ����URLB� 8���� . ��"�� F ���� �4���� ./( True '��
?3%9��� ������� K%$���� ������ %�4��� !�; � %� %� ��� D�� N� � ���
ItemCount Integer �4���� ./( � $��� %4��$� ������ ��$��J����.
Universal Knowledge Solutions s.a.l
140
D����ItemCommand D���� S��$� �� % '� %��� ����" .I�"��� 5����� D���� S��$� ��� � $� ��� �, ; ��J���� �� %4�" '������
�4���� �� FItemsAsLinks !�; True
D����LoadItems D���� S��$� �� % '� %4��" � ��� ������ ��" D���� �/( T7 ; '� ������ ��� %�4� �� ��J���� !�; 3�.
!�; ' ���� � ����; � $1� ��" 3��" � ��$�� ./( '�� T7 ��� � ��� � ��" �� T,�%�� D � ���14
D���� �/��.
���� � ��"? �������List: � � $*�� %4�$�� �/( '����� ��� B�� ?���� ��%�/:
X � �"�1��� % @ � $*��� :� $*��� ./( �, '� %��<;%� ��� !�" 3%���� ��� ��J���� %4��" . %��<G� ��9 � ��� ��( ��� �4���� '������Decoration.� D���� S��$�� �� F � ��� '�" 5� ItemCommand������ ./( �, .
X � �"�1��� � $*��� :'� ��� �, D���� S��$�� �� F � $� ItemCommand N%� � ����� %4��" �� %4�" �� ��J�� ��%�B �" %���� ��" D���� S��$� A�"���� '�� .
��-�1: H*� �/( '����� %4�" '����� ������ ��-���:
<%@ Page Inherits="MSPress.MobWeb.ListItmCmd.MyWebForm" Language="c#"
CodeBehind="ListItemCommandExample.aspx.cs"%>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form runat="server" id="Form1">
<mobile:Label runat="server" id="Label1" StyleReference="title">
Season 2003 results
</mobile:Label>
<mobile:Label runat="server" id="Label2">Select a
team:</mobile:Label>
<mobile:List runat="server" id="List1">
<item Text="Dunes" Value="Posn:1 Pl:38 Pts:80"/>
<item Text="Phoenix" Value="Posn:2 Pl:38 Pts:70"/>
<item Text="Eagles" Value="Posn:3 Pl:38 Pts:69"/>
<item Text="Zodiac" Value="Posn:4 Pl:38 Pts:68"/>
</mobile:List>
</mobile:Form>
<mobile:Form runat="server" id="Form2">
<mobile:Label runat="server" id="Label3" StyleReference="title">
Team Full Stats:
</mobile:Label>
<mobile:Label runat="server" id="Label4" />
</mobile:Form>
Universal Knowledge Solutions s.a.l
141
�, � 1���� �, ���$�� ���%��� 8��� ����: using System;
using System.Web.UI.MobileControls;
namespace MSPress.MobWeb.ListItmCmd
{
public class MyWebForm : System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.List List1;
protected System.Web.UI.MobileControls.Label Label4;
protected System.Web.UI.MobileControls.Form Form2;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.List1.ItemCommand += new
ListCommandEventHandler(this.ClickTeamSelection);
}
private void ClickTeamSelection(
Object source,
ListCommandEventArgs args)
{
// Display the Stats page
this.ActiveForm = Form2;
String strSelectedTeamStats = args.ListItem.Value;
Label4.Text = args.ListItem.Text
+ ": " + strSelectedTeamStats;
}
}
}
���$��� �7� �� %������ %4�$�� � ���� ���F ���� ���%��� 8��� �, <�7�args D���� S��$� !�; .% %�� '� N/�� ClickTeamSelection� �� ���� 8��� !�; ��4��� ��� D � '����� i 4��args.ListItem.Value �args.ListItem.Text
��-��� �/( � P9� �� �� ���� !�"��� ��9�����:
Universal Knowledge Solutions s.a.l
142
� �� : ��� ����� J / ����� �������: '����� %4�" #�$�SelectionList 24�� �� �/( '����� %4�" %��� PagedControl !�; ' ���� �4�� '"� B�� N�
���14. �� ��� A� "; 5� �4���� ./( � $1��True �4���� Paginate � �, '����� %4�" N��� N/�� C/����List.
�, ���14 !�; ��[� ' ���� � $1� ���N%� %��<G� 3%�F 5�� ���14 !�; ��J���� C%� ' �� �� �4���������. �, ���������14 !�; 84���� ' ���� ���$�� , � �4���� !�; �� F A� "; 5� ItemCount %4��$�� �� ������ ��$�� A� "G
���14�� �� %�" .%��<; ��� N/��. %4�" '�� 3� �� ��14 �� 5� ��"� ���14 !�; ' ����� '����� N%� D�� T7 ; LoadItems.
��-�:
H*� 3%�1�� ./( ������ ��-���: <%@ Page Inherits="MSPress.MobWeb.CusPag.ExampleWebForm" Language="c#"
CodeBehind="CustomPaginationExample.aspx.cs" AutoEventWireup=
"False" %>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
Universal Knowledge Solutions s.a.l
143
<mobile:Form runat="server" id="Form1" paginate="true">
<mobile:Label runat="server" StyleReference="title">
Season 2003 results</mobile:Label>
<mobile:List id="List1" runat="server"></mobile:List>
</mobile:Form>
��, � 1���� �, ���%��� 8��� ���:
using System;
using System.Collections;
using System.Web.UI.MobileControls;
namespace MSPress.MobWeb.CusPag
{
public class ExampleWebForm :
System.Web.UI.MobileControls.MobilePage
{
private TeamStats[] _premierTable;
protected System.Web.UI.MobileControls.List List1;
public ExampleWebForm()
{
// In the constructor, create the data source we will use.
_premierTable = new TeamStats[16];
_premierTable[0] = new TeamStats("Dunes", "Pts:80");
_premierTable[1] = new TeamStats("Phoenix", "Pts:70");
_premierTable[2] = new TeamStats("Eagles", "Pts:69");
_premierTable[3] = new TeamStats("Zodiac", "Pts:68");
_premierTable[4] = new TeamStats("Arches", "Pts:66");
_premierTable[5] = new TeamStats("Chows", "Pts:61");
_premierTable[6] = new TeamStats("Creation", "Pts:57");
_premierTable[7] = new TeamStats("Illusion", "Pts:54");
_premierTable[8] = new TeamStats("Torpedo", "Pts:52");
_premierTable[9] = new TeamStats("Generals", "Pts:52");
_premierTable[10] = new TeamStats("Reaction","Pts:51");
_premierTable[11] = new TeamStats("Peanuts", "Pts:49");
_premierTable[12] = new TeamStats("Caverns", "Pts:48");
_premierTable[13] = new TeamStats("Eclipse", "Pts:42");
_premierTable[14] = new TeamStats("Dragons", "Pts:42");
_premierTable[15] = new TeamStats("Cosmos", "Pts:42");
}
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
Universal Knowledge Solutions s.a.l
144
this.Load += new System.EventHandler(this.Page_Load);
this.List1.LoadItems +=
new LoadItemsEventHandler(this.LoadTeams);
}
private void Page_Load(Object sender, EventArgs e)
{
// Tell the List how many items it can expect by the time
// it has asked for them all.
List1.ItemCount = _premierTable.Length;
}
private void LoadTeams(Object source, LoadItemsEventArgs args)
{
List1.Items.Clear();
// The LoadItemsEventArgs tells us which items and how
many.
for (int i = 0; i < args.ItemCount; i++)
{
// Get the relevant item from the array;
// Create a MobileListItem.
int intTablePosn = args.ItemIndex + i;
MobileListItem lstItem = new MobileListItem(
string.Format("{0} {1}",intTablePosn+1,
_premierTable[intTablePosn].TeamName),
_premierTable[intTablePosn].Stats);
// Add the item to the Items collection of the List
control.
List1.Items.Add(lstItem);
}
}
}
class TeamStats
{
private String teamName, stats;
public TeamStats(String teamName, String stats)
{
this.teamName = teamName;
this.stats = stats;
}
public String TeamName
{ get { return this.teamName; } }
public String Stats
{ get { return this.stats; } }
}
}
Universal Knowledge Solutions s.a.l
145
���������� ��9��� �� �9 ��-��� �/( / 1�� �� ��:
��0�� � ���� ���"? '��� %4�"List
�� �/( B�9 '��� %4�" %4�$SelectionList?���� B�9F���� ���F N/�� � '����� %4�" �� T%1� List� ��" '"� ��J���� C%� ' ��
%��<G� ��9�9 ��/ �������� 3���0� !�" �� � �� 'J����� ���� �, 3% �� 3�J�, '�� ��� ���14 3�" !�;���� ����G� 3�����.
� �"�1� % @� � �"�1� 'J��F K%$� ��@%�� ���� �, ?�* � %4�$�� �/( '����� ����� . ����� ��� � �"�1��� 'J����� ���� �, %� !�;'����� !�; ��� ��� ��%; � ��$� 8��� %���� =�� ���� ��� ��%; � ��" �/( '����� %4�" !��� /; �%4��$�� ��� %� ���.
'����� %4�" '"� List ������ )��� � ��%��� 3��$���� ������� ���%� ���� �, ?����� �/( '����� %4�" �$� ��� 5������
'������.
����� ���� � ��"? ��List:
� � $*�� %4�$�� �/( '����� ��� B�� ?���� ��%�/: X � �"�1��� % @ � $*��� : � $*��� ./( �, '� %��<;%� ��� !�" 3%���� ��� ��J���� %4��" . %��<G� ��9 � ��� ��( ���
�4���� '������Decoration.� D���� S��$�� �� F � ��� '�" 5� ItemCommand������ ./( �, . X � �"�1��� � $*��� :'� ��� �, D���� S��$�� �� F � $� ItemCommand N%� � ��� ��J���� %4��" �� %4�" ��
��%�B �" %���� ��" D���� S��$� A�"���� '�� .
� �� : ��� ����� J / ����� �������:
'����� %4�" #�$�SelectionList'����� %4�" %��� 24�� �� �/( PagedControl !�; ' ���� �4�� '"� B�� N� ���14.
�� ��� A� "; 5� �4���� ./( � $1��True �4���� Paginate � �, '����� %4�" N��� N/�� C/����List. ���14 !�; ��[� ' ���� � $1� ��� �,N%� %��<G� 3%�F 5�� ���14 !�; ��J���� C%� ' �� �� �4���������.
�, ���������14 !�; 84���� ' ���� ���$�� , � �4���� !�; �� F A� "; 5� ItemCount %4��$�� �� ������ ��$�� A� "G ���14�� �� %�" .%��<; ��� N/��.
3� �� ��14 �� 5� ��"� ���14 !�; ' ����� '����� %4�" '�� N%� D�� T7 ; LoadItems.
Universal Knowledge Solutions s.a.l
146
� � ���� ���"?��0� ���� ��"?ObjectList
�� �/( %��$ %4�$ �%4�"?�� �� ��J��� ���� � %�4� �� ���� ��� %��<; ��0� B,�( ���%��� � �9 � '������ %� ��� ��"� =%�� 3� �" ���� %��<\� '�� ��J���� ./( %4��" ���.
!�; �,�*G���T������ %���0�� T�$�� 3� � '����� %4�" %,� ��J���� �, %4�" ��� �� �% ��� �. ��J���� ./( �% ?�* � ���
B �" %���� '� N/�� %4�$�� 5�� 2���� =%�� ��J�F %4��$�. '����� %4�" E� ����� �( ���List '����� %4�" '"� ObjectList 5������ ����14 !�; ' ����.
H*�� �/( '����� %4�" '����� � ����� �P 4��:
<mobile:ObjectList
runat="server"
id="id"
Alignment="{NotSet|Left|Center|Right}"
BackColor="backgroundColor"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
ForeColor="foregroundColor"
StyleReference="StyleReference"
Wrapping="{NotSet|Wrap|NoWrap}"
AutoGenerateFields="{True|False}"
CommandStyle="StyleReference"
DataMember="dataMember"
DataSource="dataSource"
DefaultCommand="onDefaultCommandHandler"
ItemCount="itemCount"
LabelField="fieldname"
LabelStyle="StyleReference"
OnItemDataBind="onItemDataBindHandler"
OnItemCommand="onItemCommandHandler"
OnLoadItems="loadItemsHandler">
OnShowItemCommands="onShowItemCommandsHandler"
TableFields="tableFields">
<!-- Optional explicitly declared fields -->
<Field
id="id"
Title="titleText"
DataField="value"
FormatString="formatString"
Visible="{True|False}" />
</Field>
Universal Knowledge Solutions s.a.l
147
<!-- Optional explicitly declared commands -->
<Command Name="CommandName" Text="CommandText" />
</mobile:ObjectList>
H*� '(� ������ ������8J�4����/( '����� %4�" ����� ���� D���0�� : � �4�����D���� ���� 24���
AllFields
System.Web.UI.
MobileControls.
ObjectListFieldCollection
K%@ �� ��� ./( � $�ObjectListFieldCollection
.ObjectListField '� ��� ��� %4�" !�; ���� ��� %�4� �� B�,�*;
'�����ObjectList B1 %$� '� A�� 3% 9L��� '������<Field>� � � ���
�4����Fields���%��� 8��� ��* .�� '���� �� W�8J�4� ������
� �,�*; E �� �� ��� 3�������� ����;�"������ ./( �� ���
AutoGenerateFields
True|False
E �� %��<G '����� %4�" ���"\� '���
K%@ �� ������DataSet.
BackCommandText
String
� � $�� '���� '������ 8��� 3��"; ��* ��%��$��� 8���� %��<; �� 3��
� J%�� ��J���� !�; � 4�1���.
Commands
System.Web.UI.
MobileControls. ObjectList-
Command-Collection
K%@ 3��"\� '���ObjectListCommandCollection
K%@ ��� D �ObjectListCommand ./( ��*
3% 9L���� 2%$ %4�" ��� �"������<command>�; B�,�*; '� 8��� !
���%���.
CommandStyle
�������� ���0� �� H��4 ���,
StyleSheet
'������ ���� �4���� ./( � $�3���0� !�" %���0� %4��" %��<G. � � ?� J���� �4���� ./( � ��� '�
5� �� E� �� �* 5� W�/� ���� ��� ��1 %$� �( W�/� �*,0� �� % ��
�" �P 4 ��* ��� �� '����� %4
Universal Knowledge Solutions s.a.l
148
'�����.
DataMember
String
'����� %4�" ��� ����" �, '���� K%P� ?� ��%�DataSet� � K%@
DataTable. '� �4���� ./( ���� K%@ ��* ������DataSet N/��
B� '����� %4�" �% '� .
DataSource
Object
K%P�� '�DataSet� � K%@Collection��9 N/�� %�4�
���� ���
DefaultCommand
String
%4�$�� �� F �J���� ��9� ��J���� %�<� �4����� 3������LabelField !�"
��$9� ���%� ��9 . �/( %� ��� �9�9 !�; '������ /�L ���%� �/�� � ,�*; ���� %�<� =%��
%4�$��. �4���� � $� '� �/;
DefaultCommand 8��� ��* ��%��� �� %4�" %� ��� � ��" �\, �
D���� T7 \� '�� ��J����OnItemCommand �� F % %�� E�
B �; ./( �4���� . �< B�� '�$�� E� %4�$�� � 4�1� !�; ��4��� ������\�
��4��� �7� ��More � %�<� ���� %���� %4��" N� !�; �74��� 3�/����
��1 %$�� ��F =%��.
Details
System.Web.UI.
MobileControls.Panel
'��� %4�" 3��"\� �4���� ./( '���Panel � 4�1� %��<; �, '������ %4��$�� . '��� ����" � ��" �4���� ./(
5������ T � ��� 8J�4� � $� � %� ��* B$*�� ��F N/�� '����� %4�"
5�����. ObjectList1.Details
.FindControl(“ControlID”);
DetailsCo mmandText
String
� � $�� �4���� ./( '���� 8��� 3��"; %��<\� '�� N/�� ��%�� '������
� 4�1��� �9�9 . �4���� ./( '����
Universal Knowledge Solutions s.a.l
149
��*%$�� E�WML �, .
Fields
ObjectListFieldCollection
�4���� �4���� ./( B�9�AllFields . K%@ 3��"\� '��� D �
ObjectListFieldCollection N/�� K%@ N��� ObjectListField ���
B�,�*; ��� ���� ��� %�4� �, ��� '����� %4�" !�;ObjectList N/��
3% 9L��� '����� B1 %$� '�<Field> �� '������ ���%��� 8��� T % �"
�4����Fields. �4���� #�$�AllFields 3�$���
�4���� ./( � ��� ��� �, 3A�%��� �,�*;� T% '������ ���� ����;
K%P��ObjectListFieldCollection
ItemCount
Integer
' ���� ���� �, �4���� ./( '���� ���� D �� ���14 !�; 84���� %�4� ��* %4��$�� ������ ��$��
���� ���DataSet. !�� � 5� �4���� ./( '����
�4�� �*Form.Paginate !�; �� ���True
LabelField
String
N/�� ���� ��� %�4� �, ����� '� ������� � ��� B������ '� .
���� ��J���� ��� ��0� � ���� ��� '������ %�<�� %� ���� �� , '��
B� 4�1� %�<�� %4�$��. �4���� '���LabelFieldIndex
� ��$1�� #1� ' ����� � ���� ���� �������� ��* �"�AllFields
LabelStyle
String
� 3��"\� '���� '������ ���� � $�� �%��� %��<G. <,��� �4���� ./(
W�/� 3%%����� ���� �� � � ���� F !�" ��� ����- �� F !�" �<,����� �, ����,
(� '����� %4�" �P 4 ��* ��1 %$�
Universal Knowledge Solutions s.a.l
150
'����� ��� ��.
MoreText
String
$�� '���� � � '������ 8��� 3��"; ��%��More ��*%$�� !�"
HTML. SelectedIndex
Integer
� 3��"\� '���� %4�$�� � ���� � $�%������.
Selection
System.Web.UI.
MobileControls.
ObjectListItem
� %������ %4�$�� 3��"\� '���� �� ���null%4�" N� %� ��� '�" ��� �, .
TableFields
String; ���41� ������ A��� �� ��J�F
� ���� ��4�1�
�4���� �� F � $�� '�� '� �/;TableFields !�" ��J���� %��<; '�
�, ���� ���� ���" �� ����� ���� �4����� ������ ����� ' F ��
LabelField. �4���� � $�� ��F �/;
DefaultCommand � ������ ���� '"� �� ���$�� �/( ���� ������
������ ����� ' F �( !��0� � �� F �4�����LabelField !�; �,�*;
��%��More. �4���� �� F A� "\� ���F �/;
TableFields %4�" �� � -�� '� 3��"0� E� ���� '������ ��J���� �� �4���� ./( ��* ������� �,%$���
B , %�<� ��� !�; �,�*;More H��� ������ E �� � I% !�; ��4����
%4�$��� �4����.
ViewMode
System.Web.UI.
MobileControls.
ObjectListViewMode
List|Commands|Details
�� �$��� E*� � $�� �4���� ./( H�� %4�$��ObjectList. /�L� �� ���
' ��� �4���� ./(: X List %��<\� '��� ����
���� %4��" �, � J%�� ��J. X Details � 4�1� %��<\� '���
%������ %4�$��. X Commands �(%��<; '�
Universal Knowledge Solutions s.a.l
151
��/ 3���0� !�" �, 2������� 3% P4�� ��9�9��
��������� !��0� �9�9�� �( %� ��� �$� ��*%" '� ���� D � �� %4�$� '������
%4��" �� ����� ��J�F %�<�<Command> !�; �,�*;
�; ���%� � 41��� �� �$��� !. ��J���� �� %4�" %� ��� '������ !�" �4���� !�; ��4���� B� ]���� ��F
ViewMode
D����ItemCommand
D���� S��$� �� % '�
.I�"��� '� N/�� D���� S��$� ��� �� %4�" %� ���� '������ '�� ����" ��� � 4�1� %��<\� � ��%��� %���0�
�$��%4�. 3% 9L��� '������ %���0� 2 %$� '�
<Command>� � E� ���$��� �7� �� �4���� �(���� ���� �"������
Commands
D����LoadItems
D���� S��$� �� % '�
� $� '� � � 5�� � D���� �/( �4����ItemCount ' ���� � $1��
���14 !�; 84���� . T � ��� '�� �$� A�"���� 3%� �� �, �/( D���� S�
3� �� ���� � 5� '� . �/( H� %4�" !�; ���� ��� % %��� D����
5� �� 5� '�����. % %�� �" ?�*�" 3���� �$,� ���� ��� ��.
D����ShowItemCommands
D���� S��$� �� % '�
.I�"��� '� N/�� D���� S��$� ��� %4�" � 4�1��� %��<; '� ����"
�%���0�� �4���� �74��� � �9�. �,�*; ��� �/( D���� S��$� �,
��� %���� 2/�� %���0� �� ��J�F A���.%��<; '� N/�� %4�$��.
Universal Knowledge Solutions s.a.l
152
���� � ��"? �������ObjectList: '����� %4�" B �I �� ��� �� T�1� ���"0� �� �"���� A��� �� �/( '����� %4�" ��� List.
� 2J�<��� '(� ��� '� ��� �/( '����� %4�$� ��� ���� '��� %4�" �7� �� ��� �L� ��� List�( : 1 X ���� � %�4� �� ���� 3�" %��<;. 2 X ���� ���" �� ��J��� �(%��<; �" ?�*�" ���� ��* %4��$�� %��<;. 3 X ��J���� �� %4�$�� #1�� ��%� %�� �� %-�� � ���. 4 X � 3��$���� ��%� ��� %���� 3�" � �����J���� �. 5 X � ���- �1 <�� ���� 3�" %��<; � ����; E� � �� ��� %��<;.
8�� ��-� ��* ��������� '��� ��� ��� ./( �� �� H *���:
1; ��"�� ���� $� ���� �? ��86/:
<%@ Page Inherits="MSPress.MobWeb.ObjListEx.MyWebForm" Language="c#"
CodeBehind="ObjectListExample.aspx.cs" AutoEventWireup="False" %>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form runat="server" >
<mobile:Label runat="server" StyleReference="title">
Season 2003 results</mobile:Label>
<mobile:ObjectList id="ObjectList1" runat="server">
AutoGenerateFields="false">
<Field Title="Team" DataField="TeamName"></Field>
<Field Title="Won" DataField="Won"></Field>
<Field Title="Drawn" DataField="Drawn"></Field>
<Field Title="Lost" DataField="Lost"></Field>
<Field Title="Pts" DataField="Points" Visible="false"></Field>
</mobile:ObjectList>
</mobile:Form>
��, � 1���� �, ���%��� 8��� ���: using System;
using System.Collections;
using System.Web.UI.MobileControls;
namespace MSPress.MobWeb.ObjListEx
{
public class MyWebForm : System.Web.UI.MobileControls.MobilePage
{
protected ObjectList ObjectList1;
override protected void OnInit(EventArgs e)
Universal Knowledge Solutions s.a.l
153
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
private void Page_Load(Object sender, EventArgs e)
{
if (!IsPostBack)
{
ArrayList array = new ArrayList();
array.Add(new TeamStats("Dunes",1,38,24,8,6,80));
array.Add(new TeamStats("Phoenix",2,38,20,10,8,70));
array.Add(new TeamStats("Eagles",3,38,20,9,9,69));
array.Add(new TeamStats("Zodiac",4,38,20,8,10,68));
ObjectList1.DataSource = array;
ObjectList1.LabelField = "TeamName";
ObjectList1.DataBind();
}
}
}
class TeamStats
{
private String _teamName;
private int _position, _played, _won, _drawn, _lost, _points;
public TeamStats(String teamName,
int position,
int played,
int won,
int drawn,
int lost,
int points)
{
this._teamName = teamName;
this._position = position;
this._played = played;
this._won = won;
this._drawn = drawn;
this._lost = lost;
this._points = points;
}
public String TeamName { get { return this._teamName; } }
public int Position { get { return this._position; } }
public int Played { get { return this._played; } }
Universal Knowledge Solutions s.a.l
154
public int Won { get { return this._won; } }
public int Drawn { get { return this._drawn; } }
public int Lost { get { return this._lost; } }
public int Points { get { return this._points; } }
}
} 2; ���� ���? $� ��0��� �!��86/ $? -�=�? ���� $�= ���"� � ��86/.
<%@ Page Inherits="MSPress.MobWeb.ObjListTblEx.MyWebForm" Language="c#"
CodeBehind="ObjectListTableExample.aspx.cs" AutoEventWireup="False"
%>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form runat="server"
<mobile:Label runat="server" StyleReference="title">
Season 2003 results</mobile:Label>
<mobile:ObjectList id="ObjectList1"
runat="server"
AutoGenerateFields="true"
TableFields="TeamName;Position;Points">
</mobile:ObjectList>
</mobile:Form>
3; ��0�� � $� ��"� � S�" *��� ��� $� �C�� ���4�.
<%@ Page Inherits="MSPress.MobWeb.ObjListCmdsEx.MyWebForm"
Language="c#"
CodeBehind="ObjectListItemCommandsExample.aspx.cs"
AutoEventWireup="False" %>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form runat="server" id="Form1">
<mobile:Label runat="server" StyleReference="title">
Season 2003 results</mobile:Label>
<mobile:ObjectList id="ObjectList1" runat="server"
AutoGenerateFields="false"
LabelField="TeamName">
<Field Title="Team" DataField="TeamName"></Field>
<Field Title="Won" DataField="Won"></Field>
<Field Title="Drawn" DataField="Drawn"></Field>
<Field Title="Lost" DataField="Lost"></Field>
<Field Title="Points" DataField="Points"></Field>
Universal Knowledge Solutions s.a.l
155
<Field Title="Champs. Cup" DataField="ChampionsCup"
Visible="false">
</Field>
<Field Title="Inter-City Cup" DataField="InterCup"
Visible="false">
</Field>
<Command Name="ChampsCup" Text="Champions Cup"/>
<Command Name="InterCityCup" Text="Inter-City Cup"/>
</mobile:ObjectList>
</mobile:Form>
<mobile:Form runat="server" id="Form2">
<mobile:Label runat="server" StyleReference="title">
Season 2003 European Results</mobile:Label>
<mobile:Label runat="server" id="Label1"/>
<mobile:Link runat="server" NavigateUrl="#Form1">
Back
</mobile:Link>
</mobile:Form>
��, � 1���� �, ���%��� 8��� ���: using System;
using System.Collections;
using System.Web.UI.MobileControls;
namespace MSPress.MobWeb.ObjListCmdsEx
{
public class MyWebForm : System.Web.UI.MobileControls.MobilePage
{
protected ObjectList ObjectList1;
protected Form Form2;
protected Label Label1;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
this.ObjectList1.ItemCommand +=
new
ObjectListCommandEventHandler(this.Team_OnItemCommand);
}
private void Page_Load(Object sender, EventArgs e)
{
Universal Knowledge Solutions s.a.l
156
if (!IsPostBack)
{
ArrayList array = new ArrayList();
array.Add(new TeamStats("Dunes",1,38,24,8,6,80,
"Quarter Finals",""));
array.Add(new TeamStats("Phoenix",2,38,20,10,8,70,
"Quarter Finals",""));
array.Add(new TeamStats("Eagles",3,38,20,9,9,69,
"","Winners"));
array.Add(new TeamStats("Zodiac",4,38,20,8,10,68,
"Semi Finals",""));
ObjectList1.DataSource = array;
ObjectList1.LabelField = "TeamName";
ObjectList1.DataBind();
}
}
private void Team_OnItemCommand(
Object sender,
ObjectListCommandEventArgs e)
{
Label1.Text = "Did Not Compete"; //Default
this.ActiveForm = Form2;
if (e.CommandName == "ChampsCup")
{
// Set the label to the Champions Cup result.
if (e.ListItem["ChampionsCup"] != "")
Label1.Text = "Champions Cup: " +
e.ListItem["ChampionsCup"];
}
else if (e.CommandName == "InterCityCup")
{
// Set the label to the Inter-City Cup result.
if (e.ListItem["InterCup"] != "")
Label1.Text = " Inter-City Cup: " +
e.ListItem["InterCup"];
}
}
}
class TeamStats
{
private String _teamName;
private int _position, _played, _won, _drawn, _lost, _points;
private String _champsCup, _interCup;
public TeamStats(String teamName,
int position,
int played,
int won,
Universal Knowledge Solutions s.a.l
157
int drawn,
int lost,
int points,
String championsCup,
String interCup)
{
this._teamName = teamName;
this._position = position;
this._played = played;
this._won = won;
this._drawn = drawn;
this._lost = lost;
this._points = points;
this._champsCup = championsCup;
this._interCup= interCup;
}
public String TeamName { get { return this._teamName; }}
public int Position { get { return this._position; }}
public int Played { get { return this._played; }}
public int Won { get { return this._won; }}
public int Drawn { get { return this._drawn; }}
public int Lost { get { return this._lost; }}
public int Points { get { return this._points; }}
public String ChampionsCup { get { return this._champsCup; }}
public String InterCup{ get { return this._interCup; }}
}
}
4; ��0�� � $� ����� � ������� ����� �? ���4�.
<%@ Page Inherits="MSPress.MobWeb.ObjListShowItems.MyWebForm"
Language="c#"
CodeBehind="ObjectListOnShowItemsExample.aspx.cs"
AutoEventWireup="False" %>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form runat="server" id="Form1">
<mobile:Label runat="server" StyleReference="title">
Season 2003 results</mobile:Label>
<mobile:ObjectList id="ObjectList1" runat="server"
AutoGenerateFields="true"
LabelField="TeamName">
<Command Name="ChampsCup" Text="Champions Cup"/>
<Command Name="InterCityCup" Text="Inter-City Cup"/>
</mobile:ObjectList>
</mobile:Form>
Universal Knowledge Solutions s.a.l
158
<mobile:Form runat="server" id="Form2">
<mobile:Label runat="server" StyleReference="title" id="Label1"/>
<mobile:Label runat="server" id="Label2"/>
<mobile:Link runat="server" NavigateUrl="#Form1">
Back
</mobile:Link>
</mobile:Form>
���9�� /�L � 1���� �, ���%��� 8���: using System;
using System.Collections;
using System.Web.UI.MobileControls;
namespace MSPress.MobWeb.ObjListShowItems
{
public class MyWebForm : System.Web.UI.MobileControls.MobilePage
{
protected ObjectList ObjectList1;
protected Form Form2;
protected Label Label1;
protected Label Label2;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
this.ObjectList1.ItemCommand += new
ObjectListCommandEventHandler(this.Team_OnItemCommand);
this.ObjectList1.ShowItemCommands += new
ObjectListShowCommandsEventHandler(this.SetItemCommands);
}
private void Page_Load(Object sender, EventArgs e)
{
// Not shown
// As in previous example
}
private void Team_OnItemCommand(
Object sender,
Universal Knowledge Solutions s.a.l
159
ObjectListCommandEventArgs e)
{
this.ActiveForm = Form2;
if (e.CommandName == "ChampsCup")
{
// Set the label to the Champions Cup result.
Label1.Text = "Champions Cup 2003";
Label2.Text = e.ListItem["ChampionsCup"];
}
else if (e.CommandName == "InterCityCup")
{
// Set the label to the Inter-City Cup result.
Label1.Text = "Inter-City Cup 2003";
Label2.Text = e.ListItem["InterCup"];
}
}
private void SetItemCommands(
Object sender,
ObjectListShowCommandsEventArgs e)
{
// Remove either the Champions Cup or Inter-City Cup
// command if the team didn't compete (if field is blank).
if (e.ListItem["ChampionsCup"] == "")
e.Commands.Remove("ChampsCup");
if (e.ListItem["InterCup"] == "")
e.Commands.Remove("InterCityCup");
}
}
class TeamStats
{
private String _teamName;
private int _position, _played, _won, _drawn, _lost, _points;
private String _champsCup, _interCup;
public TeamStats(String teamName,
int position,
int played,
int won,
int drawn,
int lost,
int points,
String championsCup,
String interCup)
{
this._teamName = teamName;
this._position = position;
this._played = played;
this._won = won;
Universal Knowledge Solutions s.a.l
160
this._drawn = drawn;
this._lost = lost;
this._points = points;
this._champsCup = championsCup;
this._interCup= interCup;
}
public String TeamName { get { return this._teamName; }}
public int Position { get { return this._position; }}
public int Played { get { return this._played; }}
public int Won { get { return this._won; }}
public int Drawn { get { return this._drawn; }}
public int Lost { get { return this._lost; }}
public int Points { get { return this._points; }}
public String ChampionsCup { get { return this._champsCup; }}
public String InterCup{ get { return this._interCup; }}
}
}
���� ��"?ObjectList:
( �/( '����� %4�"� � �� ��J��� ���� � %�4� �� ���� ��� %��<; ��0� B,�( ���%��� � �9 %4�"� '������ %� ��� ��"=%�� 3� �" ���� %��<\� '�� ��J���� ./( %4��" ���.
� �% ��� ���� %���0�� T�$�� 3� � '����� %4�" %,� �/( !�; �,�*G����J���� �, %4�" ��� �. ��J���� ./( �% ?�* � ��� B �" %���� '� N/�� %4�$�� 5�� 2���� =%�� ��J�F %4��$�.
'����� %4�" E� ����� �( ���List '����� %4�" '"� ObjectList 5������ ����14 !�; ' ����.
Universal Knowledge Solutions s.a.l
161
�3�� �� A��� � ��� �:
B �C � E�=�� �: � ���"?�F�F��(� � ���� ������� � ����� � :
D�� ��4�� ��14�� �3% 9L� �% 9L� �P� ������ �'��� %4�" .
����: ������ ���� ��� ��� '(�� �(���"; � 1 � !�"� �44���� '����� %4��" K$� E� ���$��� � 1 � !�" ����� ./( �, 2%$�� .
'��� %4��" ����� ./( � P�MobileCheckBox� MobileMultiLineInput �MobileDynamicImageControl
������� ��!�:
!�" �41�� �/( �, 5�� �� 2%$� : • '����� %4�"MobileCheckBox • '����� %4�"MobileMultiLineInput • '����� %4�"MobileDynamicImageControl.
Universal Knowledge Solutions s.a.l
162
����� � ���� � ���"? �������
�� �� % -��� ��*�� EF���� ����http: //www.asp.net� %� � ��F �� �(I��� '� ���� '����� %4��" �� � �$�� � ����� ����� ���� '����� %4��" �"���� !�;������ ASP.NET Mobile����� � � ��* %4��$�� ./( '������ '��� 2 �, .
��� ��� %& ����Visual Studio:
�4���� % � ��� �J � ���$�� ��� �,Visual Studio� ����� ���%��� )���� %4��$�� ./( �,�*G �1� :
%� %� ���� 'F '-Browse � '����� %4�$� %1��� 8��� �" %�$ N/�� 2���� A�����
Universal Knowledge Solutions s.a.l
163
���*� � �0� ������� ��? � �� %& ���Visual Studio :
5� ������ ��* � $ ����� ��1���� g� ������ ./( �, /bin 2�� � ��� !�; E�%��� �,�*; '- ��� T � ���� 8���� aspx.
'����� %4�" ���� �, ?7-�,MobileCheckBox��9�� �� 2�*��� % �$��� ��� : <%@ Register TagPrefix="mobCB" Namespace="MobileCheckbox"
Assembly="MobileCheckbox" %> �P 4��� �/( '����� %4�" '����� ����� �(�$��
<mobCB:Checkbox id="Checkbox1" runat="server" …></mobCB:Checkbox>
X
���� � ��"?MobileCheckBox
'����� %4�" � �: �/( '����� %4�" '�� CheckBox ��*%$�� !�" ��$�� �4�� � ����; E� � ��$�� HTML �CHTML
�WML.
� � �1������ ��*%$���� !�" �/( '����� %4�" %�< 2 � ������ ��9��.
Universal Knowledge Solutions s.a.l
164
�/( '����� %4�" �� 3��1�7��� �,�*; �7� �� W� � � ���"; �� <device> 3% 9L� ��* <mobileControls> 2�� �, ���"G�web.config:
<configuration>
<system.web>
<mobileControls>
<device name="MobileCheckboxHtmlDeviceAdapter"
inheritsFrom="HtmlDeviceAdapters">
<control name="MobileCheckbox.Checkbox,MobileCheckbox"
adapter="MobileCheckbox.HtmlCheckboxAdapter,MobileCheckbox"/>
</device>
<device name="MobileCheckboxWmlDeviceAdapter"
inheritsFrom="WmlDeviceAdapters">
<control name="MobileCheckbox.Checkbox,MobileCheckbox"
adapter="MobileCheckbox.WmlCheckboxAdapter,MobileCheckbox"/>
</device>
<device name="MobileCheckboxChtmlDeviceAdapter"
inheritsFrom="ChtmlDeviceAdapters">
<control name="MobileCheckbox.Checkbox,MobileCheckbox"
adapter="MobileCheckbox.ChtmlCheckboxAdapter,MobileCheckbox"/>
</device>
</mobileControls>
</system.web>
</configuration>
� ����� �P 4�� �/( '����� %4�" '��� :
<%@ Register TagPrefix="mobCB" Namespace="MobileCheckbox"
Assembly="MobileCheckbox" %>
<mobCB:Checkbox
runat="server"
Universal Knowledge Solutions s.a.l
165
id="id"
Alignment="{NotSet|Left|Center|Right}"
BackColor="backgroundColor"
BreakAfter="{True|False}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
ForeColor="foregroundColor"
StyleReference="StyleReference"
Wrapping="{NotSet|Wrap|NoWrap}"
AutoPostBack="{True|False}"
Checked="{True|False}"
OnCheckedChanged="EventHandlerMethodName"
TextAlign="{Left|Right}"
Text="LabelText"
</mobCB:Checkbox>
� � � � ������ ������8J�4����/( '����� %4�" ���"� ���� D���0�� :
� �4�����D���� ���� 24��� AutoPostBack True|False � � $�� '���� ���� ���� �� ��� 3��";
��� �/; �� ,��%; N%� ���� %���� ��" '����� !�; '����� %4�"
%4�$���/( !�".���� �� ��� J������ �( �4���� ./�� �False
� ��*%$�� !�" ��� � � ��� Html �, .
��� �, �4���� ./�� ���� �� ���False %4�" ���� !�; C����
C/����� ��%; � ��$� '�� � %�:'����� !�;.
Checked True | False � � $�� '���� ���� ���� �� ��� 3��"; ?�%���� '����� %4�" ��� �/; �� ,
�,���� E*�����J. TextAlign System.Web.UI.We
bControls.TextAlign
Left|Right
� ���� �4���� ./( '����� '� 3�/���� %4�$� ��%��� 8��'�����.
Text String � � $�� �4���� ./( '����� 3��"; %4�" E� ��%��� 8��� �� F
Universal Knowledge Solutions s.a.l
166
�/( '�����. D����CheckedChanged $� �� % D���� S�� D���� S��$� �� % '� � $�
D � ��" D���� �/( T7 ; '� �4���� �� F % P�Checked.
�/( '����� %4�" '����� H*� ������ ��-���:
<%@ Register TagPrefix="cc1" Namespace="MobileCheckbox"
Assembly="MobileCheckbox" %>
<%@ Page language="c#" Codebehind="default.aspx.cs"
Inherits="MSPress.MobWeb.CheckboxEx._default"
AutoEventWireup="false" %>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form id="Form1" runat="server" title="Facts about Wales">
<mobile:Label id="Label3" runat="server" StyleReference="title">
Facts about Wales:</mobile:Label>
<mobile:Label id="Label2" runat="server">
True or False?:</mobile:Label>
<cc1:Checkbox id="Checkbox1" runat="server"
Text="Capital is Cardiff"></cc1:Checkbox>
<cc1:Checkbox id="Checkbox2" runat="server"
Text="Highest mountain is Snowdon"></cc1:Checkbox>
<cc1:Checkbox id="Checkbox3" runat="server"
Text="Favorite sport is rugby"></cc1:Checkbox>
<mobile:Command id="Command1" runat="server">Next</mobile:Command>
</mobile:Form>
<mobile:Form id="Form2" runat="server" title="Result">
<mobile:Label id="Label1" runat="server"
StyleReference="title">Result</mobile:Label>
<mobile:Label id="result" runat="server">Label</mobile:Label>
</mobile:Form>
��, � 1���� �, ���%��� 8��� ���:
using System;
using System.Web.UI.MobileControls;
namespace MSPress.MobWeb.CheckboxEx
{
public class _default : System.Web.UI.MobileControls.MobilePage
{
protected MobileCheckbox.Checkbox Checkbox1;
protected System.Web.UI.MobileControls.Command Command1;
protected System.Web.UI.MobileControls.Form Form2;
protected MobileCheckbox.Checkbox Checkbox2;
protected MobileCheckbox.Checkbox Checkbox3;
Universal Knowledge Solutions s.a.l
167
protected System.Web.UI.MobileControls.Label result;
protected System.Web.UI.MobileControls.Form Form1;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Command1.Click +=
new System.EventHandler(this.Command1_Click);
}
private void Command1_Click(object sender, System.EventArgs e)
{
int correct = 0;
if (Checkbox1.Checked) correct++;
if (Checkbox2.Checked) correct++;
if (Checkbox3.Checked) correct++;
result.Text = "You got " + correct.ToString() + " correct";
ActiveForm = Form2;
}
}
}
'����� %4�" � �: �/( '����� %4�" '�� CheckBox ��*%$�� !�" ��$�� �4�� � ����; E� � ��$�� HTML �CHTML �WML.
���� � ��"?MobileCheckBox %4�" '�� '����� %4�" � �: �/( '�����CheckBox ��*%$�� !�" ��$�� �4�� � ����; E� � ��$�� HTML �CHTML
�WML. � � �1������ ��*%$���� !�" �/( '����� %4�" %�< 2 � ������ ��9��.
Universal Knowledge Solutions s.a.l
168
�/( '����� %4�" �� 3��1�7��� �,�*; �7� �� W� � � ���"; �� <device> 3% 9L� ��* <mobileControls> 2�� �, ���"G�web.config:
<configuration>
<system.web>
<mobileControls>
<device name="MobileCheckboxHtmlDeviceAdapter"
inheritsFrom="HtmlDeviceAdapters">
<control name="MobileCheckbox.Checkbox,MobileCheckbox"
adapter="MobileCheckbox.HtmlCheckboxAdapter,MobileCheckbox"/>
</device>
<device name="MobileCheckboxWmlDeviceAdapter"
inheritsFrom="WmlDeviceAdapters">
<control name="MobileCheckbox.Checkbox,MobileCheckbox"
adapter="MobileCheckbox.WmlCheckboxAdapter,MobileCheckbox"/>
</device>
<device name="MobileCheckboxChtmlDeviceAdapter"
inheritsFrom="ChtmlDeviceAdapters">
<control name="MobileCheckbox.Checkbox,MobileCheckbox"
adapter="MobileCheckbox.ChtmlCheckboxAdapter,MobileCheckbox"/>
</device>
</mobileControls>
</system.web>
</configuration>
Universal Knowledge Solutions s.a.l
169
� ����� �P 4�� �/( '����� %4�" '��� : <%@ Register TagPrefix="mobCB" Namespace="MobileCheckbox"
Assembly="MobileCheckbox" %>
<mobCB:Checkbox
runat="server"
id="id"
Alignment="{NotSet|Left|Center|Right}"
BackColor="backgroundColor"
BreakAfter="{True|False}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
ForeColor="foregroundColor"
StyleReference="StyleReference"
Wrapping="{NotSet|Wrap|NoWrap}"
AutoPostBack="{True|False}"
Checked="{True|False}"
OnCheckedChanged="EventHandlerMethodName"
TextAlign="{Left|Right}"
Text="LabelText"
</mobCB:Checkbox>
Universal Knowledge Solutions s.a.l
170
� � � � ������ ������8J�4����/( '����� %4�" ���"� ���� D���0�� : � �4�����D���� ���� 24���
AutoPostBack True|False � � $�� '������� �� ��� 3��"; ���� ���� �/; �� ,��%; N%� ����
%���� ��" '����� !�; '����� %4�"%4�$���/( !�".���� �� ���
�( �4���� ./�� � J������False � ��*%$�� !�" ��� � � ���
Html �, . ��� �, �4���� ./�� ���� �� ���False %4�" ���� !�; C����
C/����� ��%; � ��$� '�� � %�:!�;'����� .
Checked True | False � � $�� '���� ���� ���� �� ��� 3��"; ?�%���� '����� %4�" ��� �/; �� ,
���� E*��� �,��J. TextAlign System.Web.UI.We
bControls.TextAlign
Left|Right
� ���� �4���� ./( '����� '� 3�/���8��� %4�$� ��%��� '�����.
Text String � � $�� �4���� ./( '����� 3��"; %4�" E� ��%��� 8��� �� F
�/( '�����. D����CheckedChanged D���� S��$� �� % D���� S��$� �� % '� � $�. '�
�� F % P� ��" D���� �/( T7 ; �4����Checked.
H*� �/( '����� %4�" '����� ������ ��-���:
<%@ Register TagPrefix="cc1" Namespace="MobileCheckbox"
Assembly="MobileCheckbox" %>
<%@ Page language="c#" Codebehind="default.aspx.cs"
Inherits="MSPress.MobWeb.CheckboxEx._default"
AutoEventWireup="false" %>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form id="Form1" runat="server" title="Facts about Wales">
<mobile:Label id="Label3" runat="server" StyleReference="title">
Universal Knowledge Solutions s.a.l
171
Facts about Wales:</mobile:Label>
<mobile:Label id="Label2" runat="server">
True or False?:</mobile:Label>
<cc1:Checkbox id="Checkbox1" runat="server"
Text="Capital is Cardiff"></cc1:Checkbox>
<cc1:Checkbox id="Checkbox2" runat="server"
Text="Highest mountain is Snowdon"></cc1:Checkbox>
<cc1:Checkbox id="Checkbox3" runat="server"
Text="Favorite sport is rugby"></cc1:Checkbox>
<mobile:Command id="Command1" runat="server">Next</mobile:Command>
</mobile:Form>
<mobile:Form id="Form2" runat="server" title="Result">
<mobile:Label id="Label1" runat="server"
StyleReference="title">Result</mobile:Label>
<mobile:Label id="result" runat="server">Label</mobile:Label>
</mobile:Form>
��, � 1���� �, ���%��� 8��� ���:
using System;
using System.Web.UI.MobileControls;
namespace MSPress.MobWeb.CheckboxEx
{
public class _default : System.Web.UI.MobileControls.MobilePage
{
protected MobileCheckbox.Checkbox Checkbox1;
protected System.Web.UI.MobileControls.Command Command1;
protected System.Web.UI.MobileControls.Form Form2;
protected MobileCheckbox.Checkbox Checkbox2;
protected MobileCheckbox.Checkbox Checkbox3;
protected System.Web.UI.MobileControls.Label result;
protected System.Web.UI.MobileControls.Form Form1;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Command1.Click +=
new System.EventHandler(this.Command1_Click);
}
private void Command1_Click(object sender, System.EventArgs e)
{
int correct = 0;
if (Checkbox1.Checked) correct++;
if (Checkbox2.Checked) correct++;
Universal Knowledge Solutions s.a.l
172
if (Checkbox3.Checked) correct++;
result.Text = "You got " + correct.ToString() + " correct";
ActiveForm = Form2;
}
}
}
'����� %4�" � �: �/( '����� %4�" '�� CheckBox ��*%$�� !�" ��$�� �4�� � ����; E� � ��$�� HTML �CHTML �WML.
���� � ��"?MobileMultiLineInput
�������� '����� %4��" ��L� % 0� ��$�� 8� ����; �1 <� %4�$�� �/( '�� . �� � �� 5� �� ���� ��� � ��� E ��% ����� �� 3
�J�%�� ��� � �� �4������ %������/( '����� %4�" �� 3��1.
Universal Knowledge Solutions s.a.l
173
>�*� � ���?/: B�� ��%�/ ����� 2���� �* �7� �� T � ��� ���"; �� ��� Web.config
<configuration>
<system.web>
<compilation debug="true">
<assemblies>
<add assembly="MLIC" />
</assemblies>
</compilation>
<mobileControls>
<device name="MMITTextInputHtmlDeviceAdapter"
inheritsFrom="HtmlDeviceAdapters">
<control name="MMIT_Sample.MultiLineInput,MLIC"
adapter="MMIT_Sample.HtmlMultiLineInputAdapter,MLIC"/>
</device>
</mobileControls>
</system.web>
</configuration>
� ����� ��, �/( '����� %4�" ������ ���� �P 4�� ���: <%@ Register TagPrefix="mobMLI" Namespace="MMIT_Sample"
Assembly="MLIC" %>
<mobMLI:MultiLineInput
runat="server"
id="id"
Alignment="{NotSet|Left|Center|Right}"
BackColor="backgroundColor"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
ForeColor="foregroundColor"
StyleReference="StyleReference"
Wrapping="{NotSet|Wrap|NoWrap}"
MaxLength="maxlength"
Numeric="{True|False}"
Password="{True|False}"
OnTextChanged="textChangedEventHandler"
Size="textBoxLength"
Text="Text"
Title="Text"
Rows="{number of rows}"
Cols="{number of columns}" >
</mobMLI:MultiLineInput>
Universal Knowledge Solutions s.a.l
174
� � �� � �4�� �/( '����� %4�" %,� <�7� ���: �4���� ���� 24���
Rows Integer
2�14�� ��" �4���� ./( ����%4�$�� �/�� �(%��<; '� ����. !�" �4���� ./( T � � '�
��*%$��HTML �,
Cols Integer ���� 3��"0� ��" �4���� ./( ����
%4�$�� �/�� �(%��<; '� .
�/( '����� %4�" '����� H*� ������ ��-���: <%@ Register TagPrefix="cc1" Namespace="MMIT_Sample" Assembly="MLIC" %>
<%@ Page language="c#" Codebehind="default.aspx.cs"
Inherits="MSPress.MobWeb.MLICExample._default"
AutoEventWireup="false" %>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile " %>
<mobile:Form id="Form1" runat="server" BackColor="PaleTurquoise">
<mobile:Label id="l" runat="server"
text="Multiline Text Input Sample"></mobile:Label>
<cc1:MultiLineInput id="MultiLineInput1" runat="server"
Cols="25" Rows="5" MaxLength="125"></cc1:MultiLineInput>
<mobile:Label id="Result" runat="server"
Text="Input text is: <empty>"></mobile:Label>
<mobile:Command id="Command1" runat="server"
Text="Get the text!"></mobile:Command>
</mobile:Form>
�, � 1���� �, ���%��� 8��� ���� �������:
using System;
using System.Web.UI.MobileControls;
namespace MSPress.MobWeb.MLICExample
{
public class _default : System.Web.UI.MobileControls.MobilePage
{
protected MMIT_Sample.MultiLineInput MultiLineInput1;
protected System.Web.UI.MobileControls.Label Result;
protected System.Web.UI.MobileControls.Command Command1;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
Universal Knowledge Solutions s.a.l
175
private void InitializeComponent()
{
this.Command1.Click +=
new System.EventHandler(this.Command1_Click);
}
private void Command1_Click(object sender, System.EventArgs e)
{
Result.Text = "Input text is: "+ MultiLineInput1.Text;
}
}
}
���� � ��"?MobileDynamicImage
/; � %� ��� W�%� ���9� �/( '����� %4�" �� �, �"� T���� ��� ������� T � ��� ��* %�4�� '����� �� ���� ��� �����B�P9�.
�-� ��1���� �� �1���� ���� '"�� �1������ ��*%$���� )���� �L� ?���� ��%�/JPG�GIF�WBMP �PNG ...g�;. �/( �, %� G� �"� '����� %4�" MobileDynamicImage �, 3���� 3%�4 /�� ��� ���� N/�� 3%�4�� �� !�; � P9��� ��� �,
������ ������ B�"� .
����� ���� � ����� '(��� �/(�( '����� %4�$: X � ���� 5����� 3%�4�� �� H �4��5��� ��9� ��� ��� X %�4�� ���� '"�GIF� JPEG� WBMP� PNG X K%$�� �9�9 '�� 5�� � ?� J���� 3%�4�� ��$�� % P� X � ��$� '�� �J���3%� �� %-�� �(I�9�; '� D �� 3������ 3%�4�� X N���%�� ���%�� !�; ������� 3%�4�� � ��� � ��� '"� X ' �4��� ��� �� �$�� ���� '"� %,� � �, ���� '"�Visual Studio.
Universal Knowledge Solutions s.a.l
176
>�*� � ���?/: 2�� ��* �4�� �����"; !�; ����Web.config��� ������ 8�� 'J��� N� '��� �/( '����� %4�" �0 . > ���� �*1
%�4�� E*�� 8�� �*�%�,� ���� ���� ��. 2���� !�; 8��� �/( �,�*; ��� W�/� Web.config
<appSettings>
<add key="MobileDynamicImagePath"
value="c:\inetpub\wwwroot\dynimg\" />
<add key="MobileDynamicImageURL" value="http://Myserver/dynimg/" />
</appSettings>
D �2Q%$> MobileDynamicImagePath� %�4��� 8���� ������ �J� � 1�� %���� 2Q%$> MobileDynamicImageURL (�� T,� %�����>�Z%$ �, 2IIS.
���� �P 4 �/( '����� %4�" '�����!�"��9�� :
<%@ Register TagPrefix="mobDI" Namespace="MobileDynamicImage"
Assembly=" MobileDynamicImage" %>
<mobDI:MobileDynamicImage
runat="server"
id="id"
Alignment="{NotSet|Left|Centre|Right}"
BackColor="backgroundColor"
BreakAfter="{True|False}"
Font-Bold="{NotSet|False|True}"
Font-Italic="{NotSet|False|True}"
Universal Knowledge Solutions s.a.l
177
Font-Name="fontName"
Font-Size="{NotSet|Normal|Small|Large}"
ForeColor="foregroundColor"
StyleReference="StyleReference"
Visible="{True|False}"
Wrapping="{NotSet|Wrap|NoWrap}"
AlternateText="AltText"
ImageUrl="masterImageSource"
NavigateUrl="targetURL"
SoftkeyLabel="softkeyLabel"
AutoConvert="{True|False}"
AutoSizeImage="{True|False}"
DynamicImageSource="string"
ScalePercent="{0-100}"
ScaleBasedOn="{ScreenWidth|ScreenHeight}"
ImageBrightness=
"{Auto|Very_Light|Light|Medium|Dark|Very_Dark}"
ImageDitherMethod="{ThreshHold|Matrix|Floyd_Steinberg}"
MaintainAspectRatio="{True|False}" >
</mobDI:MobileDynamicImage >
H*� '����� %4�" 8J�4� ������ ������MobileDynamicImage:
AutoConvert True | False
��� �, ���;True!�; �� ��� ./( ���� �J���� � ��� � ��" '��
5������ %4�" 2%4� ; '��� %4�$� �/( '�����Image
N��".
AutoSizeImage True | False
�4���� ./( �� F ���� �/; True 5�� 3%�4�� ��$�� � �$� '� !�" ?�����"� '������ ������
�4����ScaleBasedOn � �4����ScalePercent.
DynamicImageSource String
!�; %���� �" �4���� ./( %�$�� 3%�4��� !�" 3%�4�� ����"
5���.
ScalePercent Integer
�� ������ �, �� F0 !�; 100. ��� �,�; ��True!�; �� F �4����AutoSizeImage '�
./( '������ 3%�4�� ��$�� % P��� ����� �4����
Universal Knowledge Solutions s.a.l
178
ScaleBasedOn
ScaleBasedOn
MobileDynamicImage.
ScaleBasedOnType
ScreenWidth|ScreenHeight
'� �/; ���;True!�; AutoSizeImage '� �� ���
?�����"� 3%�4�� '�� % P� !�" !�; �,�*; �4���� ./(
ScalePercent.
ImageBrightness
MobileDynamicImage.
Brightness
Auto|Very_Light|Light|
Medium|Dark|Very_Dark
3%�4�� 3A�*G� ��%� ����%�4���.
ImageDitherMethod
MobileDynamicImage.
DitherMethod
ThreshHold|Matrix
|Floyd_Steinberg
�, �������� ������� � ��� � ���%�4�� � ���.
MaintainAspectRatio True | False
� $� '� �/; �4���� ./( !�; True�� % P� � ��" '�� '
��� !�" �<,����� E� 3%�4�� K%$�� !�; ��40� �� ��
��40�.
�� �� , �/( '����� %4�" '����� H*� � ��-� : <%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<%@ Page language="c#"
Inherits="System.Web.UI.MobileControls.MobilePage %>
<%@ Register TagPrefix="cc1" Namespace="MobileDynamicImage"
Assembly="MobileDynamicImage" %>
<mobile:Form id="Form1" runat="server">
<cc1:DynamicImage id="DynamicImage1" runat="server"
ImageBrightness="Light" ImageDitherMethod="Floyd_Steinberg"
DynamicImageSource=
"C:\Inetpub\wwwroot\MobileDynamicImageExample\BestBuys1.JPG">
</cc1:DynamicImage>
</mobile:Form>
Universal Knowledge Solutions s.a.l
180
�3? M��� � ��� �:
� ���� � ����*� � ������� ��"�� � �?��< J / ���� �
������� � ����� � : � �J7" ����� � 3�"�F ����%��� 8��� ���4�� ����� � �T � �.
����: �� C���� %a %������ 3A�%a��� ��a�� ��� Wa�� '���� A�� ���� ��� �"��F !�; ��4��� !�; ��� � ��� �� �(% P� �������� ��� � �� �$�����.
�%a�� ��(� %�� a Ea� K�%a@0� ./( �� K%@ �� T,���� ��4�� �/( � �L�� �������� K�%@0� ����� ./( �, sF����1������.
������� ��!�:
!�" �41�� �/( �, 5�� �� 2%$� : • �, ���� ��� !�; ��4��� '��1�ASP.NET • �� %4��� ���� ��� �% • K�%@�ADO.NET ��������� T% • �7�� ��� ��������������� �� % .
Universal Knowledge Solutions s.a.l
181
��"�� � J / ���� �
��� � � 5�@� ���$��ASP.NET E� ���9� 2�������� ��� � �% ��� /; %4��" ����� �( ��� ���� ��� %��4�� �������� '����� �-� '����� %4��" �,SelectionList�� List ��ObjectList.
�� ��� � ����%@� K E� ���$��� ���� ���Collection�� ArrayList�� System.Data.DataSet �
��System.Data.DataTable.
%��$�ADO.NET ��4��� �� ��� �� D��0� � ��� ��%9 ��F �� �(% � � '� ���� ���� ��� !�;Microsoft � � ����� ./( ����'��� �(� ���$���� '�F0� � ����� �" ?7 �� ADO���� ��� �� % -��� ���1 ��� �;� K%P�� �/( '����� ����G�� ��� �� /; �
3� ���� � ����� B���� N/�� A��0��.
����� � ��"�� � *� ������� %& %ASP.NET
� *���� ������ �, ��*�%$��� ���F ���� ��-�0� �� � �$�� ������ �, ��� �*� '� �������� 5��� C/��� ���14 �, ���� ���� �4�� ��% �$� 3% 9L���<% #.... %>.
��� ��� %4��" !�; ��4���� ��@%�� ��" ?����� ���� �/( %��$ .4�� ./( '����� ��� W�/�� ����� K�%@0� T ���� �P :
X �� �; '����� %4��" �% '� ���� ���� ��� ��"���� � ���.
X � T% �� A�"������% �$��� ' ��.
�� %4��� ���� ��� �% �P 4 !�" ��-��:
���� ��� %�4� ��-� ]%9�� �4�� <%# TopTitle %> W�� �( �(%��<; '� ���� �� ���
�4���� 3������TopTitle ��* � 1���� �, ���%��� 8���.
�"���� <mobile:ObjectList
id="ObjectList1"
runat="server"
LabelField="TeamName "
DataSource =
<%# MyArray %>
/>
'� ���; �4���� MyArray !�; �4����DataSource K%P��
ObjectList. D �%�$� MyArray �"�-� �� )��Collection ��ArrayList
��DataTable
% �$� <%# (TeamStats.Played
+ " Pts: "
+ TeamStats.Points) %>
��9�� % �$� �� ��( 3%(�<�� �� ��� 24�� 8J�4� E�� TeamStats
%9��� 8��.
Universal Knowledge Solutions s.a.l
182
E��� / 1�� <%# String.Format(
"Position: {0}",
TextBox1.Text.
PadLeft(2,'0')) %>\
��� ������ ./( �, ��14�� =����(� C%�� E����String.Format
�� % �� �� <%# GetOdds(SelectionList1
.Selection.Text) %>
GetOdds ��-��� �/( �, �( �� % ���%��� 8��� 2�� 24�� �, . '�
3��$��� �� ��� C�%�;�� �� % �� W�� *�������� 5��� ��14 ��.
H �4 K%@ � $ % �$��� '���� ������� 5��� ��14 C/��� ��* ���� N� �, �� %4��� �%�� '����� W��� .
�� % �� A�"��� !�; ���� ��� �% C��� DataBind�� �% 5�� ��� %4��$�� . �� % �� ./( A�"��� �1� �� �$����� K%P �-�����$� ��* 5��� ��14��14�� � ��� D�� S��� N�I ����"����J �� ��� ����* 3������� '����� %4��" ��14�� .
�������� ������ �P 4�� H*� ������ ���%��� 8���:
protected void Page_Load(Object sender, EventArgs e)
{
this.DataBind();
}
?��� �� �� % �� ./( '����� 5� �F��� D �� �%�� '������ % �$��� ��� �/; L �!�" �� ��� B� K%@ null ��-��� � � !�$, �
������ ��" L ��� �/( %�< �� ��� �4���� �� F �%Selection '��� %4�$� SelectionList %� ���� '������ '�� �� ��F ���� F �4���� . N%�%*�� �� �/��� �0� K$� �, �� ��" � �L� �� ��L��� � �� �%�� ' F ���;���� ��� %4��$�� :
H*� 3%�1�� ./( ������ ��-���: <%@ Page Inherits="MSPress.MobWeb.DeclDBEx.ExampleWebForm" Language="c#"
CodeBehind="DeclarativeDataBinding.aspx.cs" AutoEventWireup="false" %>
<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form runat="server" id="Form1">
<mobile:Label id="Label1" runat="server" StyleReference="title">
<%# TopTitle %></mobile:Label>
<mobile:ObjectList id="ObjectList1" runat="server"
DefaultCommand="aSelection"
LabelField="TeamName"
DataSource = <%# MyArray %> >
<Command Name="aSelection" Text="Show Details"/>
</mobile:ObjectList>
</mobile:Form>
<mobile:Form runat="server" id="Form2">
<mobile:Label id="Label2" runat="server" StyleReference="title">
You selected <%# ObjectList1.Selection["TeamName"] %>
</mobile:Label>
<mobile:TextView id="txvDetail" runat="server">
Universal Knowledge Solutions s.a.l
183
Played : <%# ObjectList1.Selection["Played"] %> <br>
Points : <%# ObjectList1.Selection["Points"] %> <br>
<%# String.Format("Position: {0}",
ObjectList1.Selection["Position"].PadLeft(2,'0')) %>
</mobile:TextView>
</mobile:Form>
��� � � 1���� �, ���$�� 2���� (�������: using System;
using System.Collections;
using System.Web.UI.MobileControls;
namespace MSPress.MobWeb.DeclDBEx
{
public class ExampleWebForm : MobilePage
{
protected System.Web.UI.MobileControls.Form Form1;
protected System.Web.UI.MobileControls.Form Form2;
protected System.Web.UI.MobileControls.ObjectList ObjectList1;
private ArrayList _myArray;
protected ArrayList MyArray
{
get { return _myArray; }
}
public string TopTitle
{
get { return "Season 2003 results"; }
}
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
this.ObjectList1.ItemCommand += new
ObjectListCommandEventHandler(this.OnTeamSelection);
}
private void Page_Load(Object sender, EventArgs e)
{
if (!this.IsPostBack)
{
_myArray = new ArrayList();
_myArray.Add(new TeamStats("Dunes",1,38,24,8,6,80));
_myArray.Add(new TeamStats("Phoenix",2,38,20,10,8,70));
_myArray.Add(new TeamStats("Eagles",3,38,20,9,9,69));
_myArray.Add(new TeamStats("Zodiac",4,38,20,8,10,68));
Form1.DataBind();
Universal Knowledge Solutions s.a.l
184
}
}
private void OnTeamSelection(
Object source,
ObjectListCommandEventArgs args)
{
Form2.DataBind();
this.ActiveForm = Form2;
}
}
class TeamStats
{
private String _teamName;
private int _position, _played, _won, _drawn, _lost, _points;
public TeamStats(String teamName,
int position,
int played,
int won,
int drawn,
int lost,
int points)
{
this._teamName = teamName;
this._position = position;
this._played = played;
this._won = won;
this._drawn = drawn;
this._lost = lost;
this._points = points;
}
public String TeamName { get { return this._teamName; } }
public int Position { get { return this._position; } }
public int Played { get { return this._played; } }
public int Won { get { return this._won; } }
public int Drawn { get { return this._drawn; } }
public int Lost { get { return this._lost; } }
public int Points { get { return this._points; } }
}
}
� *���� ������ �, ��*�%$��� ���F ���� ��-�0� �� � �$�� ������ '� �������� 5��� C/��� ���14 �, ���� ���� �4�� ��% �$� 3% 9L��� �, ��� �*�<% #.... %>.
��� ��� %4��" !�; ��4���� ��@%�� ��" ?����� ���� �/( %��$ .��� W�/�� ����� K�%@0� T ���� �P 4�� ./( '����� :
X �� �; '����� %4��" �% '� ���� ���� ��� ��"���� � ���. X � T% �� A�"������% �$��� ' ��.
Universal Knowledge Solutions s.a.l
185
�������ADO.NET
���� �� 2�14 ���� ��� �%� T�$�� ����� �(����F ���� ��-�0� E �� '����Collection �-� ArrayList ./; ��� ���� ��� ���� �
a� �4���� 2�14�� '����� �� �" 5� , ���� � 3�"�F �, ����� �� �; ��4��� � %� ����ADO.NET 24 �-� DataSet �DataView.
3%����� ������ !�; �,�*G�� ������� 5��� ��14 � ��� '�" 5�� �4�� �� ��� '����� ��� �� ���� ��� !�; ��4��� ]% ��� D �����J��� 3�" ' ��� 2��� 5��� ��14� �1���� ��-�� A�9�; E� T,�%����� ����.
%,��ADO.NET���9��� �� ���� �/�� ?����� ?7� . '��� /;ADO.NET 2�14�� DataSet� DataReader 3%�4� ��$� ����
���� ��� %�4� �" �����.
N��H� ��? �8&ADO.NET:
DataSet : K�%@� �-��DataSetT � ��� ��$� ���$� ���� � � ���� ���� ��� . ��� �$� W��� ���� ��� %�4� �" ����� %4��$�� ./( �0������ 3%�4� .� �0� ���� ��� !�; �7 �$��� ��� 3��"; ����� ����� ��� N� !�".
K�%@0 � ������ � ���� B�9�DataSet�� ��, �� �J7$�� ���� ��� �"��F � �� �� F� ���F7"� �3��"�� ������ !�" N���% <���� . .. K�%@0 ��� DataSet ��1�� �� K�%@0� ./( A�9�; ��� ��� ����� � 3�"�F '7$�� �" S��� �� XML . K%@ �� ����
DataSet ���� ��� %�4� �" %<��� KP� ���� ���%� C/��� '������ ��$�� ����� ���� ��� ��� �" ���� .
DataAdapter: 2�14 !����DataAdapter ������� System.Data.IDataAdapter K�%@� � (L� �" ���I� �(� DataSet���� ���� . K�%@� #�$�DataAdapter K�%@� !�" DataSet���� ��� 3�"�F �, ���� ��� !�" '�� �7 �$� � � �.
Connection :
24�� K�%@0� ./( !����System.Data.IDbConnection '���� ���� ��� %�4� E� �J� � 1�� ��4�� �-��� MS SQL �� 2��XML.
Command: ������� !���� ���� 2�14�� �" %�$�System.Data.IDbCommand %���� N����� SQL %�4� !�; ��4��� ��������
���� ���.
DataReader: K�%@� '����� !�; ?��� �� L���DataReader '����� �" � ���DataSet ������� !���� 2�14 �(�
Universal Knowledge Solutions s.a.l
186
System.Data.IDataReader���� ��� %�4� !�; �, 3A�%��� ��$, ��4� %,��� . �7 �$��� A�%�; ��� � K�%@0� ./( '��� K�%@� ������ ���� DataSet���� ��� %�4� �� �, 3A�%��� �44�� ��, .
��"�� � ��4� ������
���� ��������IDataAdapter �IDataReader �IDbConnection �IDbCommand���� ��� 3�"�F !�; T � � ��4� � 1 � .
( ���� ��� ������� $� ���� � 3�"��� �4�� �(� 3%��/��� �������� !���� ���� 2�14�� �� �"����.
%� ; �,��$�� .Net 1.1 � �� ��%� � �$�%� �� �� : X ���� .NET SQL Server. X ����.NET OLEDB ������� '������ ���� ��� �"���� ��4�7� '��� OLEDB. X ����.NET � Oracle ���� � �"���� ��4�7� '���� Oracle. X ����.NET a� 8���� ODBC.
K�%@� ���� �� !��� Connection ��Command ��DataAdapter ��DataReader !��� ��-��� � � !�$, SQL Server
2�14SQLConnection� SQLCommand �SQLDataAdapter....g��
/( ��" ���*� �/; ��� �� ����� ��� �"��F E� ��4�� ��0� A�*, ��% �� A�5����� . ���� �1, MS SQL 8��� ���� ?7-� �P 4��� ���%���:
using System.Data;
using System.Data.SqlClient;
� �, ��� ���� ���OLEDB , ��9�� �� 8��� H�4 : using System.Data;
using System.Data.OleDb;
N�2 � �������DataReader @���� ���� � � ��"���
���� ��� !�" �7 �$� A�%�; !�; C��� T � ��� B�� � N/�� ��4��� ��� �/;� K%P�� '����� �\, DataReader ��$, � �� %,� K%P�� '����� �"DataSet.
��4�� # L� �� �" %4�$�� �/( '����E����� ��� 3�"�F � %�� 2 %$�� SQL K%@ ��* ���� ��� E*�� Command '-
Universal Knowledge Solutions s.a.l
187
�� % �� '�����ExecuteReaderK%P�� �/�� .
K%@ �� % �� ./( � $�DataReader� ���� � %�4�� �������� ��� ���� ���� ��� N��� �1������ '����� %4��$.� �� �� ���� �� K%@ N� 5� �� � ��$�� ./( �� ��( �<�7���DataAdapter.
K%P�� '��� � ��-� �� �� ,DataReader '��� %4�" � ���� List ���� � 3�"�F �� ���� ���� MS SQL �/( :
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<%@ Page language="c#" Codebehind="DataReaderExample.aspx.cs"
Inherits="MSPress.MobWeb.DataRdrEx.DataReaderMobileWebForm" %>
<mobile:Form id="Form1" runat="server" Paginate="True">
<mobile:List id="List1" runat="server"></mobile:List>
</mobile:Form>
� ��� � 1���� �, ���%��� 8���: using System;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI.MobileControls;
namespace MSPress.MobWeb.DataRdrEx
{
/// <summary>
/// Use the DataReader for efficient read-only access to data.
/// </summary>
public class DataReaderMobileWebForm
: System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.List List1;
protected System.Web.UI.MobileControls.Form Form1;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
private void Page_Load(object sender, System.EventArgs e)
{
// Use the DataReader to fetch a read-only dataset.
String strConnectionString = "server=(local)\\NetSDK;" +
"database=pubs;Trusted_Connection=yes";
Universal Knowledge Solutions s.a.l
188
SqlConnection myConnection =
new SqlConnection(strConnectionString);
SqlCommand myCommand =
new SqlCommand("select * from Authors", myConnection);
myConnection.Open();
SqlDataReader dr = myCommand.ExecuteReader();
List1.DataSource = dr;
List1.DataTextField="au_lname";
List1.DataBind();
myConnection.Close();
}
}
}
��� S���%��� �/( C%�, ��9�� !�" ���:
N�2 � �������DataSet��"�� � *� � ����? %&
K%P�� '�� ��� � ��� �� % -��� �,DataReader �, �,�� % @ K%P�� �/( '����� H�4 ���� ���� ��� 2J�<��� E �� �� ��"�� �� � �7F��� '���� ���� ��� � ��� ��� 3�"�F ��* ���� ��� !�" D ������� .
Universal Knowledge Solutions s.a.l
189
K%P�� '�� DataSet �J��1�� �� � �$�� ���(������ I . !�">��� �� ��� ��� �����$�Z%$���� ��� 3�"�F ��* �, . A�%�; W��� W�/� � ����; E� ���� ��� !�" � �$��� �� ��"!�; B����� K%@ ��* ���� ��� D ��� ��" �� ��� ��0 ����� N� DataSet ��� �$� ��F
* ?� �$,���� ��� 3�"�F ��� N�I ��� �� ���*� ��- ����� T � � ��" ���� ��� 3�"�F �, �,%$��� �� ��� E� �7 �$��� '��3�"���� !�".
B�9� K%@ � (L�� ���� ��� 3�"�F !�; ��4��� � ��" DataSet� ��$�� � K%P�� E� �(������� ���� DataReader . 2 %$�� '��� /; %��SQL 5���� ��� K%@ '������ ���� ��� 3�"�F �� ���DataAdapter K%@ �" ?�� Command.
H*� K%P�� '����� � 1 � ������ ��-���DataSet '����� %4�" � (L�� ObjectList1: // Use the DataAdapter to fill a dataset.
String strConnectionString =
"server=(local)\\NetSDK;database=pubs;Trusted_Connection=yes";
SqlConnection myConnection =
new SqlConnection(strConnectionString);
SqlDataAdapter myCommand =
new SqlDataAdapter("select * from Authors", myConnection);
DataSet ds = new DataSet();
myCommand.Fill(ds, "Authors");
ObjectList1.DataSource = ds.Tables["Authors"].DefaultView;
ObjectList1.LabelField = "au_lname";
ObjectList1.AutoGenerateFields = true;
ObjectList1.DataBind();
K%P�� �L� <�7�DataSet K�%@� N��� DataTables K�%@� �(%��� N���� ���� DataRow �DataColumn . ./( '���
2�14�� ���� ��� E� ���$��� 2J�<��� �� E�� ���� ?�$�.
��"�� � B���� ���� ����� 5� >�*� @�3"/
��� �,� �7 �$� A�%�; !�; C��� .I�9�; ��%��� T � ��� �� A�%�; �, �*,0� �� % �� 8���� ����� ��� 3�"�F �� $� !�" K%@ !�" �7 �$���DataSet K%P�� '������ ���� ��� 3�"�F !�" �7 �$��� ./( T � � '- ��� ���� DataAdapter.
���� �� % �� �d��� E ��, �� �� �� !�" %-I� �� ���L9 �� �7 �$� A�%�\� '������ '�F �/; ��������� ��-��� �, 3�%:
<%@ Page language="c#" Codebehind="DataUpdateExample.aspx.cs"
Inherits="MSPress.MobWeb.DataUpdateEx.DataUpdateMobileWebForm" %>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<mobile:Form id="Form1" runat="server" Paginate="True">
<mobile:ObjectList id="ObjectList1" runat="server">
Universal Knowledge Solutions s.a.l
190
<Command Name="EditCommand" Text="Edit Details"/>
</mobile:ObjectList>
</mobile:Form>
<mobile:Form id="Form2" runat="server">
<mobile:Label id="Label1" runat="server"
text="Edit Author Details" StyleReference="title"/>
<mobile:Label runat="server">
Author ID: <%# ObjectList1.Selection["au_id"] %>
</mobile:Label>
First Name:
<mobile:TextBox id="TextBox1" runat="server" MaxLength="20"
Text='<%# ObjectList1.Selection["au_fname"]%>' />
Last Name:
<mobile:TextBox id="TextBox2" runat="server" MaxLength="40"
Text='<%# ObjectList1.Selection["au_lname"]%>' />
<mobile:Label id=Label3 runat="server"
StyleReference="error" Visible="false"/>
<mobile:Command id="Command1" runat="server" Text="Save"
CommandName="Save" />
<mobile:Command id="Command2" runat="server" Text="Cancel"
CommandName="Cancel" />
</mobile:Form>
� ��� � 1���� �, ���%��� 8���: using System;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI.MobileControls;
using System.Web.UI.WebControls;
namespace MSPress.MobWeb.DataUpdateEx
{
/// <summary>
/// Use the DataReader to fetch the data.
/// </summary>
public class DataUpdateMobileWebForm
: System.Web.UI.MobileControls.MobilePage
{
SqlConnection myConnection;
protected System.Web.UI.MobileControls.ObjectList ObjectList1;
protected System.Web.UI.MobileControls.Form Form1;
protected System.Web.UI.MobileControls.Form Form2;
protected System.Web.UI.MobileControls.Label Label3;
protected System.Web.UI.MobileControls.Command Command1;
protected System.Web.UI.MobileControls.Command Command2;
protected System.Web.UI.MobileControls.TextBox TextBox1;
protected System.Web.UI.MobileControls.TextBox TextBox2;
override protected void OnInit(EventArgs e)
{
Universal Knowledge Solutions s.a.l
191
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
this.ObjectList1.ItemCommand += new
ObjectListCommandEventHandler(this.OnEditCommand);
this.Command1.ItemCommand += new
CommandEventHandler(this.CancelConfirmEdit);
this.Command2.ItemCommand += new
CommandEventHandler(this.CancelConfirmEdit);
}
private void Page_Load(object sender, System.EventArgs e)
{
// Use the DataReader to fetch a read-only data set.
String strConnectionString = "server=(local)\\NetSDK;" +
"database=pubs;Trusted_Connection=yes";
myConnection = new SqlConnection(strConnectionString);
if (!IsPostBack) BindList();
}
private void BindList()
{
SqlCommand myCommand =
new SqlCommand("select * from Authors", myConnection);
myConnection.Open();
SqlDataReader dr = myCommand.ExecuteReader();
ObjectList1.DataSource = dr;
ObjectList1.LabelField = "au_lname";
ObjectList1.AutoGenerateFields = true;
ObjectList1.DataBind();
// The field names of au_id, au_lname, and au_fname
// do not provide good titles, so change them in the
// AllFields collection.
ObjectList1.AllFields[ObjectList1.AllFields.IndexOf("au_id")]
.Title = "Author ID";
ObjectList1.AllFields[ObjectList1.AllFields.IndexOf("au_fname")]
.Title = "First Name";
ObjectList1.AllFields[ObjectList1.AllFields.IndexOf("au_lname")]
.Title = "Last Name";
}
/// <summary>
/// Called when the user clicks the 'Edit Details' link
Universal Knowledge Solutions s.a.l
192
/// </summary>
protected void OnEditCommand(
Object source,
ObjectListCommandEventArgs args)
{
// DataBind the form to insert the selected item details.
Form2.DataBind();
this.ActiveForm = Form2;
Label3.Visible = false;
Command1.Visible = true;
Command2.Visible = true;
Command2.Text = "Cancel";
}
/// <summary>
/// Called when a user clicks on either 'Save' or 'Cancel'
button
/// on Edit screen
/// </summary>
private void CancelConfirmEdit(Object sender, CommandEventArgs
e)
{
if (e.CommandName == "Save") {
SaveChanges();
}
else
{
// Go back to the List View.
this.ActiveForm = Form1;
ObjectList1.ViewMode = ObjectListViewMode.List;
}
BindList();
}
private void SaveChanges()
{
String updateCmd = "UPDATE Authors SET au_lname = @LName, "
+
"au_fname = @FName where au_id = @Id";
SqlCommand myCommand = new SqlCommand(updateCmd,
myConnection);
myCommand.Parameters.Add(
new SqlParameter("@Id", SqlDbType.NVarChar, 11));
myCommand.Parameters.Add(
new SqlParameter("@LName", SqlDbType.NVarChar, 40));
myCommand.Parameters.Add(
new SqlParameter("@FName", SqlDbType.NVarChar, 20));
Universal Knowledge Solutions s.a.l
193
myCommand.Parameters["@Id"].Value =
ObjectList1.Selection["au_id"];
myCommand.Parameters["@LName"].Value = TextBox2.Text;
myCommand.Parameters["@FName"].Value = TextBox1.Text;
myCommand.Connection.Open();
try
{
myCommand.ExecuteNonQuery();
Label3.Text = "Record Updated";
}
catch (SqlException)
{
Label3.Text = "ERROR: Could not update record";
}
myCommand.Connection.Close();
Label3.Visible = true;
Command1.Visible = false;
Command2.Visible = true;
Command2.Text = "Back";
}
}
}
'����� %4�" ��-��� �/( �, T � ��� '��� ObjectList ������ ��* ������� ���� ��� %��<G authors ���� ��� 3�"�F �, Pubs.
%4�$�� ����%��� 8��� 2Q%$> <Command> 2�� ��* aspx� 4�1��� % %�� �, '������ �"� D �� . !�" P*�� ��$,$�� �/( C/����� %�< %4�Form2 �-� '��� %4��" '������ � ����� ������ ' F ?�� �� TextBox% %���� � ��" �, �"�� .
S���%��� �/( / 1�� ��" ������� ��9 ������ ��9�� � � :
Universal Knowledge Solutions s.a.l
194
> 3%�9��� '� % %��� '������ C/����� '����� %� : ��� � �7 �$��� � �-�� 84�� ��0��� ����-��84�� �(������ .
N%��� D���� S��$�� 3���� �� % '������ � %��� � /( !�" P*�� ����$� � ��" OnItemCommand �( CancelConfirmEdit.
�� % �� ��* � �$��� � ��" �" ��I��� ���%��� 8��� E*�� SaveChanges . �7��$� '������ ?�* � ��( ���F ���� <�7�
SQL ��� 3%�9\� �F��)@(
String updateCmd = "UPDATE Authors SET au_lname = @LName, " +
"au_fname = @FName where au_id = @Id";
SqlCommand myCommand = new SqlCommand(updateCmd, myConnection);
�7��$� K�%@� �,�*\� ?�* � ���%��� 8��� '�� SQL �(� SQLParameter K%@ !�; SQLCommand �� � ��� E� % �$���� W�/� ���� ��� ���� ���:
myCommand.Parameters.Add(new SqlParameter("@Id", SqlDbType.NVarChar,
11));
Universal Knowledge Solutions s.a.l
195
�7��$��� ./�� �������� 5�� ��� ' ��� �(�$� ���%��� 8��� ��� � �P 4��� W�/: myCommand.Parameters["@LName"].Value = txtLName.Text;
����� W�/ �$�� �� % � '7$�� / 1��:'������ �( !��0� �� % �� Execute ������ ./( �,� 3��"; � ��" N%�� K%@
DataSet �� % �� '������ �( � ��-��� �ExecuteNonQuery K%@ 3��"; ��� %�0� / 1�� N%� ������ ./( �,� DataSet /(��P 4�� '������ .��/1� �� �:
myCommand.ExecuteNonQuery();
2/��� �� ��" T � � E ��� ����9� �� % � C�%�G�� '7$�� 8� % P�� W�/SQL.
�0� ������� ��"�� � ��"��� @�"Visual Studio
�J � '���Visual Studio!�" ��$�� %� ��� �"�� ���� ����0� �� � �$�� ���� ��� .
'�4� �"� DataSet Designer 3�"�F A�9�; ��� D � ����� ��� 3�"�F �� '������ ���� ��� �"��F K�%@� E� ���$��� �,
�� F� ���F7"� ������ �H ��1�� �3��"�� �2�14� ������ N���� ���� � .� �"�1� � J%� �� % � W�/ �� ' ��� N%� .
( �� !��� �� �, 2%$�� ��( ?�* � � ���� � ���� !�" ����� ./Server Explorer �Component Designer.
���� � 3���� �������Server Explorer: W� � �� 3%,����� �1������ ���� ��� %��4� ��* ������� ��4���� 3��0� ./( H�� . %� ��� '������ 3��0� ./( !�; ��4��� W���
Server Explorer �� ��J����View.
3��0� ./( '������ W��� : X ���� � 3�"�F '��� E� ��4�� # L�SQL �=%�0� ���� ��� �"��F. X ������ E� ��4��SQL�� ���� ���� ���� ��� %��<G . X ���%�� �D���0� �7�� ����� ��� �"��F �� , ��� ������ ���� ������� %��<;� W���9 !�" ��<�0�� ��4���J�%�� �
A��0� ����"�. X %��<; �� �����$����$���� � 5��� ������(%,�� ���� T% �� ��� 3%,�����.
3��0� ./( ��" � ����� � ���� H*��:
Universal Knowledge Solutions s.a.l
196
�0� ������� ��"�� � ��"��� @�"Visual Studio
�F N/�� ��9��� 3%9��� ���� ��� �"��F !�; ��4��� � ��� ��� � ��� ��� T���� A���� �, B� *��� �� .
���� �� ��$�� C/��� '����� ?�� �$� %-�� ��� � � �" '���� ����" � 1��� �� ���� N� !�")n-Tier ( ���� �� �4, '� D ����� ��� ����$�� '��� ���� W�� �" '������ ����� ����$�� '��� ���� . ��� ���� ���� ��� E� ���$��� ������ ������ T�� '� D ��
���� �� W��� �".
�� T � �� '��� ���� ���� ��� ������ A�"���� '������ ����� 2�14 '��� ���� �� 3��$�� �J � �,��$�� T . �"������- ���� ���� ��� 3��$�� ������ =%�� ������ � ��� ��� �� ������.
K�%@� �$� ��J ��� ./( �-� �,DataSet ���� ��� 3�"�F �" ?����� ��41�� ����� �������� � � ���� ��� ��� � ��" � �L�� � ��-�
$�� �" �����$�� <�1��� !�" ��%�/ ��� ���%�F E����� ��� � �$� ��" ��� � �� '��� ��� ���� ��F7.
�J � %,��Visual Studio.NET ' �4�� 3��� ���,�%� ������� 3��0 Server Explorer ������ A��� � ��" �� �$� ��� ��� � ��" ���� �.
� '������ ������ �� %9�� �, �%���� ��-��� � �$�� '��� ����0� ./( ��" H *������� ��� �����: • 2�14 ����� �� �� � �� )�%9� A�9�\� � ����� �, '���C# B ��� AuthorsDataComponent . ./�� '�
(� E ����� �P� !�; .% 1� '� )�%9� A�9�; � ��$��� '�� 24 � ���� 3%�4� N��� Class1.cs ���0 B,/�� '���
Universal Knowledge Solutions s.a.l
197
���� '�4� '������ %�: 24 A�9�\� '�������. • %� � %� ���� )�%9��� 2�� !�" �� 0� %���� %����� '���Add ��J�F �� context %���� '- Add Component .
• 3/,�� �,NewItem %���� Component Class 2���� '� ����� '- AuthsComponent.cs. • �(��" '�� Visual Studio �,�*\� AuthsComponent.cs��1� '�� � ��"�%9� !�; ' �4��� � $*� ��* B. • ������ !�; ��4��� ������� '����� 29��� !�" %����� �[� '���authors ���� ��� 3�"�F ��* pubs .
• ������ %� � ��$� �(�$� '���authors K%@ A�9�; ?� J���� '� D �� ' �4��� ���� !�; SQLConnection K%@� SQLDataAdapter8��� � ��� ?� J���� '� � ��4�� 3%��" ?���*�� �,�*��� K�%@0� W��� ��%��� ���%��� K%@ E� �� �4��SQLCommand2/���� � �$���� ��,�*G�� �%� ��� �� ��" A�%�G .
K�%@� ������� ��%; T % �" =%�0� 2�14�� E� ��4��� .A�9�\� ���F N/�� ������ '�� DataSet.
�������� '�4� �"� K%@ � ��� �, DataSet.%� ���� ���F N/�� ������� 8�� . ��J���� %����Data %� ��� '- Generate
DataSet !�" %���� �� �" 5� 3/,���� ./( �,� New '� ����� '- AuthsDataSet( ��� ������� ��9�� �, H*��:
Universal Knowledge Solutions s.a.l
198
!�" %���� ��"OK 2�� A�9�; N%� �XML K%P� 8�� DataSet '�� AuthsDataSet.xsd )�%9��� !�; B�,�*; N%��� '�� � ���� K%P�� �/( �� � -� A�9�; N%� '-authsDataSet1 �' �4��� �9�9 !�; B�,�*;.
������ ��* ���� ��� E� ���$��� ���7�� �� ����G� E �� !�" L9���� ���� ��� ���� N��� authors.
/�� ���%��� 8��� '�� K%@ � (L�� �� % �,�*; %�� '� �� ��� � �� A�9 N� 24�� �/�� .� ��� '� NDataSet ?�%,��� B�$���
��%���� '��$�� . 24�� %4��" � /P�� '�� N/�� 24�� !�; � ����� ���$�� �4���� �,�*; 5� ?�/;authsDataSet1� �� ��: /// <summary>
/// Returns a dataset of all authors in the authors table of the pubs
database
/// </summary>
public AuthsDataSet AllAuthors
{
get
{
// Update class member dataset.
this.sqlDataAdapter1.Fill(this.authsDataSet, "authors");
return this.authsDataSet1;
}
�� % �� '���Fill a� �4���� SqlDataAdapter ���� ��� 3�"�F E� � � ������� 3%�4� ��4�� H�1� � K%@ !�; ���� ��� 3A�%FDataSet��4�� T7@; '- .
Universal Knowledge Solutions s.a.l
199
���� ��� !�" % P� N� ��" ���� ��� 3�"�F � �$�� �4���� �� % �� ���� ������ �/( !�" 5� W�/� ./�� ���%��� 8��� �$� '�F N
������ �, � �@ D ����� � ��" �� .� ���� �������� '�4�.
& K%@ ���"\� �������� '�4� '�FSQLDataAdapter K%@ E� SqlCommandC�%�G� � ��$� 5����� �2/��� ... �� % A�"��� ��"Update K%P� �4���� SQLDataAdapter K%@ % %�� '� DataSet� ?� ���� K%P�� �/( !�; �7 �$��
��� ���� . K%@ ��* 2�14�� �� 24 ��� �7 �$��� ./( T � �� �(�$� W%���� '�� DataSet� �,�*G� � ��" B �" ��� N/�� � 2/���
��D �����.
�� ��� ���� ��� 3�"�F D ���� ���" �� % ����� B�,�*; 5����� ���%��� 8��� ��� : /// <summary>
/// Take a DataSet, including changes, and apply it to the database.
/// </summary>
public bool UpdateAuths(AuthsDataSet DataChanges)
{
bool boolRetval;
try
{
this.sqlDataAdapter1.Update(DataChanges, "authors");
boolRetval = true;
}
catch(Exception)
{
boolRetval = false;
}
return boolRetval; }
5� � >�*� $�= ��"�� � $��� �������
?�� �%� %-�� H�4 � J%�� T � ��� 24 �� ���� ��� ����$�� 8���� ���%��� 8��� ����; ��" �, �"� ��� ' ��� !�" � �%��������� ����� %-�� �����'.
'����� � ��" T� �� �������� 5��� ��� � � �, ���� ��� �"��F D ��� �, .�� �% N/�� ��-��� �� A���0� K$� �@� 4 3��"\� '���
���� ��� ������ .
Universal Knowledge Solutions s.a.l
200
)�%9��� ��* ������ �/( !�; E�%� �,�*; 5� ���� ��� ���� '����� 3/,�� �7� �� W�/Add Reference:
�" 5��� �P 4��� W�/� � 1���� �, ���%��� 8��� � ��� �, ������ �/( �" H %4� �,�*; �(�$� �� : using MSPress.Mob.Web.AuthorsDataComponent;
8���� � ����� ���%����,�P 4��� W�/� 24�� ��* 8�� %4�$� ���� ��� ���� A�9�; :
private AuthsComponent myDataComp;
private void Page_Load(object sender, System.EventArgs e)
{
// Create the data component each time the application
// returns to the server.
myDataComp = new AuthsComponent();
if (!IsPostBack)
BindList();
}
��� � �� % �� ���%��� 8��� BindList��� �� :
public void BindList()
{
// Use the DataComponent to fetch a dataset.
Universal Knowledge Solutions s.a.l
201
AuthsDataSet ds = myDataComp.AllAuthors;
ObjectList1.DataSource = ds.Tables["authors"].DefaultView;
ObjectList1.LabelField = "au_lname";
ObjectList1.AutoGenerateFields = true;
ObjectList1.DataBind();
// The field names of au_id, au_lname, and au_fname do not provide
// good titles, so change them in the AllFields collection.
ObjectList1.AllFields[ObjectList1.AllFields.IndexOf("au_id")].Title
= "Author ID";
ObjectList1.AllFields[ObjectList1.AllFields.IndexOf("au_fname")].Title
= "First Name";
ObjectList1.AllFields[ObjectList1.AllFields.IndexOf("au_lname")].Title
= "Last Name";
// Store the DataSource in a session variable so that
// it can persist across multiple postbacks.
Session["MyDataSet"] = ds;
}
�� % �� H�4�SaveChanges ���� ��� ���� '���� ������� 3��"; �$� ��9�� !�":
private void SaveChanges()
{
// Retrieve the dataset from the Session object.
AuthsDataSet ds = (AuthsDataSet)Session["MyDataSet"];
// Find the row and make changes.
AuthsDataSet.authorsRow rowToChange =
ds.authors.FindByau_id(ObjectList1.Selection["au_id"]);
rowToChange.au_fname = TextBox1.Text;
rowToChange.au_lname = TextBox2.Text;
// Call the UpdateAuths method of data component.
// Pass it the dataset so that it can update the database.
if (myDataComp.UpdateAuths(ds))
Label3.Text = "Record Updated";
else
Label3.Text = "ERROR: Could not update record";
Label3.Visible = true;
Command1.Visible = false;
Command2.Visible = true;
Command2.Text = "Back";
}
� %-�� H�4 � J%�� T � ��� 24 �� ���� ��� ����$�� 8���� ���%��� 8��� ����; ��" ?�� �% �, �"� ��� ' ��� !�" � �%���
'������ ����� %-�� �����.
Universal Knowledge Solutions s.a.l
202
'����� � ��" T� �� �������� 5��� ��� � � �, ���� ��� �"��F D ��� �, .�� �% N/�� ��-��� �� A���0� K$� �@� 4 3��"\� '���
���� ��� ������ .
�� �/( !�; E�%� �,�*; 5� ���� ��� ���� '���� )�%9��� ��* ����� 3/,�� �7� �� W�/Add Reference: �J � ����Visual Studio.NET 3��0 T,�%� ������ '�4� Server Explorer ���� � ������ A��� � ��" �� �$� ��� ��� � ��".
X ��� ������ '������ ������ �� %9�� �, �%���� ��-��� � �$�� '��� ����0� ./( ��" H *��� '����� �" ?�*�" ���� � ���� ���� ��� S��$� T ��.
Universal Knowledge Solutions s.a.l
203
�3? %"�C � ��� �:
��7� E�=�� �: � �� � ���/
������� � ����� � : T � ����� ����� ���$� �K%@
����: %� ��� ���� �����HTTP( � ���� � � ������ !�" <,�� ������%�HTTP�� 7, �� ������� �a����� 3%��G �a� % ��� ; ��
����� ./( �, B� P�� '��� �� �/(�.
������� ��!�: !�" �41�� �/( �, 5�� �� 2%$� :
• ������ '��1�����%��;. • ��<1� T% � ����� ����. • T � ��� ����.
Universal Knowledge Solutions s.a.l
204
� �� � ���/
�: !�; � � ��� ��� 5��� ��� � � A��� ��" ?����@ C���������� ���� � � �����$��� � ���� � . <��� A��<1� %��� ��� ���HTTPK%P�� �/( T ���� =%�� �� % !�; A����� 5� B�� !�$�� ������ �����$� .
��%� ��� ��� ������ ����� �,a� ASP.NET � �(ASP���$��� ���� �1���� T% ������ 2%$���� � ������� E����
�� '� �" !� �� '����SESSION_ID'������ �/�� �4����� '����� !�" ������� �����$��� 3��$� . ��� ������ ./( %��$�����$��� '"�� ��� ����� ./( �, ��*%$���� ��� �������� ��� ����� 5�@� �, ����� % @.
�� ; ASP.NET �%,��� !�" <�1��� �1������ �� �[� �� �"���� �, B������ '� ��� %�%��� ��*$� ����ASP �� �� ��*$� .� ����� �( �� �[� ./(:
• ���� � � �� : K%@ ��* K�%@0�� ������� !�" �<,������ H��Session ���� ��� �,�������� ���� 3�" . • ����� � ������ �: T % �" K�%@0�� ������� ' F ����\� ������� ./( H�� �� ������ ���� ��� ��%; 3��";
� 1�� ���� �7�. • ViewState:'����� !�" ����� 5� C/���� �4���� ' ��� !�" <�1���� H�� . � ���� � P9��� ��� W%�� '��
24�� �� �-� ��* �����$���System.Web.UI.StateBag � K%@ ��* B� ��� '� N/��Session. • >�*� � � ��: �"�� �,1��� �J��� 3�" �� ���� 3�" %�" T � �� �4���� K�%@0�� ��% P���� !�" <�. 5� �� T% ��D7-�� !��0� �� � ������� B���� �$���� �� ���� � ���� !�" 2%$��� '����� ��� ��%; '��� 2Q%$>� !�; � ��
������ �� E� ������ ������� 5� �� E� B��%\� .%��� ������ '�� . �, ���$� '����� ����� � ��$�� � ������ ��*%$����HTTP ��,Q%$>�� !� �� '����� '� , ���$��� '"�� ���� ��*%$���� �, ���URL � ���" �" 3%��" �(� ��h$ ��� URL ���
����� � � � �� �; � %, 2Q%$>� �,�*;.
���� � � ��
%,��ASP.NET" ���� ��� ��%�/ ��� K%@ �Session E� ?���� '������ ASP� ����� '����� A�%�\� H� N/��� : X ������ 8�� 2Q%$>� �7� �� � ������� !�" 2%$���. X ����� '����� �4�� �����$� � ���. X D���b� ����$� T% �7� �� ����� 3� � 3%�� 3%��;. X ���� ��� �*� �$� ����� ���� � % %��.
�� � W��(���� �/�� ��� �� �� X J �7�: ����" ������ #1� �� � ����� ���� � ������ '��� !��� D � �����$� � ���� ���� '��� ����"� ���
Universal Knowledge Solutions s.a.l
205
������ 5� � 5 �� N/�� '����� ��� ?� � ������ !�" <�1���� H� ��� ������. X ��"�C �:�� � 3�"�F !�" ����� �����$� � ��� � ����; ��SQL Server ��� �, ����� �����$� 3��$��� H� ���
� '�<��� %� ���� '��� � P9� 3��";IIS.
� T% �� '(� 8J�4��� K%@ ����� ����Session�( : � �4������� % �� 24���
�� % ��Abandon K%@ ���(\� '���Session ������ � % %��B�����$�.
�� % ��Add %4�" �,�*;. �� % ��Clear ���(\� '�� ���� ����� �����$� H�� '���
����� K%@. �� % ��Remove � ����� ����� �����$� �� K%@ ����\� '���. �� % ��RemoveAll � ����� ����� K%@ �� %4��$�� E �� ����\� '���. �� % ��RemoveAt @ �� ������ � ���� N/ %4�$�� ����\� '�� K%
� ����� �����. �4����Count � ����� ����� K%@ ����*� ���� %4��$�� ��" � $�. �4����IsCookieless '"�� ����� ���� �/; �� , ���� � � �� �� F � $�
'� ���$���. �4����IsNewSession ( 5� �� ��� �/; �� , ���� � � �� �� F � $�� ��0�
����� ��*. �4���� IsReadOnly ����� �����$� ���� �/; �� , ���� � � �� �� F � $�
�, 3A�%��� �44��. �4����IsSynchronized �� ���: ����� ���� �/; �� , ���� � � �� �� F � $�
��� �,�*; ���%� T� T�� � ����; D �. �4����Item � � $�� '��������� %4��" ' F 3��";.
�� F � �����9��� %4�$�� : Session[“keyName”]=value
�� Session[index]=value
�4����keys � ����� ����� K%P� �4���� H ��1��� E �� � $�.
���� � N�H �������
��� ����� 8����� � 1���� �, ���%��� 8��� ��* ����� K%@ E� ���$��� 2��Global.asax� � �, ���%��� 8��� ��*
Universal Knowledge Solutions s.a.l
206
�������� 5��� ��14� � 1����.
��C�: 2���� � 1���� �, ���%��� 8��� ������ ��-��� � � Global.asax '� /�L N/��� Global.asax.cs . '������ ��-��� �, '���
����� K%@ !�; ���� ��� �,�*G � �� % : • ]��1�� � �� ���� '������ !��0�UserStartTime� ��� �,�*G ����� K%@ � ��� ��� �-�� � ,%�. • �� % �� '������ � ��-��Session.Add ]��1��� '��� ��� 2 %$�� HelpAccess � ��0� �� ��� ��� N/��� false.
using System;
using System.Collections;
using System.Web;
using System.Web.SessionState;
namespace MSPress.MobWeb.SessEx
{
public class Global : System.Web.HttpApplication
{
protected void Session_Start(Object sender, EventArgs e)
{
Session["UserStartTime"]=DateTime.Now.ToLongTimeString();
Boolean HelpAccess=false;
Session.Add("HelpAccess",HelpAccess);
}
}
}
2�� 2�L� Global.asax B��� �� T���� ���%��� 8��� !�; % 9 N/�� @Application� �� :
<%@ Application Codebehind="Global.asax.cs"
Inherits="MSPress.MobWeb.SessEx.Global" %>
8��� �, <�7� '��� N%4�" ���� ��������� 5��� C/��� ��14� ������ ���%��� Form:
• ��0� C/����� �, ��� From1 '��� %4�"� %� Label1 �� F � ��� N%� D �� Text '����� %4�$� Label1 ��* � 1���� �, ���%��� 8���.
• ���-�� C/����� ��� Form2 '��� N%4�" Label14�� ./( ��� ��� ��(��� �, ���-�� ��� �3�"�� ��14 �( ��� r%�,� 1���� �, ���$�� ���%��� 8��� �, B� �� F ���; N%� �.
project <%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<%@ Page language="c#" Codebehind="MobileWebForm1.aspx.cs"
Inherits="MSPress.MobWeb.SessEx.MobileWebForm1" %>
<mobile:Form id="Form1" runat="server">
<mobile:Label id="Label1" runat="server"/>
Universal Knowledge Solutions s.a.l
207
<mobile:Command id="Command1" runat="server">Go To
Help</mobile:Command>
</mobile:Form>
<mobile:Form id="Form2" runat="server">
<mobile:Label id="Label2" runat="server">
This is a help page.
</mobile:Label>
<mobile:Label id="Label3" runat="server"></mobile:Label>
</mobile:Form>
��, � 1���� �, ���%��� 8��� ���:
using System;
using System.Web.Mobile;
using System.Web.SessionState;
namespace MSPress.MobWeb.SessEx
{
public class MobileWebForm1 :
System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.Label Label1;
protected System.Web.UI.MobileControls.Label Label3;
protected System.Web.UI.MobileControls.Command Command1;
protected System.Web.UI.MobileControls.Form Form1;
protected System.Web.UI.MobileControls.Form Form2;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
this.Command1.Click += new
System.EventHandler(this.Command1_OnClick);
}
private void Page_Load(object sender, System.EventArgs e)
{
Label1.Text = "Help accessed: ";
Label1.Text += Session["HelpAccess"].ToString();
}
private void Command1_OnClick(object sender, System.EventArgs
e)
{
//Switch to the Help form, set the flag in Session object
Universal Knowledge Solutions s.a.l
208
Session["HelpAccess"] = true;
Label3.Text = "Help accessed: ";
Label3.Text += Session["HelpAccess"].ToString();
ActiveForm = Form2;
}
}
}
T � ��� �/( � P9� ��": • �� ��� )��%; '� False ������� !�; HelpAccess����� K%@ ��* . • C/����� %��<; ��"Form1 �� % �� � P9� N%� Page_load �� F %��<;� HelpAccess. • D���� ����$� �� % / 1�� !�; �,�*; '����� !�; �����$��� �%�� �C/����� !�" %��� '������ ���$�� ��"
Command_Click ���; !�; N�I� ����� True ������� !�; HelpAccess. • !�; 3%� � N� ��4� ��"Form2� 3� ���� �� ��� %�<� � �� �� ����� %4�$HelpAccess �(� True.
����� � �������
'���Asp.NET 2Q%$>� �7� �� ������ !�" 2%$���� ID ��$� ��* HTTP �� E� '������ ������ � � �(% %�� N%� ����� 5� ������� .)�%9��� % @ ��4��� �� ����� � %, 2Q%$>� '����� � ��$�� ./( 5� �� . ��I��ASP.NET '������ %�0� �/(
5��� '��� � P9� �� , ��$> 3%� �� �, .% P� N%� �J��9" % 19� ]��1�.
��� 2Q%$>� �� ��� 32 a� 2%��� �� !�" ��4��� �(% 19� '� ���� ���� ��� �� �"���� �� �; ?�,�*� ?��� 16 ��*� ?��� 2Q%$>��� ��� �� � ��$�� ./(ID �, �"��� � %, BJ�9�G �������� � ��%����� � ��� �� � F%����� E��.
��*%$�� ������� ?� �� � �4���� � ������� !�" 2%$��� 5��� '���� 3� %, �� % ���$��� %,��HTML . ./( 8%, ����
���$��� '"�� �������� ��� ����� 5�@� ��� � ��7�� � ������� ������ �1 $* � �[� .!�" ���� ������ ���� ��" ���� N� ��,Q%$>� '����� �� �" 5��� ������ � � !�; ���$��� '���*%$�� '"�� �J���URL���" ?�*�" ��h$ ��� .
��&'��(� �������URL��V�*(� � :
��,Q%$>� ' $ � ����� URL ���� % %��� ID���$��� '����� �� ?�� '������ ������ � � .
� 2Q%$>� !�" ��-� � ����� �P 4�� �, K%$�URL'Z$ >� : http://microsoft.com/myapp/(dcdb0uvhclb2b145ukpyrr55)/index.aspx
�(��"� B�� '$ �� )������ '�� 5� �� 5��� '��� ���� ��"���$��� '���� ��� 2Q%$>��� �/( '����� '� .
��,Q%$>��� %��$�� ��,Q%$>��� ./( E� ���$��� �, ���9� ��*%$���� )���� �� � �$�� B���� /; �?� �-�� ?7� ��h$ ��� ���� �, 8�0���
��,Q%$>��� � �������� ��� % @ .?����� ���$��� %� � !�" �<,����� 5� W�/�.
Universal Knowledge Solutions s.a.l
209
��C�:
��,Q%$>� '����� 2��� ����� ���$��� � $� ����� URL �14���� �� F ���\� W�/� � ��� ��h$ ��� cookieless %4�$�� �$����� sessionState 2�� ��* Web.config������ ��-��� H*� ��� :
<!-- configuration details -->
<sessionState
mode="inProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;user id=sa;password="
cookieless="true"
timeout="20"
/>
<!-- more configuration details -->
� 84���� ���%��� 8��� E*� ��� ���$��� � $1� �� ������ S��$� E��� �(/ 1�� N%� ���� � ��%��� ������ ��* ������ ./�
/�L� ����"IsCookieLess �� ��� True�� ��� : if (Session.IsCookieless)
{
}
����� � ������ � �������
K%@ '����� ��� 5��� ���14 � � �����$��� �� 3% P4 � �� % %�� �� �0� K$� �, ����� Session.
������ ��$, '������� 3��" A���0� ��$�� C/��� T % �" �����$� E�� !�; ��-��� � � !�"HTML � 3% 9L��� ��$�� !�; L��<input> �14���� E� Type �� �; ��� ���� �� ��� Hidden%�[ A�� �� �����$��� % %��� .
���� �, %��0� 2���� WML /; � � '����� !�; ����%; '- K%$���� A!�� ��* ������� E*� �, ?7-� % �1��� 5�
A���� E �� A�� �� '������ A�����C/�����.
�"�� �4����HiddenVariables� � 24MobilePage �,�� F� '� �� ����� �� J��- � ���� H�� D � �1 <��� ./(� ���N%� '-� 1�� ����� ������� '����� � � �(% %�� .
K%@ '������ 3%��/��� �1 <��� !�; ��4��� E ��Session oL* � �A��� �� ��� �/� �"� %�� � � 1���� ������ ����
��������.� ����_ !�; .����� 5� ��I���� �/( !�"�J��� ��� ��9� � �[� ./( �� �, ���$, ������ ���14�� � � ���� ��� % %����� ����"% P4 ���� ��� '�� ?� !�; �,�*; ������ K%" �� % �� '�� ���7��� 5�� � ����� �4���� !4F0� '���� ����
Universal Knowledge Solutions s.a.l
210
E� ��,������ ��� ����� ���"��WAP ����� �� 5� N/��� 1.4KB.
��C�: H*� � 1���� ������� � ��� '����� ������ ���%��� 8���:
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<%@ Page language="c#" Codebehind="MobileWebForm1.aspx.cs"
Inherits="MSPress.MobWeb.HidVarEx.MobileWebForm1"
AutoEventWireup="false" %>
<mobile:Form id="Form1" runat="server">
<mobile:Label id="Label2" runat="server">Your name:</mobile:Label>
<mobile:TextBox id="TextBoxName" runat="server"></mobile:TextBox>
<mobile:Command id="Command1" runat="server">
Submit
</mobile:Command>
</mobile:Form>
<mobile:Form id="Form2" runat="server">
<mobile:Label id="Label1" runat="server">
Your e-mail:
</mobile:Label>
<mobile:TextBox id="TextBoxEmail" runat="server"/>
<mobile:Command id="Command2" runat="server">
Submit
</mobile:Command>
</mobile:Form>
<mobile:Form id="Form3" runat="server">
<mobile:TextView id="TextView1" runat="server">
TextView
</mobile:TextView>
</mobile:Form>
��, � 1���� �, ���%��� 8��� ���:
using System;
using System.Collections;
using System.Web;
using System.Web.Mobile;
using System.Web.SessionState;
namespace MSPress.MobWeb.HidVarEx
{
public class MobileWebForm1 :
System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.Form Form2;
Universal Knowledge Solutions s.a.l
211
protected System.Web.UI.MobileControls.Command Command1;
protected System.Web.UI.MobileControls.Command Command2;
protected System.Web.UI.MobileControls.Form Form3;
protected System.Web.UI.MobileControls.TextView TextView1;
protected System.Web.UI.MobileControls.TextBox TextBoxName;
protected System.Web.UI.MobileControls.TextBox TextBoxEmail;
protected System.Web.UI.MobileControls.Form Form1;
public MobileWebForm1()
{
Page.Init += new System.EventHandler(Page_Init);
}
private void Page_Init(object sender, EventArgs e)
{
InitializeComponent();
}
private void InitializeComponent()
{
this.Command1.Click +=
new System.EventHandler(this.Command1_Click);
this.Command2.Click +=
new System.EventHandler(this.Command2_Click);
this.Form3.Activate +=
new System.EventHandler(this.Form3_Activate);
}
private void Command1_Click(object sender, System.EventArgs e)
{
HiddenVariables.Add(TextBoxName.ID,TextBoxName.Text);
this.ActiveForm=Form2;
}
private void Command2_Click(object sender, System.EventArgs e)
{
HiddenVariables.Add(TextBoxEmail.ID,TextBoxEmail.Text);
this.ActiveForm=Form3;
}
private void Form3_Activate(object sender, System.EventArgs e)
{
String FormData="";
foreach (Object o in HiddenVariables.Keys)
{
FormData+=o.ToString()+" "+HiddenVariables[o]+"<br>";
}
TextView1.Text=FormData;
}
}
}
Universal Knowledge Solutions s.a.l
212
� ������9�� !�" ��-��� �/( / 1��� � J����� �� ����:
�������ViewState
����ASP.NET� �\� '������ � 1 )�� ����\�������� '����� � � ��%�� 3�" %�" ���14�� ������ !�" <�1��� . �� ���� �,
� 5� �� %-�0 ��14�� �����$� %���� �4� �� ���� �������(�� ��� �4����� ��14�� 8J�4� ViewState %4��" ��� �-� !�; �� , '����� '����� 24�� StateBag.
��� '�� ����" 5� ��%\� '���� ��" N%�� ' F '������ ?� �: ��14�� A��� 3��"; 8J�4��� 24�� �-� ��* StateBag.
��� � I% ����� �4���ViewState( � K%@MobilePage ������ N/�� 2�� ��*� aspx ���$�� S���%����� 1���� �, . W�/�
�4���� '����� E �� ��ViewState��� ��� ��� �, K%@ �� ���� T � MobilePage B ��� 3��"; '������ A�� %�: !�; HTTP) �� % �� '������MobilePage.Response.Redirect(“URL”) (�� �� % �� '������ =%�� ��14 !�; '����� ����
MobilePage.Server.Transfer(“URL”)(.
��* �4�� <1� � 1 � ������ ��-��� H*� viewState � �?��� �����$�� � 1: using System;
using System.Web;
using System.Web.Mobile;
using System.Web.UI.MobileControls;
using System.Web.UI;
public class MobileWebForm1 : System.Web.UI.MobileControls.MobilePage
Universal Knowledge Solutions s.a.l
213
{
protected System.Web.UI.MobileControls.Command Command1;
protected System.Web.UI.MobileControls.Label Label1;
// MyMessage property get and set accessors
// using the ViewState property
public String MyMessage
{
get
{
// Explicit cast to String
return (String) ViewState["MyMessage"];
}
set
{
ViewState["MyMessage"]=value;
}
}
private void Command1_Click(object sender, System.EventArgs e)
{
// Consume the persisted property.
Label1.Text=this.MyMessage;
}
}
���� �4���� ViewState�������� 5��� ���14� '����� ��� �� '����� %4��" �, �J���� ��9� ��h$1� ., � $1� A�P�\� ���F �/\ �4����ViewState�� %4��" ��� ������ ��� $1� ����; ?� J���� '� '����� %4��" ��� ��* %4�$�� �/( ��* 3������� '���.
�1� �4���� ./( ��" � $1� A�P�G ���;False!�; �14���� EnableViewState ��� '����� ��� �� '����� %4�" 3% 9L� ��*
������ ���%��� 8��� � � : <mobile:Label id="Label1" runat="server" EnableViewState="False"/>
./( � $1� A�P�G��P 4�� '����� �1� ��14�� ���� ��* �4���� :
<%@ Page language="c#" Codebehind="MobileWebForm1.aspx.cs"
Inherits="MobileWebForm1" EnableViewState="False" %>
��� ��� � ��� ��* W�/� ��� � ��� ��" E %�� �4���� ./( � $1� ����; !�; ��%� ��� L�� �� 3��" �� % �� ./( �0 � �) �( ���
� 1���� ������� '����� E� �����( ������ � � ���� ��� �� % �� '� ��%\� '��� ����9�� !�" A5" ��9 ��� '�����.
� ��� �, � � �� ���9� !�; � �[� ./( '����� ���� �� �� ����, � ���� ��� � ��� !�; ������ ����� �( ./( ���� ��� ��� %���"� � $� ������ K%" � ����� /�� ��" ��������. T � � � �: % P� '� W�/�ViewState '����� %4��" ��* ��������
K%@ ��* ���� ��� � ��� !�" ���$�� ��������Session �, �%� �� ������ !�; �����$��� ���� ��%\� 3%� �� �, '��� � �1 %$� ����.
Universal Knowledge Solutions s.a.l
214
���� ��" K%@ '�Session � ���� ViewState �� �� /�L� ��� � �� � � �� %���"� � $� : € A����� ���� T�$�� !��0� N%� D � �����$� ����, �(��"ViewState . � $�� ����� � �74 A���� ��� � ��� ���
�14���� �� Ftimeout T � ��� 2�� ��* Web.config( ��� ��� 8��� �, H*�� ����: <configuration>
<system.web>
<sessionState
mode="inProc"
cookieless="true"
timeout="20"
/>
</system.web>
</configuration>
€ ����� �, ������� �����$���� T�$��, � ��-�� � ���� ����� E� ����� � %�� =%� �F /; �� ����� ��14�� �������� '�" ��
�� F � �ViewState ����� K%@ �, ������� � %� '���� '- =%�� !�; ��14 �� '���� ����� �/\, ���14��Back � �� F ���� ������ ��14�� !�; ��"ViewState� ����� # �� � ��-�� ��14��� �4���� W�� �( .
�9��� ./( �� '� �14���� '������ ��sessionStateHistorySize %4�$� �4���� mobileControls 2�� ��*
Web.config %�< �� 5� �,������ ���%��� 8���: <configuration>
<system.web>
<mobileControls sessionStateHistorySize="10"/>
<system.web>
</configuration>
� ��>�*� �
Z%$ �, T � ��� 2ASP.NET B�L� ����� ��������� � P9��� ��� W%�� '�� ���� ��1���� E �� � � I%�� ���� ��* ��� P9�
B��* � "%1�� �������� E ��� �*�%�,� ������� 8����.C��� � ��F�0� K$� �, %� ��� !�; � ��� ��-�� ������� �" �� W���� ���� K�%@0������� =��� !�" ?������ ��� �� ?�*�" T � ��� � P � I% ��. �/� 24�� %,�
System.Web.HttpApplicationState� %� ��� 3%��/��� � ����0� .
K%P�� �-� Application B��/ ��� T � ��� �T � ���� 8���� �*�%�,� ������ ��* 2�� !�; 5� ��� ��%; ��� .I�9�; '� �� �4���� '������ B �; ��4��� ���Application 24�� System.Web.HttpApplication � �4����Application 24��
MobilePage.
Universal Knowledge Solutions s.a.l
215
K%@ W��� Application K%P�� ��* �(�� �% ���� T% �� #1� Session��� W�/� 3%�, 3�"�%� E� ����9� �� % � B������ K%@ ����� ���� �����$��� ���Application E ��� 3%,��� ����� � ����� 3�" �� ��%��� ���� �� � � ����� !���
T � ��� ������.
K%P�� !�� Application� '����� ��" 2�� \� '������ '�� !�� '����� 3%��/ ��* �� � �$��� 2�� D ���Global.asax.
�� � $�= >�*� � � �� �������Global.asax:
W��� K%@ ��* ���� ��� E� ���$��� application 2�� �, ���%��� 8��� '������ Global.asax 2���� ��* E*�� N/�� �*�%�,� ������ �, %/���. ���%��� 8��� � 1���� �, ����$�� � ���� 3����� �7� �� T � ��� ���� �����$� E� ��$�� ?�* � �����
Global.asax.
H*� %��� 8��� K%@ '����� ������ ���Application 2���� ��* Global.asax: using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
namespace MSPress.MobWeb.AppObjEx
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(Object sender, EventArgs e)
{
// Declare and assign a value to the global variable.
String AppStartTime = DateTime.Now.ToLongTimeString();
// Add the global variable to the Application object.
Application["AppStartTime"] = AppStartTime;
}
}
}
��( <�7�������� ���� Application_StartT � ��� ��" A�� D��� S��$�� . ��� �-���� 2���� � ���� T���� 8��� � ��� �, ���F � 1���� �, ����$�� � ���� 3����������� W�/ '�:
<%@ Application Codebehind="Global.asax.cs"
Inherits="MSPress.MobWeb.AppStateEx.Global" %>
��14 N� �� T � ��� K%@ �����$� !�; ��4��� /J��" ����� .8��� H*� � �/��� N���� ������ 5� ��14 ���� ������ .- B�� ����; '������ ��I� '�� ��0� C/�������%� %� P* ��" '����� !�; B��%\� '�� '. ���, ���-�� C/����� $ %K '�
B�� ����\� '�F '���� %�:.
Universal Knowledge Solutions s.a.l
216
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<%@ Page language="c#" Codebehind="MobileWebForm1.aspx.cs"
Inherits="MSPress.MobWeb.SharedApplicationStateExample.MobileWebForm1"
%>
<mobile:Form id="Form1" runat="server">
<mobile:TextBox id="TextBox1" runat="server"></mobile:TextBox>
<mobile:Command id="Command1" runat="server">Enter</mobile:Command>
</mobile:Form>
<mobile:Form id="Form2" runat="server">
<mobile:Label id="Label1" runat="server">Label</mobile:Label>
</mobile:Form>
��, � 1���� �, � ���� 3����� ���:
using System;
using System.Collections;
using System.Web;
using System.Web.Mobile;
using System.Web.SessionState;
namespace MSPress.MobWeb.SharedApplicationStateExample
{
public class MobileWebForm1 :
System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.Command Command1;
protected System.Web.UI.MobileControls.TextBox TextBox1;
protected System.Web.UI.MobileControls.Form Form2;
protected System.Web.UI.MobileControls.Label Label1;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
Command1.Click += new
System.EventHandler(this.Command1_Click);
}
private void Command1_Click(object sender, System.EventArgs e)
{
ActiveForm = Form2;
Label1.Text = "Previous User: " +
Application["LastUser"].ToString();
Universal Knowledge Solutions s.a.l
217
Application["LastUser"] = TextBox1.Text;
}
}
}
H*� T���� T � ��� / 1�� �� �� ������ ��9��:
Universal Knowledge Solutions s.a.l
218
�3? %"�C � ��� �: %"�C � E�=�� �: @��7� $����
������� � ����� � : A����K%@ ����� .
����: T � ��� A��� �;� T � ��� �/( �" � ������� �*% !�; ��4��� ��%�%* �� ��� A�� B�"%� �/( �, S��$� 'a(� )�*����
A��0� � �� !�" �"�� �F ���� �����.
������� ��!�: !�" �41�� �/( �, 5�� �� 2%$� :
• ��� � ��� A��� E,%� ����"�%� 5����� ����� '(�. • �, u���� )����ASP.NET.
Universal Knowledge Solutions s.a.l
219
>�*� � @��� $����
2Q%$�� 5����� T � ���B�L���� T�� N/�� T � ��� 5�� ��� ��9��� 2J�<� '� �F� 5� � �?� � ��� D �� ��$�� �$�� T��
'������ �� ����;.
������� 2J�<��� T���� � �/ T � ��� % � � � ��" �\,?�J � ��� �/; � ������� '���(�� !<� �� T � ���. � P� ����� W�/� H�� !�" �"�� ���� ��<�7��� K$�T � ���� A��� !�".
>�*� � @��� $����
€ �80�" ���� %� � W�" � %& ��� � � �4/ �?� @��*/:
�, ��$�� ����; '"� A�1 ; �� ��L��� �( A��0� � ��� !��0� �� % ���� ������ ��� 3�� � !�; N�I �(���� �0 � ����� g� S��$� '������ ���� �� ����$�� '�� � P9��� ��� W%�� �����:. ���� �7 �$��� A�%�; 5� �4���� ./( � $1� ����G
2�� ��* ���%��� 8��� �(%�< Web.config
<configuration>
<system.web>
<compilation debug="false"/>
</system.web>
</configuration>
€ ����� @�2 /ViewState�����= $�� � ��� %& : '����� �� ��%�/ViewState ./( %,� B �; ������ '�" ��� �, B� $1� A�P�\, W�/� T � ��� ��" ��-� �%����� K$� W���
�%������A��0� E,% �������.
€ ��? �"? ���� � � �� ����� @�2 /�8� / ���� � : > ����� K%@ ����� ���� 2J�<��� '��� T � ��� ��� �/;?�* � ����� ���� ��" � $1� A�P�; �*1.
<%@ Page EnableSessionState="false" %>
€ N�H $�= ��"��� X� ����? @���/Application: ��4��� ������ � T � ��� #1� ��1������ 5��� �J��� �P9 �F�F��� #1� �, �%����� #1� !�; . �������� � ���� �� ��� ���
%��4��� �"���� ��%�9� � �L� �( ������ ./( �,�� '����� 3%%����% �� ��9� 3% P���� % @� u��� W�/� �, 3A�%��� K%@ ��* ���� ���Application �� % �� � P9� ��" Application_Start 2���� ��* Global.asax.
Universal Knowledge Solutions s.a.l
220
> A�%�; �� '�� ������ ./( �, K%@ �7� �� ���� ��� !�; ��4���� ���� '��Application 3��$�� !�; %�% *� ��� ��40� %�4��� �� �����$���. H*� u�� ������ ��-��� 8�� K%P�DataSet K%@ ��* Application �7� �� W�/�
�� % ��Appliaction_Start 2���� ��* Global.asax:
public void Application_Start()
{
// Create the data component.
AuthorsDataComponent.AuthsComponent myDataComp =
new AuthorsDataComponent.AuthsComponent();
// Use the data component to fetch a DataSet.
AuthorsDataComponent.AuthsDataSet ds = myDataComp.AllAuthors;
// Store the data source in the application state so that
// the data source is available to all clients.
Application["AuthsDataSet"] = ds;
}
K%@ T % �" ���� ��� !�; �4 �� K%@ N0 ��� �(��"Application �� % ��* Page_Load ?�*�" ��14�� �"
5��=%�� 3%� ���� ��� 3�"�F �� ���� ��� . void Page_Load(Object sender, EventArgs e)
{
DataSet sourceDS = (DataSet)(Application["AuthsDataSet"]);
List1.DataSource = sourceDS;
List1.DataMember = "authors";
}
€ �80�" ���� %� � W�" � %& ��� � � �4/ �?� @��*/: 0 � ����� g� �, ��$�� ����; '"� A�1 ; �� ��L��� �( A��0� � ��� !��0� �� % �� ������ ��� 3�� � !�; N�I �(���� �
��: S��$� '������ ���� �� ����$�� '�� � P9��� ��� W%�� ���. € ����� @�2 /ViewState�����= $�� � ��� %& :
'����� �� ��%�/ViewState%,� B �; ������ '�" ��� �, B� $1� A�P�\, W�/� T � ��� ��" ��-� �%����� K$� W��� ./( �%������A��0� E,% �������.
€ �8� / ���� � ��? �"? ���� � � �� ����� @�2 /: ?�* � ����� ���� ��" � $1� A�P�; �*1 ����� K%@ ����� ���� 2J�<��� '��� T � ��� ��� �/;.
€ N�H $�= ��"��� X� ����? @���/Application: 1� ��1������ 5��� �J��� �P9 �F T � ��� #��F��� #1� �, �%����� #1� !�; ��4��� ������ . �������� � ���� �� ��� ���
Universal Knowledge Solutions s.a.l
221
�, 3A�%��� % �� ��9� 3% P���� % @ '����� 3%%��� %��4��� �"���� ��%�9� � �L� �( ������ ./( �,� ���� ��� u��� W�/ K%@ ��*Application �� % �� � P9� ��" Application_Start 2���� ��* Global.asax.
K%@ �7� �� ���� ��� !�; ��4���� ���� '�� A�%�; �� '�� ������ ./( �,Application 3��$�� !�; %�% *� ��� ��40� %�4��� �� �����$���.
>�*� � @��� $���� )����(
€ ����� J / ���� � ����� � �������:
K�%@� � ��� ���� �,DataSet ���� '��� %4��" ��* 3%SelectList, List �ObjectList � %4��" � ��� 5� � ����"��3��$� 5�� �� ��" ��J��������14 !�; 84���� ' ���� '������ % �1��� 5� . ' ���� �� )���� �/( �,N%� � ���
%4�$�� �F� %,� ��� �, �� ������� .%��<; � �5����" =���� ����� � � �� '����� %4�.
€ ���� � ����/ ��?/ ����? �"? �����= ��H �� ��� �����? @���/ ��?:
��'(� �4���� '����� A��0� � �� �� ��� MobilePage.IsPostBack !�" � %�%*�� % @ ����$��� �� ��" 5���� ���� ��� �14�� � ���� !��0� 3%��� �, ����$��� �� ��" / 1�� �� T����� W�/� �����14�� ��%; 3��"; '� 3%� �� �, # �.
€ ����* � �������System.Text.StringBuilder��&��� � �� #� � A�� :
E���� 3%�9; '����� �� )%� �� % �� ./( %��$� (+) �� % -��� ��*�� ���� ��� � ��� �, 8�0��� � ,%���� �7�� S���W�� 2%����� �7 S�� �� ��".
StringBuilder detailText = new StringBuilder();
detailText.Append("This block of text ");
detailText.Append("will be <b>displayed</b> in a ");
detailText.Append("TextView Control.");
TextView1.Text = detailText.ToString();
€ ���� ��"�� J / ���� � *=SQL %�C�7� ��3 �:
�"�� % �� ��9� ���� ��� !�; ��4��� ������� �� J�%�G� '����� � ��" �,<�7� ��9� A��0� 3�� � . ��" ����� �( W�/� K�%@0� '�����SqlDataReader �OleDBDataReader� ������� 84�� ��4� 5� �� ���� ����� �, �D �����.
€ ��H7� *��"� $? )���� � %& NVisual Basic.NET
W��(% ������ � /�� � %� ��� ������ ��� � ��� A��� 3�� �� 3% �� ��Visual Basic �(� ���; true !�; �14����Strict �, � P9��� ��� W%�� !�" �F��� %,� ��� �������� ��F K�%@0� ���� E �� �" H %4��� 3%�%* ���� ����
���� !�" 2%$����������� �1������ ���� ��� .
Universal Knowledge Solutions s.a.l
222
<%@ Page Language="VB" Strict="true" %>
X� �
%,��ASP.NET �( A��0� � ��� �������� ��� u���� T% D7- : € C%��� u��. € A����� u����. € ���� ��� u��.
U�� � X�:
B����� '������ ��14�� u���� '����� ����� @OutputCach #�% �, ������� 5��� C/��� ��14: <%@ OutputCache Duration="60" VaryByParam="none"%>
�14���� ����Duration !�" 5��� N/�� ����-�� ��" IISB , �����$��� u�� . � P9��� ��� W%�� ��� ��14�� #�% �, 3%��$�� ./( ����� 5��� ��� �/; �� , ��� 3��"; '� �J����� ����� ��%; ��14�� �
������ 2%��� �� ��%����HTTP_User_Agent. N%� '������ K%$���� �� 2 %$�� 5� �� E� ./( 2%����� �� ��%; . �� ��14 5� '� �/\,3L��� #1�� �44�� �(�
K%$���� )����$� ��� �74 B��� '�� � N%� � �� �� �(� ��� 3��"; �" ?�*�" ����%; .
H*� ��-���3%�1�� ./( ������: <%@ OutputCache Duration="60" VaryByParam="none"%>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage"
Language="c#"%>
<html>
<head>
<script language="c#" runat="server">
public void Page_Load(Object sender, EventArgs e)
{
lblTime.Text = "Page Loaded at: " +
DateTime.Now.ToLocalTime();
}
</script>
</head>
<body
<mobile:Form runat="server" id="frmMain">
Universal Knowledge Solutions s.a.l
223
<mobile:Label id="lblTime" runat="server"/>
</mobile:Form>
</body>
</html>
T � ��� �/( � P9� ��"�� 3%� �� %-�0 ��14�� D ����K%$���� )�� #1� �� ��14�� !�; ��4��� ������� ����� % P� �� �� ��14�� ./( !�" %(�<�� 3�60 � ��- )�F��� �/( �, ��14�� � ��� ��$ �� N�.( B����� ��*� �� 5� @OutPutCache
�14����VaryByParam � ��14���� �1 � ��9� ��*� �� ��� VaryByHeader �VaryByCustom � ]%9 �� �� ,���� �� '����:
€ VaryByParam:�� �% ��� �����; �������� . ��� '���� �(� �� F � ��� '����� !�; ������ �� ����%; '� � %-�� T % �" ���$��POST� �GET.
!�; �14���� ./( �� F � $� '� �/;none 5� u��� � P9��� ��� W%�� '�� GET '������ % %�� ��� �, ; ���0� ����" T % �" =%�� �������URL 3%�9G� �$� (?).
������ ./( �, ��%� �/; ��%��� �����$��� '������ S����� ��14�� u�� �� �� F ��* ������� A��� � ��� �� �14����VaryByParam %�< ��� � ���� ��4�1� ���41� �,��-���:
<%@ OutputCache Duration="60" VaryByParam="selState;txtSearch" %>
� 3������ ' ��� E �� !�" ���$ u���� �$��� '7$�� 2%��� ��� ��*� � ��� ��%��� �7��$��� ��*POST �1� �� ��� ���; (*) !�; �14���� ./(.
<%@ OutputCache Duration="45" VaryByParam="*" %>
€ VaryByHeader: �"�� �14���� ./( �, #�% ��* %4�" !�" ?�����"� u���� � $1� HTTP .,��-��� � � !�$�
A�%�G #�%�� !�" ?�����"� u���� Accept-Language B��� ����� 5� OutPutCache� �� ��:
<%@ OutputCache Duration="60"
VaryByHeader="Accept-Language"
VaryByParam="none" %>
€ VaryByCustom :� '������ K%$���� �� !�" ?�����"� u���� % P�� �14���� ./( '����� ?�����"� ��� !�"�(� ��� '� �44�� � ,%��.
�� ��� �14���� ./( /�L�Browser�J���� ��9� .
� $� ����� 2Q%$>� 84�� u�� !�; ���� ��� �� ��� ���\� VaryByCustom �� % �� 2 %$� 3��";� GetVaryByCustomString K%P�� HttpApplication 2�� ��* Global.asax.
./( � $� �� 5� ��� ?��,� u���� % P�� � P9��� ��� W%�� ��F �� �������� '� ����� ������ 5� �� � ,%���� ����� �� % ��.
Universal Knowledge Solutions s.a.l
224
H*� B����� � ��� '� D � 3%�1�� ./( ������ ��-���@OutputCache �� ��� : <%@ OutputCache Duration="60"
VaryByCustom="MySelector"
VaryByParam="none" %>
�� % �� 2 %$� 3��"; 5� ���GetVaryByCustomString 2���� � 1���� �, ����$�� � ���� 3����� ��* Global.asax public override string GetVaryByCustomString(
HttpContext context, string arg)
{
switch (arg){
case "MySelector":
// Send back the string that is used to distinguish
// between client devices for output caching.
return "MySelector=" + context.Request.Browser
+ context.Request.Frames;
default:
return "";
} }
X� � )����(
@4�� � X� � �������:
2Z%$> A����� u����B�L��� � ��� '����� 3��"; �4�� '������ �(I9� ������ �(� '������� �4���� '����� %4��" E� '���. u���� �� �� % �� ./( '����� ��� � ����A�� ��9� �F ����� '������ '��� %4��$� 8���� C%��� �� /�� 5��� ��14 ��
%���'������ !�; ��. u���� �� )���� �/( '����� ��9%��� %4��$�� �� : ���%������ ��14�� #�%� EF���� ��* � ���� =%�0� A���0�� � /���
A��0� � �� ��J��� ��� .
��"�� � X� �������:
'"��ASP.NET 3%��/�� T % �" u���� �> �� ��� N/�� ���� � � �1������ K�%@0� � ���� '���HTTP . u�� W�� T � ��� ��* ��� N� �� B �; ��4��� ��� �/� T � ��� � P � I% ���� ���� ���.
/� #%�1�� � �� ���� ��� u�� W��� � ��� ?��� �� ?� ��%� B$� ���$���.
// Save DataSet in the data cache; has Application scope.
Cache["DS"] = myDataset;
// Get the DataSet from the cache.
DataSet ds = (DataSet)(Cache["DS"])
Universal Knowledge Solutions s.a.l
225
�3? B �C � ��� �:
��� $0�4 �?�
������� � ����� � : ����� 'J��� ����"G� 2�� ����� �������;
����: ����� '<$� �,� '��� ASP.NET 5��� C/��� ���14 � �9�� � �EF����� ��9��� �J����� ������� �a��ASP.NET '"�a�
3� ���� ��*%$���� K$������� �- ���� g��� . 3� �� ��� ��� '"� T% ����� ./( �, K%$���3� �� % 9L� ��P�.
������� ��!�: !�" �41�� �/( �, 5�� �� 2%$� :
€ � 1 ����"G� ��1�� ��* �������� ��� ����� 2 %$�. € ������ !�" 2%$����B������;. € �*�3���0� ���J��� 2 %$�.
Universal Knowledge Solutions s.a.l
226
0�4 �?���� $
'��� ����� '<$� �,ASP.NET �EF����� ��9��� �J����� ������� 5��� C/��� ���14 � �9�� �� ; �������� ��� ����� K$� � $�T � ��� !�" ��$�� A��-� A� ���� � %�<� �� ,5�� ��� ��9��� T � ��� ���14.
��$ '"� '�" !�; 3%(�<�� ./( 5�ASP.NET K%$��� ����*%$���� �� % ���� ��$�� 5� �� ��$�� �1������ g��� �� % ��
K%$�� ���. /; '��� � u��1��� �� ��� �� ASP.NET g��� �� % ���� )����� �/( ��� ?��"� ���*%$����.
���� �� !�" T� �Microsoft �4�� ���� 3%�, �� �, � ��*%$���� �� 3� �� ���� '"�� '"��� � �����*%$��� 3%,�����. ���%� T % �" ������ ./( !�; ��4��� ���
6=tabindex?aspx.deviceupdate/mobile /net.asp.www://http
� �/�� ����$� � �% 3%�4� '�"�� % @ ���� '����� ���%��k W��� <��� ���ASP.NET������ ��� ��� �� 3� �� )���� �,�*\� H� E���� ���F �� �� .� P� �/� �7� ./( 3%�1�� T% ��
K%P�� �/( � �L�� ��������.
���?9� ����� $�= � ���� � ��4�8�� � ����
!�" 2%$��� '� 2 � '�1� �� 5� � �� ����� '"� �,�*; �� ������ 2 �� �J�����N%� %� ���B� 5�0� % 9L��� �P�. H*� N/�� A�%�G� ������ ��9����� T � ��� ?�%,��� ��� B� 2 %$� � ���� .%��� '�� � ������ �� .
ا�"!�ن
م�$ك
زم%
&'( ا�
Web.config و
Machine.config
+$ض
MobileCapabilities
و HTTPContext+$ض
ه2 1/� ت��% ا��/�ل إ�,
+$ض
ا�4�5
& 6ه! &'( ی��م م�$ك زم% ا�
ا�;:89
ی ? ا� 6آ� م% ت=/& ا�>�ادات
��"!�ن
Universal Knowledge Solutions s.a.l
227
T���� ��9�� �, <�7���������� 5��� C/��� ��14 !�; 5� ��%\� '�� ������ .��" 5� �� ���� N%� A�9�; �� K%@ 24��HttpRequest� � K%P�� !�; ��4���� K%P�� �/( '�� MobileCapabilities �4���� %�" Browser ���� <1���
5� �� �%� ������ ��%�F ��� �����$� ����*. N%� T � ���� 8���� ���"G� 2�� 8�, �(�$� Web.config '�<��� ���"; 2��� Machine.config %4�$��� 8���� '���
<browserCaps>.
B���� D ����� ����- �F ��� �/;2� � %-��, 2���� ��* '��� �/( ���� ?�* � <�7�DeviceUpdate.config .��� ; ��� N/��� 2�� E�machine.config ������ ��* /Microsoft.NET/Framework/version/CONFIG.
H*� '��� ������ 8���<browserCaps>���"G� ��1�� ��* :
<browserCaps>
<use var="HTTP_USER_AGENT" />
<filter>
<!-- Nokia -->
<case
match="Nokia.*">
browser = "Nokia"
mobileDeviceManufacturer = "Nokia"
preferredRenderingType = "wml11"
preferredRenderingMime = "text/vnd.wap.wml"
preferredImageMime = "image/vnd.wap.wbmp"
defaultScreenCharactersWidth = "20"
defaultScreenCharactersHeight = "4"
defaultScreenPixelsWidth="90"
defaultScreenPixelsHeight="40"
screenBitDepth = "1"
isColor = "false"
inputType = "telephoneKeypad"
numberOfSoftkeys = "2"
hasBackButton = "false"
rendersWmlDoAcceptsInline = "false"
rendersBreaksAfterWmlInput = "true"
requiresUniqueFilePathSuffix = "true"
maximumRenderedPageSize = "1397"
canInitiateVoiceCall = "true"
requiresPhoneNumbersAsPlainText = "true"
rendersBreaksAfterWmlAnchor = "true"
canRenderOneventAndPrevElementsTogether = "false"
canRenderPostBackCards = "false"
canSendMail = "false"
<filter>
<case
match="Nokia7110/1.0 \((?'versionString'.*)\)">
type = "Nokia 7110"
version = ${versionString}
<filter
Universal Knowledge Solutions s.a.l
228
with="${versionString}"
match=
"(?'browserMajorVersion'\w*)(?'browserMinorVersion'\.\w*).*">
majorVersion = ${browserMajorVersion}
minorVersion = ${browserMinorVersion}
</filter>
mobileDeviceModel = "7110"
optimumPageWeight = "800"
screenCharactersWidth="22"
screenCharactersHeight="4"
screenPixelsWidth="96"
screenPixelsHeight="44"
</case>
</filter>
</case>
</filter>
</browserCaps> <�7�A����� '�F� 3�" !�" T���� 8��� <case>���"���� ��*%$���� �� )�� ���� �� ��� . % ��$��� E ����� ./( '����
�J ��� ����� E� T�� ��� A�%�G � ��<���HTTP_USER_AGENT N/�� N%� 5� � �%� ��* 3��" .% %�� HTTP.
� �/; ������ K%$���� !�" 2%$��� �(��" ��� , T�� ��� ��� ; '� K%P�� � (L� '� , ;MobileCapabilities �����$���� '��� � ��� �, �(��� ; ��� ���� � J������ ����"G� �, 3������ � J������<browserCaps> 2�� ��* machine.config N/��
K%$�� B�� !�" ������ 2�4 HTML 3.22�%$� % @ ��� .
���� �� A����� 5 �%���� 5�� ��� ������ T�� � �" D���� � ��" machine.config !�; !�; DeviceUpdate.config !�; Web.config .������ �����$��� ?�% �� B�A�%F '�� N/�� 2���� �����$� �P�� D ��.
��* �1������ ��*%$���� �����$� E*� '�" 3��" �*1 machine.config B���� ?�%<� 2�� �#�� �/� N� C�%�; �*1
� D ���� 2�� ��* ��% P�DeviceUpdate.config N%� D �� 2�� ��* 2���� �/( � ���machine.config T,� �� ��:
<browserCaps>
<result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile,
Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />
<file src="deviceupdate.config" />
<use var="HTTP_USER_AGENT" />
��� � $0�4 � �?�
�Q�� �����"; ASP.NET � ����� ��1��� E ���� XML� �� ����� '"� �,�*; � ��" ��� D �� 2���� � �$�
machine.config� �deviceUpdate.config �� ���� '"� � �L�� ��� � ��� ���� !�" � . �/; ������@% ����� � '"��� �/( �,�*; ���� T � �, 2���� '����� 5� Web.config.
Universal Knowledge Solutions s.a.l
229
�(/���� 5� ��� � D7- W��( B������� '��� N/�� �����"G� 2�� �" %<��� KP�:
1 X '��������<� % �$� H� ������� !�" 2%$���. 2 X ������ ������; 2 %$�. 3; /( ����;���"G� 2�� ��* ������G� ..
4�8� � J�? ��� �
5� � �%� %����� � ��" %��$��HTTP User-Agent���<� % �$� '������ ���� !�" 2%$��� �*,0� �� % �� �.
, $*��� �J��- K%$�� ��� ����� K$� W���� ��-��� � � !�$� ����$� B��� HTML �WML N%� D �� �%1��
'������ � �%� User-Agent ����� � � ���� � ,�� . �� F ���� �/; ���User-Agent ���*%$�� 3�$� 3���� , ?�� ����� �� F %����� User-Agent � �%��� �� F '- Accept-TypeK%$���� B�� N/�� =������ )�� � $�� .
� �%��� !�; ��4��� ��� User-Agent �4���� T % �" MobilePage.Request '�� � �%��� �� F ������ ������ ��-���
User-Agent 2�� !�; header.log:
<%@ Import Namespace="System.IO" %>
<%@ Page language="c#"
Inherits="System.Web.UI.MobileControls.MobilePage"%>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<script runat="server" language="C#">
public void Page_Load(object sender, System.EventArgs e)
{
FileStream fs = new FileStream(Request.PhysicalApplicationPath
+
"header.log",
FileMode.Append,
FileAccess.Write);
StreamWriter log = new StreamWriter(fs);
//Write the user agent to the log file.
log.WriteLine(Request.UserAgent);
log.Flush();
log.Close();
}
</script>
<mobile:Form id="Form1" runat="server">
</mobile:Form>
Universal Knowledge Solutions s.a.l
230
� �%��� �� F ��� ; �$�User-Agent �� ���"G� 2�� ��* ���<��� % �$��� A�9�; �� ��� .,�-��� � � !�$�� %����� ���%� �/;
'"� � $� ���� �� K%$��EzWAP %� �; ?�� ����� '�<��� �� F ���$�� 3%�%*� HTTP_USER_AGENT � ��" �, �14���� � ��� '- 3%��1�� match %4�$�� <case> � ����� �P 4�� �, ��� ���<� % �$�� :
<browsercaps>
<use var="HTTP_USER_AGENT"/>
<filter>
<case match="EZOS – EzWAP 2.1 for Pocket PC">
</case>
</filter>
</browsercaps>
?�* � ����� 'F% ��9 � ���<��� % �$��� E �� ����� � � (L�� B������ ��� N/��8J�4��� K%@ �, MobileCapabilities:
<case match=
"EZOS - EzWAP (?'majorVersion'\d+)(?'minorVersion'\.\d+)(\w*)"
>
��"���/ J�? ��� �4�8� �
K%@ W�� MobileCapabilities������� ������ ������; 24� ���� 8J�4��� �� � �$�� . � � ./( '(� ������ ������ 8J�4����K%P�� �/�� ?��$�� �(%-��:
���� � *�" � ��0���� � ���� � �� � Browser String Unkown K%$���� '� �" %�$�.
CanInitiateVoiceCall Boolean False �� ��� �4���� ./( /�L�True # L� !�" %��F ������ ��� �/;
� ��4 ��4�� CanSendMail Boolean False �� ��� �4���� ./( /�L�True �/;
� ���� ��%; !�" %��F ���� �P 4�� '������ � %���mailto
HasBackButton Boolean True �� ��� �4���� ./( /�L�True �/; ������ ���%,� �� %�Back
�������� 2������ %-�� �-�. InputType String telephoneKeypad ������ !�" ������� �� ����
!�" ?�����"� ������� ' ���� �4���telephoneKeypad
��VirtualKeyboard �� Keyboard
Universal Knowledge Solutions s.a.l
231
IsColor Boolean False ./( /�L��4���� �� ��� True; �/����0� '"� ������ ���.
IsMobileDevice Boolean False �� ��� �4���� ./( /�L�True �/; '����� %4��" '"� ������ ���
��������. MaximumRenderedPageSize Int 2000 ���� ��14�� !4F0� �� ��
� ����� ?�%��� �(%��<; ��� . MaximumSoftLabelLength Int 5 0� �� �� ��� N/�� 8��� !4F
���%��� %��� ��* .%��<;. MobileDeviceManufacturer String Unknown >� '�O�4������ E
MobileDeviceModel String Unknown ������ ��% NumberOfSoftKeys Int 0 ���� � ��%��� %�%�0� ��"
������ ���"� PreferredImageMime String Image/gif ��MIME N/�� �*1���
.%��<; ������ ����\�. PreferredRenderingType String Html32 \ N/��� =������ �*1��� ����
.%��<; ������ ��� . ��*�� �������� ' ���html32 ,
wml11 ,wml12, chtml10
ScreenBitDepth Int 1 ������ �$��� �" �4���� ./( %�$� 5 ?�%��� %��<_�bit/pixel
ScreenCharactersHeight Int 6 N/�� 8��� %� � �� %���� 'F%��.%��<; ������ ���
ScreenCharactersWidth Int 12 ���� 2%����� �� %���� 'F%�� % !�" �(%��<; ������ ���
����. ScreenPixelsHeight Int 72 �� ���� %��<G� �9�9 )�1�%�. ScreenPixelsWidth Int 96 �� ���� %��<G� �9�9 K%".
������ !�" ������ 3%�4� �������� ��� � ��� � ��� N%� , ������"G� ��* H �4 ��9� ������ 8J�4��� � $� '� �/; . ����
�����$��� ./( �,%$� ����� 2 �k
T% D7- 3��" W��(: 1 X ������� ��,%��� TJ�-��� T % �". 2 X 4 S���%� % � � T % �"8J�4��� ./( ' F 87��� ������� ������ ���"� % 9L� �P�� % P.
Universal Knowledge Solutions s.a.l
232
3 X ���� �� ��" �� ��L���� ���"G� 2�� ��* ' ��� % P� T % �") �F� �� W���� ��� ?�%<� ���$, % @ 3��" �� % ��% ��(
4�8� � ��"���/ J�? ���� ��3P� �2 �������
8� ����� ������ �, ��( 3%�1�� 8���� ��F�%� 3�"�%� E� % 9L� �P���� ' F 8J�4� K%P�� MobileCapabilities . �/\,
�P�� 5������ ������ 8��� ��/��WML: <% Response.ContentType= "text/vnd.wap.wml" %>
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="Card #1" newcontext="true">
<do type="accept" label="Softkey label">
<go href="#card2"/>
</do>
<p align="center">
<input type="text" name="test"/>
Text after input box.
<br/>
<a href="#card2" title="anchor label">Next</a>
Text after anchor
</p>
</card>
<card id="card2" title="Card #2">
<p align="center">
<select>
<option>One</option>
<option>Two</option>
<option>Three</option>
</select>
</p>
</card>
</wml>
K%$���� %�< EZWAP8��� �/�� � ����� �� ���� :
Universal Knowledge Solutions s.a.l
233
�� �� ���� �� <�7�: X � �$� % %��<\� '�F K%$��� > '� B��� ����G� ��� ���%� �$� �,�*G� % �� %�< .
X %��<; '���7" �4�� %4�$��� <do> ���%� %�� ��14�� �1� �, ��/� B��* �44���� 3%��$�� �� 5�$ �� '�. X J %��<; '� �� �" %���� ��" ��4� %��<; '� � ��-�� �F� ��� !�; ������ ��"%� �� ��.
� ����� ' ��� EF��� �� ����� �(�� �% ���� SJ����� �7� ��8J�4�� MobileCapabilities
���� � ���� � MaximumSoftKeyLabelLength 20
RendersBreaksAfterWMLAnchor false
RendersBreaksAfterWMLInput false
RendersWMLDoAcceptsInline false
RendersWMLSelectAsMenuCards false
������ �? 4�8� � ��"���/ �����
� ���� ?�* � ��"���� ��� ���� T% �� ��� �K%$���� !�" �� ���� ��F�%�� ���"G� 2�� ��* �4���� �� F % P� � ��" %��$��
������ ������; .L ���� ��%���� � �: � ��� �� % �� ./( ���$�.
� �, '���%����� T % �" ������ ������; � ���� � ��- .8J�4��� ' F %���� ������ ���%���� 8��� �1,: RenderBreakAfterWMLAnchor RenderBreaksAfterWMLInput.
�/�� '� ��� �� �������� ��� '��� '- ������ !�" 2%$��� � 4�1��� �� !��0� ���� %,� ���"; 2�� �� ���� �� C%��� ��%:
<browserCaps>
Universal Knowledge Solutions s.a.l
234
<use var="HTTP_USER_AGENT" />
<filter>
<case
match=
"EZOS - EzWAP (?'majorVersion'\d+)(?'minorVersion'\.\d+)(\w*)"
>
<!—start with previously established properties -->
browser="EzWAP"
type="EzWAP"
version= ${majorVersion}.${minorVersion }
majorVersion= ${majorVersion}
minorVersion =${minorVersion }
isMobileDevice="true"
mobileDeviceModel="Pocket PC"
preferredRenderingType="wml12"
preferredRenderingMIME="text/vnd.wap.wml"
preferredImageMIME="image/vnd.wap.wbmp"
inputType="virtualKeyboard"
<!—Test with default values for these properties first -->
rendersBreaksAfterWMLAnchor="false"
rendersBreaksAfterWMLInput="false"
</case>
</filter>
</browserCaps>
B� ��� �����"G� %������ '���� ����� 5� ��14 2�� A�9�; �� ��� �� E� ���.
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<%@ Page language="c#" Codebehind="MobileWebForm1.apsx.cs"
Inherits="MSPress.MobWeb.TestBrowserCapabilities.MobileWebForm1"
AutoEventWireup="false" %>
<mobile:Form id="Form1" runat="server">
<mobile:TextBox id="TextBox1" runat="server"/>
<mobile:Label id="Label1" runat="server">
Text After Input
</mobile:Label>
<mobile:Link id="Link1" runat="server">
Link
</mobile:Link>
<mobile:Label id="Label2" runat="server">
Text After Link
</mobile:Label>
</mobile:Form>
�� ����� �(��"� 8��� ����; ��� �$� �,�*; % ���� <�7� �.A�9�\� ���F N/�� ������� 5��� C/���� 8���� C%��� ��F�%��
Universal Knowledge Solutions s.a.l
235
B�� 2%$� �4���� � $� 5�RendersBreaksAfterWMLInput !�; false .
' F �� % -��� � $� ��� �� % �� ./( �-��8J�4��� � �1������ % 9L��� ��P�� �,%$� 5� �� �� % �� ./( �\, <�7� ��� ����� � ?��F� W���� �����.
48�7� ���0��� *=
K%$��� ����� �� A���� �/( �, ��� ����� ���J��� %�� K�%$�� 2 � 2�9���N%� %� ��� � �4���� �"������ 'J��� ������ ��%� ��" E ��� '��� 2 � '�$�� 2�� �� 5� � �4���� �"������� � �� ���� '"�� ������ 'J����3� �� % 9L� �P�.
Universal Knowledge Solutions s.a.l
236
N%� � ������ !�" ]���� 2%$���� � P9��� ��� W%���� '�� �� �$� � (L�8J�4� K%P�� MobileCapabilities �� �� 5� �� �%� ������ 5�0� % 9L��� �P� � ���.
%��$� '�� N/�� �������� '����� %4��" �� A���� 3���0� ���J���' ���� ���� !�" 5����� ��9��� �������� '����� %4��" � $�.
3���0� ���J��� 2�14 !�; %<��� 5� �/�)��������" ( �%���� '����� %4�" � � %� ���� !�"������� ��9�� %�< ��� ������.
�, �������� '����� %4��" '"��ASP.NET��9� �J����� �� �$�� �"���� WML1.1 ,
WML1.2,cHTML1.0,HTML.32, XHTML .'���<$� !�" 3� � SJ��� 3%,����� ���J����� 3%,����� ��� ����� ' . % ,�� '����"���� % @ 3���b� 3� �� ���J��� T�� !�" � %� ��� E �9�� 3���0� ���J���� N%�4��� 8���. 8��� !�; ��4��� ���
��4��� T % �" N%�4���6350=LinkId?/fwlink/mco.microsoft.go://http.
���0��� � *= ��?���� �������48�7� ���� �
��* ������� 5��� C/��� '��� %4��"� 3���0� ���J��� � � �F7$�� 2 %$� ����� Web.config� �machine.config � W�/��"���� ��* .
, �, �������� '����� %4��" � ��� '� ��-��� � � !�$Asp.Net �� %4��$� 2 %$��� ������ ��� ����� ���J��� �� ���� D7-�
2����machine.config %4��$� <HtmlDeviceAdapters> �<WmlDeviceAdapters>� <ChtmlDeviceAdapter> '"� �,�*; ��� ���<XHTMLDeviceAdapters>.
'J���� ����� '��� %4�" �� ������� 3���� ���J��� �"���� �� '��� !�; ������� ��% 9L��� % 4�� '�� N/��� 5����� ������
������. ������ �� 5� ���� ��"� N%� ���;� 'J��� �5� �� �/( ' ��� %��� '�� N/��� 5� �� �/( !�; %-��.
%4�$�� ��* 3���0� ���J��� �"���� � $� 5� <mobileControls> ��* Web.config� �machine.config � '"� D %4��" 3�" %4�$�� �/(���9� �� %4�$�� <device>3���0� ���J��� ��"���� 2 %$�� '������ .
ز!�ن
CHTML
/=�� ن��ذج ا��ب ا�����ل
<mobile:Label/>
& >% /C >�:$ ت��? Dم
Label
C:ا� %< &Dم
CHtmlLabelAdapter
4�E �!F ا�
ا� 6ش$ات
ا��:$ة
H!ر
Universal Knowledge Solutions s.a.l
237
%�< %4�$�� ���"� ��14�� #�� ������ ������<device>:
�14���� 24��� name ���J����� �"���� '�
predicateClass ���G� �� % N��� N/�� 24�� '� predicateMethod ���J����� �"����� ���� �� % '� . 3%��" �(�
���� �� % �"N%� ���� �/; �� , ��L��� �������� ������ ������ ����� 3���0� ���J��� �"����
������. pageAdapter �"���� ���� N/�� ��14�� 'J��� 24 '�
���J�����. inheritsFrom ���"G� �-�%�� �������� ��� �"���� �� ��
=%�� 3���� ���J��� .
%4�$�� '"� <device> )���� �� A���� %4��" �"���� <control> �, '���� ����� ���; ����� '��� %4�" !�; 'J���'��� %4�" ., ��-��� � � !�$� �������; ������� '����� %4�" Panel !�; '����� %4�" 'J���WMLPanelAdapter.
W�� %4�"<control> ��( � �14�� name �adapter. ���; '� ������� '����� %4�" 24 '� �14���� !�; name ';�
�14���� !�; '����� %4�" 'J��� 24adapter. <?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<!-- Other Web.config settings -->
<mobileControls>
<device
name="HtmlDeviceAdapters"
predicateClass=
"System.Web.UI.MobileControls.Adapters.HtmlPageAdapter"
predicateMethod="DeviceQualifies"
pageAdapter=
"System.Web.UI.MobileControls.Adapters.HtmlPageAdapter">
<control name="System.Web.UI.MobileControls.Panel" adapter=
"System.Web.UI.MobileControls.Adapters.HtmlPanelAdapter"/>
<control name="System.Web.UI.MobileControls.Form" adapter=
"System.Web.UI.MobileControls.Adapters.HtmlFormAdapter"/>
<!—Adapter mappings continue ->
</device>
</mobileControls>
</system.web>
</configuration>
Universal Knowledge Solutions s.a.l
238
48�� ���0��� �?���� ����
5��� 3�$� 3� �� ���J��� 2�14 ����� ��� ��� B�� ��%�/., ���� ?7-�� �44�� ���� �� F ���� 'J��� ������ �� �,�*; ���
�44�� '��� %4��" '"�� 3���� ���J���.
84�� %�c� �� ��� ������ 'J��� ������ ����� �d�� �/;�� 84�� ����� '��� %4�$� �����"; �,�*;�� �B���J���� ����� 2�� ��* ��� ����� ���J��� �"���� ��1 %$� D ���machine.config ������ 'J���� 8���� 24�� '� ������� W�/�
3� ���� ����� ������� 24���.
�14���� '������ ���J��� �"���� �� �����"G� E �� D%� 3���� ���J��� �"���� 2 %$� ?�* � ��� � �� ���inheritsFrom %4�$� <device>. A���� %4��" 2 %$� '� /; <control>4�$�� ��* %Device #1� W��� ���� W�� ������
A��[� ���J����� �"���� �, '�. %4��" 2 %$� ��� ��� <control>�44���� '����� %4��$� �4�� .
� � 3���� ���J��� �"���� �-�%�� �4���� �����"G� ������ ��-���WmlDeviceAdapters � '�� ���� ���% � ���DeviceQualifies:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<!-- Other Web.config settings-->
<mobileControls>
<device
name="NewWmlDeviceAdapters"
inheritsFrom="WmlDeviceAdapters"
predicateClass=
"System.Web.UI.MobileControls.Adapters.WmlPageAdapter"
predicateMethod="DeviceQualifies"
pageAdapter=
"System.Web.UI.MobileControls.Adapters.WmlPageAdapter">
<control
name="System.Web.UI.MobileControls.MyControl"
adapter=
"System.Web.UI.MobileControls.Adapters.WmlMyControlAdapter"/>
<!-- Place any new mappings here -->
</device>
</mobileControls>
Universal Knowledge Solutions s.a.l
239
</system.web>
</configuration>
���� �� % � 8���� ���%��� 8��� ������ , : public class Wml13PageAdapter : WmlPageAdapter
{
public static bool DeviceQualifies(HttpContext context)
{
MobileCapabilities capabilities =
((MobileCapabilities)context.Request.Browser);
bool qualifies = capabilities.Browser == "Openwave13";
return qualifies;
}
}
Universal Knowledge Solutions s.a.l
240
�3? A�� � ��� �:
48�7� ���0��� �������� � $� ����� � ���"� � @�3"/
������� � ����� � : '��� %4�"�'J��� ����� �84�� %4�" ����"G� 2�� .
����: 2%$����� %4�" 3� � 3%�� !�" ����� ./( �, ������� '�� � 3���0� ���J��� 2�14 ���%� � 1 �� ��� 8���� T ���� T � �
����.
������� ��!�: !�" �41�� �/( �, 5�� �� 2%$� :
€ '����� %4�" 3� � 3%������ %� ���� ���%��� € 3���0� ���J��� %�� € 3���0� ���J���� � %�4��� 8�4��� ����� € %14�� �� '��� %4�" A������B� �44���� 3���0� ���J��� A� € �*�3���0� ���J��� 2 %$� € ���14 !�; ' ���� '"���44���� '����� %4��$� ���� ��� �"���� �%��.
Universal Knowledge Solutions s.a.l
241
48�7� ���0��� ����� ���� � ���"? @�"
2%$����J��� 2�14 ���%� � 1 �� ������� '����� %4�" 3� � 3%�� !�" ����� ./( �, 3���0� �� ��� 8���� T ���� T � �����.
24�� �-�%�� '����� %4��" A��� � 1 � W�/� K%$��MobileControl � '� � B �" ���J����� 2�14 T � � � 1 �.%��<; !�" '������ �����.
��� � $� ���� � ���"? @�":
����� ��� �� 3%,����� �������� '����� %4��" ��* ��� '� �/;�� 24 A�9�\� W�/� %14�� �� ����� '��� %4�" % � � ������\�, 24�� D% MobileControl� � �-� N�"�F 24 N�PageControl� �Panel.
� 5 �%���� '����� %4��" A�9�; � ��" �� %��� ��" '�� %14�� �� '����� %4��" % � � 5� � ��-�%����. • , '��� %4�" % � � ��$" !�" n?�����"�%4������� %�: ������ '����� %4�" ��,%4� � �$�� �, '���%�" �,�*;
� �4���� 3� �� �� % � 2 %$� 3��";8J�4�� �3����� T% . • /�W� '������ '��� %4�" 5 �%� ��" ����� �( %4�" 3�" 3%,����� %4��$�� �� '��� ���� /; 3��$� % � ��� � ��"
?����� E �� �-�%� 5�� W�/>��� '����� %4��" 2J�<������. %14�� �� '��� %4�" % � � ���� �, ����� �" 5��� 7,'����� %4�$� 8���� 24�� % � � �, � ���;�� 24 % � �� 2�14�/( � ���� '����� %4�$� 3���0� ���J���.
��F )�%9�� %4�" ��� %� ���� ���%��� '�, �� ��� �� '����� %4��" ������ � �(A�"���� '�� ���� T% ��� '����� ��F����J�"���.
� ���%��� ./( 8 ��� ��� �� ��:
1 X ��14�� =���� � ����'����� %4��" A���. 2 X ��� �/; '����� %4��" ���� 3��$��=%� �FT � ��� T���� 5� �� � ��� �, ���� ' F N� <1� . 3 X ������ �� ����%; '� ���� ���� ��� ����$��'����� %4�" ���� D ���. 4 X '����� D���� T7 ;�D���0� �����$� / 1��. 5 X ������ 5� �� %�<���� '����� %4�" ���� <1�. 6 X � �9�5��������� !�; B��%;� . 7 X '����� %4��"� ��14�� �� 8��������� �44���� 3%��/�� 3��$��.
% �� �� �"���� A�"���� '�� ��" %� ; �� ?�* � ��%�/�� �; ��4��� ��%��� �44���� 2J�<��� T � ��� ������� '��� ���� T.
H*� '����� %4�" 3� � 3%�� ������ ������� T% ��� ���� D���0�N%� �(I�"��� : ���%��� D�� �/�� � T% ����(/ 1�� '� ���� D���0� 3���0� ���J��� T%
� (L��� �����"G� � (L� '� � �� ���7�� 5
������
OnInit: '����� % ��OnInit D���� T7 \� Init
�� % �� A�"���� '����OnInit �$�����
OnInit: 5����� ������ 'J��� 24 %� ��� '�
��"'����� %4�" �� �-� T�� . /; '���
Universal Knowledge Solutions s.a.l
242
������� 'J��� 24 . 8�� %4�$� ��$�� T �� T � ��5�
�� % �� W�� 2 %$� 3��";.
� % ��� OnInit 24�� ��* MobileControl �� % �� A�"����
OnInit������ 'J��� 24 ��* . =���� � ���
ViewState
=���� � ��� '� ViewState ��
�, ������ K%P��T���� 5� �� � ���.
LoadViewState: 2 %$� 3��"\� '��� �� 5�
LoadViewState ���@% ��� �, ������ 3��$�� � ��" 8 4���.
/; �� % �� '���LoadPrivateViewState ������ � ����
'������ !�; ����%; '� ���� � ������.
LoadAdapterState : �����$� N� <1� ������ 'J��� ��� �/;
��* ������� �4��ViewState � N%� ./( �, �����$��� ./( � ������%���.
�� % �� '���LoadPrivateViewState
4���� 24��� �MobileControl �� % �� ./( A�"����
(LoadAdapterState)
���� ��� ��%;������ ��
���� ��� � ��� '� ������ �� ��%���
LoadPostData: %4�" E� '������ �"�1� �� �� ��%; '�
�� �� A��� '����� !�; '����� ������ 5� . ��%��� ���� ��� � ��� '� � D ���
���8J�4%4�$�� �/�� ������� . 24�� !���� ���� %4��$�� ��9�
IPostBackDataHandler ./( �� ?�A�� ���%���.
�J���� ��9�W%�9� T% N� �$������%��� ./( �, ���� 'J��� 24�.
� ����� N%�� ���"0� ��( %�<� �� 5� ���� H�1� �5� �� ��"
3�"��� ��4��-� ���� ���?7.
OnLoad: D���� T7 \� �� % �� ./( '���Load
� �� % �� A�"���OnLoad 24 ��* ������ 'J��� . ��� �� % �� ./( � ��� �,
'����� %4�"����� ������ 3%�4� H� � �� �� ������ 3��$��SJ��� �� 3��"; ���%� �����$��� ��%; � ���N%�� � ��"
� �"��F �� ���� ��� 3��$������ ��.
OnLoad: 24��� �4���� �� % �� ./( '���
MobileControl �� % �� A�"���� OnLoad������ 'J��� 24� �4���� .
��� ��� ��%; % P�����*
��%��� ���� ���
D���� T7 ; '� ������ ��" % P����
N���� �, �% @ �� ��%��� ���� ���
������ ���� �� �4���� %4�$
����'�.
RaisePostDataChangeEvent: N%� �% P� �/; % P��� D���� T7 ;
������ ��%G� � ��" � � ������ ���� �� �� �������� ����" ����� �( ��� D����
TextChanged '����� %4�$� 8���� TextBoxD���0� ./( ��� .
'"�� ���� '����� %4��" W%�9�
W%�9� �� J���� 3%�4�% 2�14 T���%��� ./( �, ���� 'J���.
Universal Knowledge Solutions s.a.l
243
IPostBackDataHandler ./( �, ���%���.
D���� ����$����� ��� ��%;
���� D���0� 2% �� 5 ��� �������� '������ �"�1��� � ��" �"
������ E�.
RaisePostBackEvent: % P� D�� N� �$� D���� �/( T� � .
N%� D�� !� �� T7 ; ��� �� ������.�����'����� ., ��-��� � � !�$
'��� %4�" !�" '���� %�� ��"Command ��%; � ��" '�� �����
�� $���N%� � D���� T7 ; Click. 24�� !���� ���� %4��$�� W%�9�
IPostBackEventHandler ./( �, ���%���.
HandlePagePostBackEvent: � D���b� ���� �/; %4�" !�; ��%��
������ !�" ?�����"� )���� �� '�����2����� ./( �, '����� %4�" !�" 5� ,
A�"��� ������HandelPagePostBackEvent A� "G
��%; D�� ����$�� �4%1�� ������ 'J������� ��� .
��F �� ���%�� �$���
E �� ��*�� '�� ���� ��- �����
� ��" ��F� �$� � %4�"'����.
OnPreRender: �� % �� '���onPreRender T7 \�
D����PreRender � �� % �� A�"���OnPreRender 'J��� 24 ��*
������. ��- ��� N� ���%��� ./( �, '�� ��� %4�$� ������ �����$� !�" � ,�*;
'�����.
�� % �� '���OnPreRender 24�� �, MobileControl �� % �� A�"���� OnPreRender 'J��� 24 ��*
������.
� ��������� �����$�
���%��� ./( �, '� �����$� <1�
�4����ViewState ��*
�� �� K%@ '� � � 4� ���
B<1�.
�� % �� ��40� E*��� ��� �� 3��"SaveViewState '<$� �, ?�����
�����. �� % �� 2 %$� 3��"; ��� ��� N� !�"
SaveViewState��" �, ��@%�� ������ 3%��; 8 4��.
�� % �� �"���SaveViewState �� % ��SavePrivateViewState �����
���� � ������ ������ �����$� � ���� '��������� !�; ����%; 3��"; ��� .
������ �, ������ K%" � ����� 5�� ��������N%� � ��� ViewState
" ��� K%@ ��* ���%9 ��� '����� !����� ���� �,.
��� N� !�"� � $1� A�P�; %� ��� ���
SaveAdapterState: N� <1� ������ 'J��� K%P� ���
�����$�ViewState ������� �4�� ./( '�������� % �� .
�� % �� '��� D �SavePrivateViewState �4����
24���MobileControl ./( A�"������ % ��.
Universal Knowledge Solutions s.a.l
244
ViewState. ����PrivateViewState D � �1����
A�P�; ��� � ������ !�; ����%; '� ��� $1�.
� �$��� ���%��� ./( �,
C%��� � ��� '� B��%; '� N/��
������ !�;.
Render �� % �� A�"���� �� % �� ./( '���
Render������ 'J��� 24� �4���� .
Render: '���� K%P�� �� % �� ./(
MobileTextWriter C�%�\� '���� !�" '����� %4�$� ���� ��� ��% 9L���
������ ������. i %1��� '�� ���%��� ./( �,
'����� %4�" E �� % %���
�%�����
OnUnload �� % �� '���OnUnload D���� T7 \�
UnLoad �� % �� A�"���� '���� OnUnload�� 24� �4���� ������ 'J�.
�� 5� %%�� ���%��� ./( � �1����� �%���� ��4�� �-��� L� =%� ���� E� ���� ��� 3�"�F.
OnUnLoad: �� % �� '���OnUnload 24 �,
MobileControl �� % �� A�"���� OnUnLoad������ 'J��� 24 �, .
�J����� 5 �%��� ���%��� ./( �, '� ��F �J����� 2 <���� �� %4�$�� ����;
3%��/��
Dispose
48�7� ���0��� ���
� ��� E��ASP.NET �� ��� �������� ASP.NET=%�0� . T% �� �� ����9�� �"���� '����� �� % �� #1�� ��$� �(� 24�� �� D%� ���� %4��$�� ./( ��� ��,%4����System.Web.UI.Control. =��; �� ;��� ��,7��� %4��" � � � %(�
� � ��� W��� �������� '����� �, ����3���0� ���J���� �������� '����� %4��" '�����.
�, 84�� '��� %4�" % � � ��" �������� '��� ���� T% �� ��� ��� �;ASP.NET �� % �� �( Render � �9�� '��� ����� !�; B��%; '� N/��� % 9L� �P� �P 4� C%���'������.
�� % �� ?�* � ������� '����� %4�" W��� Render � �� % �� A�"���� '��� �� C%� � �9�� '��� ���� ;Render � ��%���
������ 'J��� K%P��������� % 9L��� �P�� C%��� � �9�� .%��� '�� N/��.
Universal Knowledge Solutions s.a.l
245
����� '��� %4�" �� C��� � 24 !�; 3��"�J��� 2�14 �� %-�� D � 3���0� ���%,� �� !�" ��$�� � ����; 24 �� 3���0� �� � $�.
%�$ ������� '����� %4�" � � �"�1��� �" ?7-� ������ ��9��List �B� � ��%��� ���J����� 2�14.
�'����� !�; �� '���� 5� �4 ����"2%$��� N%� � ,%���� ����� 8�1� ������ )�� !�" User-Agent �" 3%%���� 5� � �%� T % HTTP���� ��� �, �� �% ��� . ���"���� ��� ����� ��J ��* ������ �" D���� '� '- � '� '- ���
5� �� �/�� ������� 3���0� ���J��� �"���� 8 4��.
3���0� ���J��� �"���� N���������� '��� %4�" ��� 8�� ���� 'J��� 24 . E �� W%�9� �, 3���0� ���J��� 2�14 �"�������"� D � �� 3���� � �-� ������ ���� �� ���� #1�WML1.1� HTML3.2� CHTML� �XHTML.
Universal Knowledge Solutions s.a.l
246
���"� ��%��� 3���0� �� �� ��� 3���� ���J��� % � � 5� 3� ���� �������� '����� %4��" % � � ��"� �"���� ��* ���,�*;���� �4���� ���J����.
���J����� �"���� ��* B� 8���� ������ 'J��� E� ��14�� ��* ����� '��� %4�" �� ��$ �� ���� 5� ����$� ��" ���� ��% 9L��� � ���� 3%������N%� ������ !�; ����%; .
Universal Knowledge Solutions s.a.l
247
A���� ��� � 48�7� �?� $��"
�, 3���0� '"� �� �� �;ASP.NET ��FE���� ��. '��� %4��" D ��� � ��" �\, W�/� ASP.NET '"� !�; N�I �������� ��� ����� �� 3� �� )����. �� D ����� %�<��� � %� �d�� �/; !���Microsoft � N/�� �J������ 'J����� ���N%� .���; ������ !�;
5��� % @ � �������1�� 5�� ��� '"��� �,�*; ������\�, .
48�7� ���0��� ������ � ���" � A� ��� �: % � ��� �J � '����� h�;Visual studio.Net3���0� ���J��� % � �� ���� %-�0� �� % �� �( . /; ���%��� 8��� �,�*; ����� ���F N/�� ������ 'J����Microsoft B� ����)�%9� !�; �� �� ��%�� http://go.microsoft.com/fwlink/?LinkId=6350
% � ��� � ��" � ���. �P 4�� !�; ���%��� 8��� � ��� �(�$� ��� ���� ��� ���� � ��� ��* B������� 5��� '��� !�" B$*�.
�, �%���� �� � ��$� ��"���� ����� ���� ���%��� % � ���: 1 X �P�� � �� )�%9� A�9�;C#) ��VB ( )���� ��Class Library )�%9��� '� ��� Custom Adapters
2 X �J������ 24�� 2/�Class1.cs '�F N/�� Visual studio 3/,�� �, )�%9��� T�, �� 0� %���� %���� '- .A�9�\� Solution
Explorer %� ���� Add '- Add Existing Item,�*; '- 8�4� E �� �C#EF�� �� �� ���� '� ���� � ��%��� Microsoft������ 'J���� �4����� .
3 X 3/,�� ��* �� 0� %���� %����Solution Explorer %� ���� Add Reference .
4 X ��J �,.NET %� ��� Mobile Internet Control Runtime) .System.Web.Mobile.dll( �,�*G�� ������ !�; System.Web.dll)�%9��� !�; ���*� .
Universal Knowledge Solutions s.a.l
248
5 X ( 3���0� ���J���� N%�4��� 8��� ��� � A��0� A�*, �, �,%$��� 3���0� ���J��� ����$�� '������ B1�System.Web.UI.MobileControls.Adapter2�14�� A��� #1� 8�4��� ./( '���� D � . E ��� � ��$� ���F �/\,
������� 8�4��� ./( N��� 2��� � � � ���� !�" ?�%��F ��� �� � P9��� ��� W%�� �0 L � ���% %�<� B������ 24��Sysytem.Web.UI.Mobile.Adapters.HtmlFromAdapter '� #1� W�� N/��� �$ ����� ��1�� ��* 24���
�A��0� A�*, #1� ��* E*�� . 6 X ����� � ��" '���� � %�4��� 8�4��� '���� <��� ���2�14�� B �; ����� N/�� A��0� A�*, 2 %$�� � %9�� E . �/\,
���-�� 2 %$�� T � ��� '�FCOMPILING_FOR_SHIPPED_SOURCE ������ 'J��� %��4� 2 %$� ?� J���� N%� ��*System.Web.UI.MobileControls.ShippedAdapterSource.
7 X �J � �,Visual Studio.NET���-�� �/( 2 %$� ��� 3/,�� ��* )�%9��� !�" �� 0� %���� %����� Solution Explorer %� ����Properties� � ���� %� ���Configuration Properties8J�4��� ��14 % � �, �������� 3%�9 ��* . ��� '-
%� ��� %� ���Build?�% ��� � ����; COMMPILING_FOR_SHIPPED_SOURCE ����-�� �� ���- N� �$� �� %9�� E ����� ����-� �44���� ������ ��* 3������. 8 X 3������� '����� %4��$� N%�4��� 8��� � �$�� 84���� '����� %4�$� � �� ���� 'J��� N� A�9�; N%� . E ��� '-
3���0� ���J��� �� N��� � �� �$ ��� 2�� !�" ��4��� )�%9���. 9 X A�9�; 5� � ���� �$ ����� 2���� '���� 3/,�� ��* )�%9��� !�" �� 0� %���� %���� '- �� �� ����� 5� )�%9�
Solution Explorer%� ���� Add Reference 84���� ������ 'J��� !�" � ����� ������� %� ��� '- (DLL) ���,�*;� )�%9��� !�; .�� W�/� �44���� ���J����� '���� )�%9��� �����"; �* !�; ?�* � C���� 2���� ��* Web.config
T � ���� 8����.
�"@� *�� ���� ���� ��"? @�"4�8� �0���
'��� ����� �� A���� �/( �, �%4�$�� �/�� ���� 'J��� A�9�; !�; �,�*; ��J���� '��� %4�$� B �9 '��� %4�" A���.
'� �J���� ��9�%��<;'"�� ���� 3���0� �, ����� �/( '����� %4�" HTML '"�� ���� 3���0� �, �� ���%� �� ��J7�� WML.
'"�� ���� 3���0� !�" � ���$� ����� .%��<; '� ���� '��� %4�" �" 3%��" B ��� N/�� '����� %4�" ��� HTML
�WML.
�� �� , (� '����� %4�$� ���%��� 8��� � ����$�� �4�� � ��� �, '������ �"� Title�; �,�*; %4��$�� �7-�� � �4�� !���� 24 �, � ���$�� ��*.
using System;
using System.Web.UI.MobileControls;
namespace MSPress.MobWeb.CustomControls
{
/// <summary>
Universal Knowledge Solutions s.a.l
249
/// Simple example of a custom control built from scratch
/// </summary>
public class CMTable : MobileControl
{
private String _title, _item1Text, _item2Text;
public CMTable()
{
Title = "";
Item1Text = "";
Item2Text = "";
}
/// <summary>
/// Gets and sets the text that
/// can be displayed as a title
/// </summary>
public String Title
{
get { return _title; }
set {_title = value; }
}
/// <summary>
/// Gets and sets the text displayed in column 1
/// </summary>
public String Item1Text
{
get { return _item1Text; }
set {_item1Text = value; }
}
/// <summary>
/// Gets and sets the text displayed in column 2
/// </summary>
public String Item2Text
{
get { return _item2Text; }
set { _item2Text = value; }
}
}
}
'����� �[� ����� Visual Studio2�14 ����� �� �� )�%9� A�9�G '- A� "; '� )�%9��� �/(
CustomMobileLibrary?7-� . �������� '����� %4��$� � P9��� ���� 8���� �$ ����� 2���� !�; E�%� �,�*\� �(�$� '����(System.Web.Mobile.dll) W�/� System.Web.dll T���� N%�4��� 8��� N��� N/��� )�%9��� !�; 24 2�� �,�*; '-
��� E ���� '��� ?�% ��2��.
%��<G� T �� N��� ���� 3���0� ���J��� 2�14 A�9�; 5� �(�$� . a� 84�� ��0� ��14 '�� ������ �1,HTML �CHTML � a� 84�� ���-��WML
Universal Knowledge Solutions s.a.l
250
������ 'J���� 8���� ���%��� 8���� a� HTML �CHTML: using System;
using System.Web.UI.MobileControls;
using System.Web.UI.MobileControls.Adapters;
using MSPress.MobWeb.CustomControls;
namespace MSPress.MobWeb.CustomControls.Adapters
{
public class HtmlCMTableAdapter : HtmlControlAdapter
{
protected new CMTable Control
{
get
{
return (CMTable)base.Control;
}
}
public override void Render(HtmlMobileTextWriter writer)
{
String tableSuffix = "";
Alignment alignment =
(Alignment)Style[Style.AlignmentKey, true];
if(alignment != Alignment.NotSet && alignment !=
Alignment.Left)
{
writer.Write("<div align=\"");
writer.Write(alignment.ToString());
writer.WriteLine("\">");
tableSuffix = "\r\n</div>";
}
writer.AddAttribute("width","90%");
writer.AddAttribute("cellpadding", "3");
writer.RenderBeginTag("table");
writer.WriteLine("");
writer.Write("<tr><td>");
writer.EnterFormat(Style);
writer.WriteEncodedText(Control.Item1Text);
writer.ExitFormat(Style);
writer.WriteLine("</td>");
writer.Write("<td>");
writer.EnterFormat(Style);
writer.WriteEncodedText(Control.Item2Text);
writer.ExitFormat(Style);
writer.WriteLine("</td></tr>");
writer.RenderEndTag();
writer.WriteLine(tableSuffix);
}
}
}
Universal Knowledge Solutions s.a.l
251
� ������ 'J���� 8���� ���%��� 8���� aWML: using System;
using System.Web.UI.MobileControls;
using System.Web.UI.MobileControls.Adapters;
using MSPress.MobWeb.CustomControls;
namespace MSPress.MobWeb.CustomControls.Adapters
{
public class WmlCMTableAdapter : WmlControlAdapter
{
protected new CMTable Control
{
get
{
return (CMTable)base.Control;
}
}
public override void Render(WmlMobileTextWriter writer)
{
Alignment alignment =
(Alignment)Style[Style.AlignmentKey, true];
String alignID;
switch (alignment)
{
case Alignment.Center:
alignID = "C";
break;
case Alignment.Right:
alignID = "R";
break;
default:
alignID = "L";
break;
}
//Write beginning of table
writer.EnterLayout(Style);
writer.EnterFormat(Style);
writer.RenderText("<table", false, false);
if (Control.Title.Length > 0)
writer.WriteAttribute("title", Control.Title);
writer.WriteAttribute("align", alignID + alignID);
writer.WriteAttribute("columns", "2");
writer.WriteLine(">");
//First datacell
writer.Write("<tr><td>");
writer.RenderText(Control.Item1Text, true);
writer.RenderText("</td><td>", false, false);
//second datacell
writer.RenderText(Control.Item2Text, true);
Universal Knowledge Solutions s.a.l
252
writer.RenderText("</td></tr>", false, false);
writer.WriteLine("</table>");
//close table and output a trailing break
writer.ExitFormat(Style);
writer.ExitLayout(Style, true);
}
}
}
'����� %4�" E� �(��$��� ���� �� % �� #1�� �$ ��� 2�� ��* 2�14�� ./( E ��� 5� . 2�14�� ./( E*� ����� ����1�� ��*
3���� 3%� �$ ��� 2�� !�; ���� � ��� '- '����� %4�$� '������ )�%9��� #1� �, ��� �*� ��� �� �4���� � $ �����.
��� ������� 4�8� � ���� � ��3P� � �2 ����MobileTextWriter
�� % �� A�"���� ��14��� 8���� ��$�� %� ; '�� Render4 ���$�� ?�%%�� 24�� �� %��� 2System.Web.UI.MobileControls.Adapters.MobileTextWriter(� �WmlMobileTextWriter N/�� 'J����� ������
�� D% WmlControlAdapter ��HtmlMobileTextWriter 24�� �� D% N/�� 'J����� ������ HtmlControlAdapter. ��� �P�� C%��� ��%G 2�14�� ./( '����������� !�; % 9L.
�� 3%������ 2�14�� W����MobileTextWriter���� ��� % 9L��� �P� C�%�; ��� ���� TJ�% �� �� � �$�� . ���-��� � � !�$,
'���WriteBeginTag(“tagName”) � �� %4�" H�1� � '��� WriteAttribute(“name”,”value”) �14��� C%� ��%\� �� %4�" ��* .'��� ��� writeBreak 3% 9L� C%� ��%\� <br/> �� x�� '��� � � �, �WriteText(“text”)
�WriteEncodedText(“text”)� �4���� 2%����� � -��� � �%� '������ ��; %� �� C%��� !�; 8� ������ �3%9��� 3%�4�.
������ �� �����869�48�7� ���0��� $�= : ������ '����� %4��" E �� '"�� �� �"������ #1� ��%��<G� 8J�4� �-� 5��0� ForeColor� BackColor� Font. ..
����%��� '� 2� B�� !�$�� � %�9�� %��<G� ��14�� '<$� ��������� ������ '"� ��- ��� �, ��� � � .
�4�� ���%� � ����; ������ 'J��� 24� 8���� ���%��� 8��� %%� %��<G�� ��� '�F ���� ��������� %� ��* % -L���� W�/'������ !�; �%��� C%���.
��" ?7-� �� ���� �����; �� ��� Red !�; �4����ForeColor K%$�� !�" �$ � ��9� ��$� �� ?7-� HTML ���� � �� ��� K%$�� !�" % -L� N� ��� ��� WML1.1����� � �� .��� 2�14 MobileTextWriter C%� ��%; %4��$�� � � ������� % 9L��� �P� '������ ���� ���.
���� 24�� .���� ��*���� TJ�% ��MobileTextWriterC%��� �, � ����� �/( T � �� ?������� %-�0� �( . € EnterLayout(Style style) :� � �� E �� ���� A��� '���> K%@ �, ��*���� 5��0� �� �" T� style. € ExitLayout(Style style) : E �� ���� T7@\� '���. € EnterStyle(Style style) : H�1�� 3% 9L� ������ '���.
Universal Knowledge Solutions s.a.l
253
€ ExitStyle(Style style) :T7@G� 3% 9L� ������ '���.
����� � �� ���� 'J��� A�9�\� ���F �/; B�� ��%�/WML 24�� �� �-�%��� 5� System.Web.UI.MobileControls.WmlControlAdaper 'J��� A�9�; � %� �d�� �/; ��� HTML 5� , �-�%��� 24�� ��
System.Web.UI.MobileControlAdapter.
���� T% �� EnterLAyout� ExitLayout� EnterStyle� ExitStyle 'J��� ��* WmlControlAdapter �HtmlControlAdapter '�" !�"B �" ��$� N/�� ������� 8���� 24�� � ������ � ��� ������� ��% 9L��� �, � $� ��, W�/�
��� ����� ./( !�" ��$� �� ���� ��14���� � �*� . ����� '<$� �,� ��14�� �* ���*�%��<G� C%��� ��%; ��" ������� �� % �� A�"��� �, �1� ������ !�;MobileTextWriter � �4�� % %��Style �� ��� B��9� ��9� �� �; :
writer.EnterLayout(this.Style); // can leave off the 'this.' for
brevity
��86/ ������� �� �" � EnterLayout �EnterStyle: ��� ��� ���J��� ��* ?��J�� �� �" 5� WML �� % �� '����� RenderText A�"��� �$� 3%9��� ��% 9L�a�� S %���
EnterLayout �EnterStyle. '��� �� % RenderText���� � ���� �/; ������ ��% 9L��� ��%; �" ���I��� T% �� A�"���� .
��-��� � � !�$,'�� � E �� C�%�\� ������ ���%��� 8��� �EF��� ��� T �� ��% 9L�: writer.EnterLayout(Style);
writer.EnterFormat(Style);
writer.WriteBeginTag("table");
�����( ?� �$, B������ 5� ��: writer.EnterLayout(Style);
writer.EnterFormat(Style);
writer.RenderText("table", false, false);
���( �<�7� : K%P�� !�" � ��� �/( T� � HtmlMobileTextWriter K%P�� !�" �� WmlMobileTextWriter �, .
�� �14�� �" '7$�� ����� K%@ '������ 5��b� 3��Style �-� ����-�� �� �"���� K%P�� �/( ��� D � '����� %4�$� Style.AligmnetKey� Style.BoldKey �Style.ItalicKey. K%P�� 8J�4�� � ��� ����-�� ./( '����� ��� Style ���
�P 4�� �,:
Alignment alignment = (Alignment)Style[Style.AlignmentKey, true]; % 9����-�� ���$��� �� F ���� �,���� F ����) False (� ����; !�;'����� %4�" !�" 3%9��� ��� ��� �� ��� 3��$�� ���� �/; ��� �
���� FTrue � ����; !�; % 9�,3��$�� '����� %4�" �� �-�%���� �� ���.
����� � ���� � ���"? ��������48�7� ���0���:
Universal Knowledge Solutions s.a.l
254
����� ./( � ��� �, �� �%��� 2 �%4�$�� �/�� �4�� 3���� ���J���� 84�� '��� %4�" A�9�; . ��-� K�%$��� �[� '���
����� 5� C/��� ��14 �, �/( '����� %4�" '����� � 1 � �".
H*� 84���� '����� %4�" '����� ������ ��-���CMTable: <%@ Register TagPrefix="CMcustom"
Namespace="MSPress.MobWeb.CustomControls"
Assembly="CustomMobileControlLibrary" %>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<%@ Page language="c#"
Inherits="System.Web.UI.MobileControls.MobilePage" %>
<mobile:form id="Form1" runat="server" Alignment="Center">
<CMcustom:CMTable id="CmTable1" title="A title" runat="server"
StyleReference="title" Font-Size="Small"
Item1Text="Simple" Item2Text="Table" >
</CMcustom: CMTable>
<CMcustom: CMTable id="CmTable2" runat="server"
Item1Text="second" Item2Text="table"
Font-Size="Large" Font-Bold="False" Font-Italic="True"
Alignment="Left">
</CMcustom: CMTable>
</mobile:form>
� T � ��� �/( � P9� �� �������� ���"G� 2�� ��* 3� ���� 3���0� ���J��� �"���� 2 %$� �* �� ��� Web.config '��� ��* W�/�<mobileControls>…...<MobileControls.
2���� ��* �,%$��� � � ��� ���J����� �"���� �� D%� 3� �� ���J��� �"���� 2 %$� 5� machine.config �����"; �,�*;�
B� �4���� ���J������ � ���� '����� %4�$�.
�� �� ��� � '��� ��$��� 8���<MobileControls> 2�� ��* Web.config�� ��� : <configuration>
<system.web>
<mobileControls
sessionStateHistorySize="6"
cookielessDataDictionaryType="System.Web.Mobile.CookielessData">
<device name="CMcustomHtmlDeviceAdapters"
inheritsFrom="HtmlDeviceAdapters">
<control
name="MSPress.MobWeb.CustomControls.CMTable,CustomMobileControlLibrary"
adapter="MSPress.MobWeb.CustomControls.Adapters.HtmlCMTableAdapter,
CustomMobileControlLibrary" />
Universal Knowledge Solutions s.a.l
255
</device>
<device name="CMcustomcHtmlDeviceAdapters"
inheritsFrom="ChtmlDeviceAdapters">
<control
name="MSPress.MobWeb.CustomControls.CMTable,CustomMobileControlLibrary"
adapter="MSPress.MobWeb.CustomControls.Adapters.HtmlCMTableAdapter,
CustomMobileControlLibrary" />
</device>
<device name="CMcustomUpWmlDeviceAdapters"
inheritsFrom="UpWmlDeviceAdapters">
<control
name="MSPress.MobWeb.CustomControls.CMTable,CustomMobileControlLibrary"
adapter="MSPress.MobWeb.CustomControls.Adapters.WmlCMTableAdapter,
CustomMobileControlLibrary" />
</device>
<device name="CMcustomWmlDeviceAdapters"
inheritsFrom="WmlDeviceAdapters">
<control
name="MSPress.MobWeb.CustomControls.CMTable,CustomMobileControlLibrary"
adapter="MSPress.MobWeb.CustomControls.Adapters.WmlCMTableAdapter,
CustomMobileControlLibrary" />
</device>
</mobileControls>
</system.web>
</configuration>
��L� <�7� �P 4��� '����� %4�" E� ���� 'J��� �� ������� ���F �:
<control name= "controlName, assembly" adapter="adapterName, assembly"
/>
������� 3���0� ���J��� 2�14 !�; �,�*; '����� %4�" 24 N��� �$ ��� 2�� ���%��� 8��� �/( ��*�(� '��
CustomMobileControlLibrary.dll> D � Q%$ 'F �� 2<device>3���� ���J��� �"���� .
W�� 3���0� ���J��� ��"����� 3� %, A��� A� "; !�; .����� �� ��� �� . A��� ����-� �, ������� �F ���� <�7�CMcustomHtmlDeviceAdapters �CMcustomWmlDeviceAdapters ��/�(.
/( � P9� ��" �4��� �� �9 �� �� !�" T � ��� ��� ��:
Universal Knowledge Solutions s.a.l
256
��"�� � �*��� � ����� � ���� � ���"? @�"
� �� 24 %��<; !�" %4�F� �/; ?��� ?�� 1� ��� �� B�� ���, ����� ./( %�" .A���� ���F N/�� '����� %4�" !�; ���" �/;� � B������� � %�4�� B �% '� �/; ?�� 1� H�4 �� ��� . �/� '����� %4�" !�" ��� �� A�%�\� '��� WCMTable .A�9�\� ���F N/��
���� � %�4�� 84�� '��� %4�" �% � ��" A��; � 1 � '�, ��,�( ��� �.
� ����� A�� ��� A�%�; 5� ���� ���� �%�� '"��: 1 X ���� �� �4���� �,�*;ICollection ./( � �� �*1 � ���� ��� %�4� ���� ����� '�� �4����DataSource �<,�����
=%�0� � ��%��� %4��$�� �, 3������� � ���� E� '���� !�". 2 X ���� �� ���� ��� %��4�� ���%� '"� ���%� �/;IListSource) K�%@� �-�DataSet �, ASP.NET ( �4�� �,�*; 5�
�� ��String '�� DataMember . � ��� �4���� ./( %�" ��� *" '��� ���� ���� �� B47��� '� � ?7-� ���������� ��� %�4� . ���� �� ���� ��� %��4� '"� '� �/( ����-� �,IEnumerable �4���� !��� �� B�� N� DataMember.
3; N� ���� �4�� �,�*\� 'F�� ���� ��� %�4� ��* 24 �� �� ��47��� '� ���� ��� %4��" .N��� ����-� �, %4�" '�����CMTTableDB � �4���� !�" DataTextField1 �DataTextField2 �(%��<; '� ���� %4��$�� ���� ����
��0� ���$�� ��*����-��. '����� %4�" N��� W�/�!�" �4���� DataValueField ���� '�� ���� � 1���� �� ��� ���� ��J���� �, %4�" ��� ��� ���� T � ���.
4; ���" �, 3������ ���� ��� %4��" 87��� �� B� �� ���� ��� %�4� 3A�%�� '����� %4�" '�� �DataTextField1 �DataTextField2 �DataValueFieldK%P�� ��* ��� ���� .B�9� '��� %4�" ��* ��J7�� %4��" CMTableDB
( ��� K�%@� �, %,���MobileListItem� �SelectionList �List.
5; � K�%@� � ���� '��� �� 5CMTableListItem ��* ��J7�� %4��" �-� N/�� Collection ����� �"�� �� 24CMTableDB �,��$� ���$��� ������\� H�4 �� �4��� �� �; ��4��� .� '����� %4�" E� ?�* � ����� �( ����List W���
84���� '����� %4�"CMTableDB� �4�� \ 'Items 3�"�����, K%@ !�; ��4��� MobileListItemCollection K�%@� N��� N/�� CMTableListItem.
Universal Knowledge Solutions s.a.l
257
6; '��� �� % ��DataBind A��\� � ��" K�%@� A��� '- ���� ��� %�4� �� ���� ��� 3A�%F CMTableListItem� W�� C%��;� K%@ ��* K�%@0�MobileListItemCollection.
�-� �� ������ ���%��� 8��� 24CMTableListItem��J7�� %4��" � ���� '�� N/�� . 24�� �� B1J�<� 24�� �/( D%
MobileListItem � �4���� �,�*\� '�� Text2���-�� ���$�� B���� N/�� %4�$�� � ���� : using System;
using System.Web.UI.MobileControls;
namespace MSPress.MobWeb.CustomControls
{
/// <summary>
/// Stores details of items displayed in the CMTableDB control.
/// </summary>
public class CMTableListItem : MobileListItem
{
// Add a property to hold text displayed in column 2.
private String _text2;
public String Text2
{
get { return _text2; }
set { _text2 = value; }
}
public CMTableListItem() : base()
{
Text2 = "";
}
public CMTableListItem(
System.Object dataItem,
System.String text,
System.String text2,
System.String value)
: base (dataItem, text, value)
{
Text2 = text2;
}
}
}
�, ������ 8��� ���������� ����� 24�� �� CMTable���� ��� �% '"�� : using System;
using System.Collections;
using System.Reflection;
using System.Web.UI.MobileControls;
namespace MSPress.MobWeb.CustomControls
{
/// <summary>
Universal Knowledge Solutions s.a.l
258
/// Custom control built from scratch using data binding.
/// This control inherits from PagedControl rather than
MobileControl.
/// </summary>
public class CMTable : PagedControl
{
private ICollection _dataSource = null;
private MobileListItemCollection _items =
new MobileListItemCollection();
private String _title, _dataTextField1, _dataTextField2,
_dataValueField;
public CMTable()
{
Title = "";
DataTextField1 = "";
DataTextField2 = "";
DataValueField = "";
}
public ICollection DataSource
{
get { return _dataSource; }
set { _dataSource = value; }
}
/// <summary>
/// Gets and sets the field displayed in the first column.
/// </summary>
public String DataTextField1
{
get { return _dataTextField1; }
set { _dataTextField1 = value; }
}
/// <summary>
/// Gets and sets the field displayed in the second column.
/// </summary>
public String DataTextField2
{
get { return _dataTextField2; }
set { _dataTextField2 = value; }
}
/// <summary>
/// Gets and sets the field stored as a hidden value.
/// </summary>
public String DataValueField
{
get { return _dataValueField; }
set { _dataValueField = value; }
}
/// <summary>
Universal Knowledge Solutions s.a.l
259
/// Gets the collection of items displayed in the table.
/// </summary>
public MobileListItemCollection Items
{
get { return _items; } }
//InternalItemCount and ItemWeight are necessary to
//support pagination.
protected override int InternalItemCount
{
get { return Items.Count; }
}
// This method can be implemented in the device adapter
// classes if the representation differs from device to device.
// However, an item in this control always takes up one line.
protected override Int32 ItemWeight
{
get { return ControlPager.DefaultWeight; }
}
/// <summary>
/// Gets and sets the title displayed on some WML devices.
/// </summary>
public String Title
{
get { return _title; }
set { _title = value; }
}
// Override DataBind method of base class to implement
// data binding logic.
public override void DataBind()
{
// Evaluate data binding expressions on the control itself.
base.OnDataBinding(EventArgs.Empty);
if (DataSource != null)
{
// Iterate DataSource.
IEnumerator dataEnum = DataSource.GetEnumerator();
while(dataEnum.MoveNext())
{
// Create new item for each data item.
CMTableListItem item =
new CMTableListItem(dataEnum.Current,"","","");
System.Type objectType =
dataEnum.Current.GetType();
PropertyInfo aProp =
objectType.GetProperty(this.DataTextField1);
Universal Knowledge Solutions s.a.l
260
if (aProp != null)
item.Text =
aProp.GetValue(dataEnum.Current,null).ToString();
aProp =
objectType.GetProperty(this.DataTextField2);
if (aProp != null)
item.Text2 = aProp.GetValue
(dataEnum.Current,null).ToString();
aProp =
objectType.GetProperty(this.DataValueField);
if (aProp != null)
item.Value = aProp.GetValue
(dataEnum.Current,null).ToString();
// Add item to the MobileListItemCollection.
_items.Add(item);
// Add the TableListItem as a Child control
this.Controls.Add(item);
}
}
}
}
}
�4���� '����� 5� Item '����� %4�" 24� CMTable �� % ��* Render������ 'J��� 24 �, ���" !�" %�%��� %4MobileListItemCollection��J���� ��* %4�" ��� C%��� ��% 9L� � ���� '��� ����� .
��� � 8���� 3���0� 'J���� 8�� ������ 8���aHTML(� 84���� '����� %4�$� �HtmlCMTableAdapter:
using System;
using System.Web.UI;
using System.Web.UI.MobileControls;
using System.Web.UI.MobileControls.Adapters;
using MSPress.MobWeb.CustomControls;
namespace MSPress.MobWeb.CustomControls.Adapters
{
/**
* HtmlCMTableAdapter class
*/
public class HtmlCMTableAdapter : HtmlControlAdapter
{
protected new CMTable Control
{
get { return (CMTable)base.Control; }
}
public override void Render(HtmlMobileTextWriter writer)
Universal Knowledge Solutions s.a.l
261
{
MobileListItemCollection items = Control.Items;
if (items.Count == 0)
{
return;
}
int pageStart = Control.FirstVisibleItemIndex;
int pageSize = Control.VisibleItemCount;
if (items.Count < pageSize) pageSize = items.Count;
String tableSuffix = "";
Alignment alignment =
(Alignment)Style[Style.AlignmentKey, true];
if(alignment != Alignment.NotSet && alignment !=
Alignment.Left)
{
writer.Write("<div align=\"");
writer.Write(alignment.ToString());
writer.WriteLine("\">");
tableSuffix = "\r\n</div>";
}
writer.AddAttribute("width","90%");
writer.AddAttribute("cellpadding", "3");
writer.RenderBeginTag("table");
writer.WriteLine("");
for (int i = 0; i < pageSize; i++)
{
CMTableListItem item =
(CMTableListItem)(items[pageStart + i]);
writer.Write("<tr><td>");
writer.EnterFormat(Style);
writer.WriteEncodedText(item.Text);
writer.ExitFormat(Style);
writer.Write("</td><td>");
writer.EnterFormat(Style);
writer.WriteEncodedText(item.Text2);
writer.ExitFormat(Style);
writer.WriteLine("</td></tr>");
}
writer.RenderEndTag();
writer.WriteLine(tableSuffix);
}
}
}
Universal Knowledge Solutions s.a.l
262
% Y� ����� � �?������� J / ���� �
'�� '��� %4�" N� '"� �� 5� �3% �� C%� � �� � �������14 !�; ' ���� � �: . 3% �� �"���� '����� '� �/\, �� E� ���� ��� �4���� � ��� '�� ��%��� '����� %4�"Paginate �� ��� !�; �/( '����� %4�" !�" N����� C/����� True� %4�$� ]���� 5�
����� ��9�9 !�" ��$ ��� '� ���� %4��$�� �� � J�� ��"���� �� ���� C%� ��%\� '������.
� ����� ���%��� ���14 !�; ' ���� '"� � ��" ��*��: 1 X 24�� �� '����� %4�" D% �� 5� PagedControl �" ?�� MobileControl. ������� �4� '����� %4�" !�"
� ���� � ����� E ������� �� ��� ���14 !�; 84���� ' ���� �, : � �4����ItemCount �D���� LoadItems. 2 X �� % �� 2 %$� 3��"\� '� ��� 5� InternalItemCount'����� %4�" ��* ?� ��� 3������� %4��$�� 'F% 3��"G . W�/�
�4���� 2 %$� 3��"; 5� ItemWeight�� �� ��� 3��"G %4�" �, � �� % W��� '� ��14�� ��" %� G ���� ���9�9�� !�" %��<G� ���� �� '����� . '����� %4��" �� '� � ��� �$��%��<G� �9�9 !�" .%��<; ��� ��������� '��
�4�� �" '��� %4�" �� �� '7$��� ��$�� %� ;ItemWeight .�" �� � $� ��F �/�� ��$�� %� ; '�� '��� %43���� %��<; ��14 !�; ��J�F %4�"�. ��� ���� %��<; % W��� 100 %� ; ������ ���� '�<��� ����� �� 3���
��14�� ��". ���-�� ��* �� ��� ./( ����ControlPager.DefaultWeight .�4���� � $� ItemWeight %4�$� '�����CMTable�� �/( �� F .% � � !�" ��$� N/�� ��J�F %4�" ��� ���� % W��� B��� ���-.
3 X �4���� � $�� ��14�� ��" %� ; '�� Control.FirstVisibleItemIndex � �4����Control.VisibleItemCount �(%��<; 5� ���� %4��$�� ��"� '����� %4�" .%�< �� 5� N/�� ��0� %4�$�� ����� . 8��� !�" W�/� 5�
'��� N/�� ���%��� �� % �� B������ Render '� ���� %4��$�� � ���� �����$��� ./( '��� �� ������ 'J��� 24 ��* C%��� !�; ����%;.
����� 5� C/��� �" H %4��� '� '�����/( '����� %4�" :
<mobile:form id="Form2" runat="server" Paginate="True">
<CMcustom:CMTable id="CmTableDB1" runat="server" />
</mobile:form> � �� % �� ��*Page_Load '� � 1���� �, ���%��� 8��� 24 H*� ��� ��� ��%��� '����� %4�"� �,�14��� A��� :
public class MobileWebForm1 : System.Web.UI.MobileControls.MobilePage
{
protected System.Web.UI.MobileControls.Form Form1;
protected CMTable CmTableDB1;
private void Page_Load(object sender, System.EventArgs e)
{
// Create large array to illustrate pagination.
ArrayList array = new ArrayList();
array.Add(new TeamStats("Dunes",1,38,24,8,6,80));
array.Add(new TeamStats("Phoenix",2,38,20,10,8,70));
array.Add(new TeamStats("Eagles",3,38,20,9,9,69));
array.Add(new TeamStats("Zodiac",4,38,20,8,10,68));
array.Add(new TeamStats("Arches",5,38,20,6,12,66));
Universal Knowledge Solutions s.a.l
263
array.Add(new TeamStats("Chows",6,38,17,10,11,61));
array.Add(new TeamStats("Creation",7,38,15,12,11,57));
array.Add(new TeamStats("Illusion",8,38,13,15,10,54));
array.Add(new TeamStats("Torpedo",9,38,14,10,14,52));
array.Add(new TeamStats("Generals", 10,38,14,10,14,52));
array.Add(new TeamStats("Reaction",11,38,14,9,15,51));
array.Add(new TeamStats("Peanuts",12,38,13,10,15,49));
array.Add(new TeamStats("Caverns",13,38,14,6,18,48));
array.Add(new TeamStats("Eclipse",14,38,9,15,14,42));
array.Add(new TeamStats("Dragons", 15,38,10,12,16,42));
array.Add(new TeamStats("Cosmos",16,38,11,9,18,42));
CmTableDB1.DataSource = array;
CmTableDB1.DataTextField1 = "TeamName";
CmTableDB1.DataTextField2 = "Points";
CmTableDB1.DataValueField = "Position";
CmTableDB1.DataBind();
}
class TeamStats
{
private String _teamName;
private int _position, _played, _won, _drawn, _lost, _points;
public TeamStats(String teamName,
int position,
int played,
int won,
int drawn,
int lost,
int points)
{
this._teamName = teamName;
this._position = position;
this._played = played;
this._won = won;
this._drawn = drawn;
this._lost = lost;
this._points = points;
}
public String TeamName { get { return this._teamName; } }
public int Position { get { return this._position; } }
public int Played { get { return this._played; } }
public int Won { get { return this._won; } }
public int Drawn { get { return this._drawn; } }
public int Lost { get { return this._lost; } }
public int Points { get { return this._points; } }
}
}
� $ 9�� B�9 ?��%� % P4 ����� ���� !�" 24�� �/( ��:
Universal Knowledge Solutions s.a.l
264
B�� � �������OnDataBind
84���� '����� %4�" 24 !�; ���" D���� �,�*; ����� .
���� ���� � ��%��� � � ��� '����� %4��" %,�� D����ItemDataBind 84�� �% T � �� B������ %� ��� ��� N/���
���� ���� .����� N/�� ����-� ��* B������ �� ���� �� W�/� 84���� '����� %4�" CMTable .
D���� '����ItemDataBindD���� S��$�� '�" � ��� �" H %4��� 5� . 8��� 2�� ��* � ����� �/( �" H %4��� ����� N%�4�����"24�� 2 %$� C%�� ���� A��� A�*, �" H %4��� :
public delegate void CMTableListItemEventHandler(
object sender,
CMTableListItemEventArgs e);
…..
���� �� ���$� D���� S��$� /�L CMTableListItemEventsArgs( ��� �� B1 %$� '� D ��� ��: public sealed class CMTableListItemEventArgs : EventArgs
{
private CMTableListItem item;
public CMTableListItemEventArgs(CMTableListItem item)
{
this.item = item;
}
Universal Knowledge Solutions s.a.l
265
public CMTableListItem Item
{
get { return item; }
}
}
D���� �" H %4��� 2 %$� �(�$� ����� ItemDataBind '����� %4�" 24 ��* CMTable: // Declare a static read-only object that will own the list of
registered
// event handlers
private static readonly object EventItemDataBind = new object();
public event CMTableListItemEventHandler ItemDataBind
{
add
{
Events.AddHandler(EventItemDataBind, value);
}
remove
{
Events.RemoveHandler(EventItemDataBind, value);
}
}
TJ�% �� '��� D���� �/( �� <�7�MobileControl.Events.AddHandler �RemoveHandler.
���$� T% ����� ������� 5��� ��� � � %� � E � �/( '����� %4�" '������ D��� �44���� D���0� ��ItemDataBind. �� % �� '����� '� OnItemDataBind%� ��� ���" ]%4 ���� D���0� �����$� A�"�� :
protected virtual void OnItemDataBind(CMTableListItemEventArgs e)
{
CMTableListItemEventHandler onItemDataBindHandler =
(CMTableListItemEventHandler)Events[EventItemDataBind];
if (onItemDataBindHandler != null)
onItemDataBindHandler(this, e);
}
�� % �� A�"��� ����� ?�% ���OnItemDataBind �, '� 3%� �� �� , K%@ A���CMTableListItemA��-� %4�" 3A�%F
'�����CMTable���� ��� %�4� �� �����$��� .
K%@ A�9�; 5� CMTableListItemEventArgs �� CMTableListItem � �� % �� !�; .% %��OnItemDataBind. ./�� D���� S��$� �� % '����� %4�" �"�� �� % ��OnItemDataBind���" H %4��� '� ���� �� � ����; %,� ��� � ��" 8 4�
���� ���� �%��. public override void DataBind()
{
// Evaluate any data binding expressions on the control itself.
Universal Knowledge Solutions s.a.l
266
base.OnDataBinding(EventArgs.Empty);
if (DataSource != null)
{
// Iterate DataSource, creating a new item for each data item.
IEnumerator dataEnum = DataSource.GetEnumerator();
while(dataEnum.MoveNext())
{
// Create item
CMTableListItem item =
new CMTableListItem(dataEnum.Current,"","","");
// intervening code not shown
// Add item to the MobileListItemCollection of the control.
_items.Add(item);
// Add the TableListItem as a Child control
this.Controls.Add(item);
CMTableListItemEventArgs e = new CMTableListItemEventArgs
(item);
OnItemDataBind(e);
// After any ItemDataBind events have been called, the
// DataItem property has no purpose and is not relevant
// on postback, so clear it.
item.DataItem = null;
}
}
Universal Knowledge Solutions s.a.l
267
�3? S��� � ��� �:
� ���� � ���� � $���������# �
������� � ����� � : ]��1�� �� ��%��� �% 19� ������%� N% ]��1� �'�" ]��1� �8�� ]��1�
����: ���b� � �0� ��� ����� !�; ����� '- ���: �J � A��� � ��" �, ����� ���� � �0� �������� !�" 2%$��� ����� ./( �, 2%$��
��� .����� 5� �����. ���0� �� ��� K$� � P� 2� ?�% ����� �, ����"�%� 5� ���� # ����� ������ � � �, ���0� !�" T�"� ��9� 2%$���� '���
������%���WAP ����% ���� ���9���. ������� ��!�:
!�" �41�� �/( �, 5�� �� 2%$� : € ���[� �J ��� ������
€ � ��0� % �����
€ ���0� �� ���
€ =%�0� ���0� # ���
€ ������%� �, ���0�WAP
€ !�" ���0� ��� � � ��<�7�T � ��� =���
Universal Knowledge Solutions s.a.l
268
O���$�7�
��I��� �, �������� ��� � ���� � ���� ���0� %4��" �9F��� ��F�� ���0� j���� �" �$ % ����� K�%$�� �� �B�� ���. �0� ��� ����� !�; ����� '- ���: �J � A��� � ��" �, ����� ���� � �0� �������� !�" )7 �� ���� .����� 5� ����� ���b� �
��� � 2� ?�% ���� P� ���0� �� ��� K$� ������ � � �, ����"�%� 5� ���� # �����.
�"�: �0� @�3"/: ���� !�; ��4���) �� ��4��� ��� !�; � ��� (��I��� �, ��4��� �$ � W�/ �, ��� ����� �J ��� %���"� � $� /�L� �� 5�
��� ������������ T � ���� ��� �� . ���* �; ����) �� ��4��� ��� !�; � ��� ( ���* ��$ ���������� !�; �%��� �� %���� ���� !�" ���� ��� . �/( !�; ��4����
� �0� 2��(0� �� �"���� T ��� �� �� ���0� �� )������(: 1; ���8 � $� >��� �: �(����-G E����� A�%�G�� 8�9�� ��� �( �I����� �� ��"h�� ��. !��0� � � � !�" � ��7�� ����9�� �, � ��$�� ./( '��
T � ��� ��� � ��-��� ���9�� ��� . B��4� !�" ��,����� ��F '������ � �( �� T����� ���9�� 5� �� . ������ !�" ?�����"� ?� ��* � ��$�� ./( '���� ��� D �
��� ' �������1���� �� ��� '������ ��41�� 3%�4�. ������ � � !��0� � � � !�" ���� � � ���� �� T����� � ��" %��$�, T � ��� � � !�" ����'����� � � � ��-��. ��4���,
�I��� ���� � !�;�h� �� B�L� '����� ��- �� ������ !�" 5� � '������ H� �� ��F �F��� #1� �,� ��" ��%�� '��������� T � ��� !�; B� �( %�< �� '����� !�" 5� B� ��4���. '������ '� '����� �( ��4�� �� T����� T% �� �;� ?����� %-�0� T% �� ��� %�%��� ����� �����9�� ��*��, ?�� �$�
� �F%�����F%�� E F����.
2; ��"�� � ��#� :
��� ��7 �� T����� �;� ��� �$� '� '� ���� ��� �L� ��L��� ��$ ���� � �%��� � � ����� A��-� �� % NL� ��*�%�"��������� . )������ %����� � ��� E� ���� ��� % 19� '������ K%P�� �/( !�; ��4��� ��� CheckSum� � T����� ���% ��%MAC
� T � �� ���%�� ��* �����$��� ./( % 19� '� D ��� �" �4�� � ��%�� . '� ������� ��F �� ���%�� ./( ������ ��"� 5��MAC � a�� E� B��%���MAC������ � �� ��L��� ���%�� ��* %e19>��� . B�� �� ��L��� ������� E � T�� ��� '� �/;
���%��� D�$�� '� '�� % @ �������$� ���� ���%�� ���(; ������� ��� , ;�� �4.
Universal Knowledge Solutions s.a.l
269
3;���� � : ���0� ����� '(� ��� �( � %�� . ��F �� ��� I% ��� B�L� ��L���� ���� ��� � 4�4� !�" �<,����� �, 8���� �(�
'�� 5�@%� % @ 2�% �. ����JG� ��F� � �����$�� ����� �����$���� ����� �� ?����@ '�, '�<��� �, ���0� �" 8��90� '��� ����" �7����
�J �� � ����� N�/ 8��9b� � J%� ���� �� 5� ���� �� �4�� . N0 3A�%�� % @ H�4� D �� ���� ��� % 19� � ��" %��$�������� �/( �, ?�"� 9 %-�0� �� % �� �( B �" 2+%��$>��� ��" 8�9.
4;������ � :
�� '����� ��4��� � � � ��� A�%�; �" 3%��" �(�/( T��� $� ��$,L� '� ���� '������ � . 3� �9 ?3��" � ����� ����B� 3������ �� ������ .� ��� '� !�� '���� � �( �� T����� '� �� ��, �� ���� �� T����� )�*��� T�4��� . ?3��" N%�
��4���� '����� HJ��� !� �� '�����ACL�� ����� � ��� �, 3�"���� . � � � !�$, =%�� %��4�� '�<��� % ��� �, ��� ���� ���� ��� %�4� �� 3A�%��� T� � ������� E �� W��� �F ���-��
B , �������� ��4��� T� W���� �� �F�-��.
���"9� ��?: � ��%�9� ���� �7F����� �" ���I� 2�% 0� �$� �, %���G� '�" 8��� ���� ���F ." 2%$��� � ��$�� ./( ��*�� !�
� ���%�� �%� ����\� B�� ��$ ��� �� ��F��� �, '���%�9� %���; ?��� �� , '���� �� % � 2�% 0�� 2% � � �L��� ������� �?7$, ���%�� ./( �%� �F �%��� �L� D��-����%�� ./( #1� '7��� '�F �F ������� �L� . '����� �� �� ��$�� �/�� '� ���
� E F��T�-�� D��- 2% ��F �� ���% �� E� B�� T����� ��� ���� '��� ���%���.
��"�7� �*��� �
%��$�� ��$4 � ��" ���� �� A��� � ��" �(/ 1�� ��� �� % ����� !�" ��*�� 3%�4�� 2%$��� ���������. � � �� 3%�4� ����� ���� ��� ���� A��,� ��� /���� �� �� �� ��� ����� % ����� �* ���7�� �� �:
���8 � ����"�:( �� '�<� !�; ��4� !�" ��4��� � ��" �" 3%��"��� '���� B�L� %(�<���� �� T � � . �� '������ ���� �/\,
� 3%��� ������� A�9�; B����\� H�4� '�<��� !�; ��4����4��� � ,�*; �����$� �" '7$�� ��*%@ ��� �F �J�% ��'�<��� ��* !�"� � ��� !�" . '������ 8�9�� � $ B�0 ��%��G� !�" ��0� �, � �� ���9� � ���� ������ %��y �/�
�"� ��� '������ ���� E� �� �� ���4� '( ��� � �?7-� W����� T�-�� %�4�� ���4� '��L� T � ��� ������ '�� ; � ����;�$� !�" ��4��� �, '������ ���( ��������.
��"� � :
���9�� %�" ���� ��� T,�� ��F�%�� '���� � �: �" 3%��" �( .3� � K�%@0 '����� �� � �[� ./�� ��� . ���" � ��$�� ./( ��%� �%� % @ 2�% 0 ��� �������� �� �" %�� �� ��� )���� '� D �� ���9�� !�" ���� ��� ����� % @ g� � ��$� � 4
� �I��� '�<�� =/L� 5����� '�� H�� ��� �����$� !�" ��4����T � ��� �������.
Universal Knowledge Solutions s.a.l
270
?7� ��� �4���� ����0� !�" ��4��� ���� ���� ���0 3% � �4���� � ��" %��$�. W1�� ����F % @ % 19��� � ��%��� �� �� ��L���� ���� ��� % 19� � ��" �, ���� ��� )����G� %�F( 29��� ���-��� � � !�$,
% 19��� �L� � ��7�� ����9�� ������ �� % -���WEP���� ��� � ���� ?� ,�� # � .
B� �: ���� ���� D�$��)���� ��� ��7 � ��� ?�* � !� � ((���� � �40� ������ �� ���� ��� !�" � �$��� � ��" . ./( ��*�� �� ?����@
��%; K�%�"� � ��$��� '����� !�" ������� ���� ��� !�" D��� �� ��� ��� ���� ��� �������. � �40� ���� ��� ���� !�" 3��" ���� ��� % %�� '� .
� ���� �� T����� �� ��" %��$��� ����� �/( �� ���� �J�� �� � ����� �� T�����.
�<�� �: ; ��������� ������ �, ��4L�� ���9� �F%�� %��$�B �" ���� �F �����$� N� �F% �" �� ������� �F% �" �, '���� / .
���� ���� ��� !�" N���� ����� ��/�� ������ 3���� !�" ����$�� ��� � ��� ���� �, ?�% �� ?�� ��� ���9��� ./( ��9� �� ��� ����� � �L�� � ����� �"����� !�; A����� 5� W�/� �� % ���� �� ?����@�������� ���:
1X ���� ��� !�; ���� ��4��� E��� %�%� ����� '���� '� �� �� �%�� ������ ��1F;. 2X ������ !�" T � � N� !�; ������ �" � ���� �� T�����.
3X ������ !�" %�%��� ����� � ��� '�".
4X � ��� � �� N� !�" �����$��� % 19�.
5X ��0� ������� ���$�� ���0� ��� � ���������� 3�.
$��7� ���"��
./( �� � ����� �������� �� ����� '(� K%$�� �������� ������ �, ���0� ���� �� ��� ���� % ����� !�" )7 �� ���F �� �$�
% �����:
��������"�� � @���/: ���� ��� ������ ��4��� � ,% � ]���� !�; ���� ��� A�1�;� � �$� 2���B��%; N%� �� '�, �� D��- 2% E�� ��9� .
� ���� �� T����� ��*� ��� ���� ��� ��[� ����� ����� E �� E� ���$�� ����� ���: �J � �, � �0� ���� ���� ��� � ����� ./( %��$����%���� E F�����.
�� �� ?��� 3��$� � ��" ������ �� � � �$��� � ��" j���� %��$��3% ���� �������� ��� � ��� ���� �, 8�0��� � ��$�� � ���.
����4���� ������*� �� �������� �: �� � 3�" �, � �$��� ��$� .�� ��%����� � � �( � ���� � ��� . ��� %����� � ��$� ���� ��� ���%��� �� ��%����� ./( 24�
%�: !�; T �� �� ���� ��� � ��� .�%��� ��� ��*� ��� % 19��� �$, / 1��� '��� ���� � J�%�_� ������ 2 4���� �" %�$ , �����
Universal Knowledge Solutions s.a.l
271
� ��$�� ./( A��-� �4� �� ��� j%� N� ��� ���7�� �����$���. !�; �����%� 3%�%*��� ��$ 3����� % 19� � ��%��� '����� �0 ?��� '�( ������%���� % 19��� � ��%��� � � � ���� �;
H ��1��� ����� !�; �,�*; ���� ��� ��� B��" ��*� � ����/ ��� % 19��� � ��" �� %-�� �" ��I� ������%���, �� � ������%�. ��� !�; ��� �F B��/ ��� T � ��� �0 ?���: ?�� � � 3%�%*��� � ��� ������%��� ��$ � �������%��� � � T�, E*���, ��� � ��� ���
2$*��9�=%�� ��� ��.
��"�� � ���3�: % 19��� %��$> ( ���� ��� A�1�; � ��" N� 5�F� A�%�;� ��� !� 3A�%��� ���F % @ �� !�; H %4�� 8��� !�� ���� � �"����
�� �; ��4��� �� � 4�%� % @ 8��9� ���� ��" !�� ����� ���� ��� � 4�4� !�" <�1���� H� ��� %19��� 8���. % ��% 19��� W, !� A�%�; '������ ��40� C/����� !�; ?����� ��� ���� �( ���� ��� 3A�%F �� ������ 3� ���� �� . !"��
� � ��%����� % 19��� W,� % 19��� �� % �3%1 9��.
H*� % 19��� ���� ������ ��9���84��� N� E��� %19� ��9� ���" ��� 3��F %�" �����$��� ��� '� D � '�, �� ��� !�" ����%; '� ���� ���� ���.
���� ��� % 19� W,�% 19� � ��$� '����� H ��1��� �- ���� �� ��%����� '���� . N/�� '������ ; ���� �� �� ���% % 19� ��$,%�� ./( % 19� W, �� 5����� ]��1��� ��� ���. 1��� !�" � ����� % 19��� �� ��%��� 2�4�� "�� !�; ]��: 3%<������ % @�
3%<������.
�� ��%����� '����3%<�������J�%�� �� % 19� W,� % 19�� � �� ]��1� . �% '- ��� ���%�� %19 � ]��1��� �%��� '��� 5�� ��� ������� !�; ���%�� .���%�� % 19� W1� ]��1��� #1� ������� '��� ���%�� '7�� ��".
� ��� � ��" ��F ?7-� )������ �� ������� � � % 19��� ]��1� ���� ���: �� % ��� ; ��" � � ��9� � ��%����� ./( ��$
Universal Knowledge Solutions s.a.l
272
���� ���. %9��� ��9� � ��%� % @ 2�% � � � �� $��� ����� !�; %�% *� ��" 3% �� ���9� %�<� 2b� . EF�� ���� �-�� ���� ����� � ��%���� 3%��� EF���� �/( �� A�%9�H�4� D �( % 19��� ]��1� ����� � ��" �B��/ ��� ���9�. � ��� !��
% 19���%<������N%�� ]��1��� % 19� ?�* � . ���� ��� �� ��� % 19��� �( �� % �� ./�� ?�"� 9 C/����� %-��DES .���� ?����� %-�0� �� ����� �� � �$�� % � � �(�$� '� �F�
9��� '������ �� ��� % 1AES � ��%��� !�" ������ Rijndael � ��� W�/� DES3 � � ���$�� ���� ��� % 19� � ��%���IDEA �Blowfish � �� ��%��� �"����Rivest �RC2,RC4,RC5 �RC6.
��-����� % 19��� 5�9� ���� � �0� ���9��� ����� �-������ % @ % 19������ ]��1� '����� �(� . '�" �,1975 �����" '�F
��(Deffie �Helman% 19��� W, �, ���-��� % 19��� � ��" �, ��0� '��� � 1���� � ���1� '������ �� % � �� . !� '�$�� ]��1��� % 19��� �, '������ ]��1��� .'�$�� '����7� ���: % @ ����F %�" ���" 3%�4� ]��1��� �/( E ��� '� .� ��� ]��1��
8���� ]��1��� !� , % 19��� W1� '������ . % 19� W1� '�� N/�� 2% �� ��F �� �, 5�� � B�0 ]��1��� �/( ��� '� ���� ��� ..���� 3� �� E����� 3% �� � ��� ���"� !�" � ���� ���* ��9� ��4�� H ��1��� ./( ���� . % @ �� � ����� ./( �$��
� ?� *� % N�����'�$�� ]��1��� �� 8���� ]��1��� 5� .
�� � H ��1� !�" � ���� % 19��� ��<�� K$� T�%��� ��� 64 �-� ��DES %����� ������� W�/� 3����� 5 %���� '������ ������� �� �%��� ��� ; � �� ������� ������ E ��.
$��7� ���"�� :���<� � ����83 �
�F%�� �����9�� %,��B�-� N/�� 2% �� !�; ���� '�$�� ]��1��� ��� ���*� �� % � . �/( T��� ���� %�0� T����� '� �� 5�
� "���� ����� �-�� ���� �� ��L��� 3���9�� �� ?�* �)� 8�9��I�.(
�����9�� H�� � � !� D��- 2% !�" ����"�� � ��$�� ./( '��Certificate Authority.(� �� �����9�� H�� �� � ' �-� ���%9 ?� ���"VeriSign� Entrust �Certicom.
������ !�" 3��" � �F%�� �����9�� N����:
X 3���9�� ���� '��8�9�� �/�� 3� ���� �����$���. '���� �� ��� %�4��� ���� �" ?�* � � ,�*; �����$� ��*�� �F 3���9�� ./( '��� N/�� 5���� %��� ����"B� 8���� �.
X 3���9�� ����� 84���� '�$�� ]��1���.
X 3���9�� ./( �%�4� ���� �����9�� H�� � � '�.
X 3���9�� � �74 3��) � ����� g %�� 3��"�� �����.(
X ��F������ D�" � ��" '�� '� B�� �� T����� �����9�� H�� � � �� ��F% E F��.
3���9 E F�� %� � ��������� W�� W�/�'�1�0 �����9�� ����� � � ����� D �� '�1�� � �F% . �� ��� �,�*G� 2% �� �/(
( ��� �/; ?�F�-�� %��$ �T�-�� ]��1�� ?�$F�� %�[�. �� �� % �� ./��� � �0� �F�-���� � ��� !�; ��4��� 3���9�� �$���� %�%���
Universal Knowledge Solutions s.a.l
273
3���9�� ./( H��� ���F ������� ���� %��$�, ;�F�-�� % @ ���.
T ���� �����9�� ./�� � %� $��� ��� ���� '(� ��X.509D � ��%��� ��� � � ��* 3%��9� �����9�� ./( %��$� . ��* ��� !� � �F%�� �����9�� �� %�: )�� '��� , � ��7�� �� ����� ����WAP Server WTLS Certificate %��$� D � ./(
�����9 �����9�� �����9 �" 3%4���WTLS) ����� ./( ��* ?��� �(%�/ !�" ��L� ����( � %� $��� �" � �� ��� �(X.509%� $��� �0 �(I�9�; '� �����9X.509� ��7�� ��� � ��� �$ � E� 5���� 3% �� . �����9 '����WTLS �, 3��" ��� � �WAP�( �� T����� N%P4�� K%$���� � % ����" '��� � WAP � '������ ���� ��� % 19�WTLS.
$��7� ���"�� :%�<� � A�<�� �
> �"���� �%��� �� �$1��� ��� �F ���%�� ��� �� T����� ��F%�� E F���� '���. ��� u9�� �� �� ���� !�" ���� E F���� �/(
8���� ]��1��� W�� E F���� D ������ '������ B�� T����� ��� '�$�� ]��1.
EdF�����" �����$� E� ����� '- �� -��� 8 ���� ��F%�� E F���� A�9�; '� � ���� '������� � =%�� �����$� . �� -��� �� �1 � '�� /�L� '�� E��� �" 3%��" �( 8 ����� � ��")���%�� (� !"� ���- '��� C%� � ����$� �� . % 19� �(�$� '�
���� �����$��� ./( % @ � ��%��� '������ �%��� ��F �� 8�� ]��1� '��3%<��������� . E F���� ������� 3%19��� ������ !�����%�����.
�$� �������� '� N/�� ���%�� ��� -��� ��(�%�� ������ �-�� �� F �" 3%��" .� �� -��� � �$� '� �/\,� % P�� �� % NL� ��� D�$��
( �� F�$� �� ./ .
/( S��� �$� �� . ���%���� E F���� � �� �,H�4 ���%���� E F���� A�9�; /�� �� -���� D�" � ��" N� 2�9��� ������� ����\� .
��� � Z����� ����� � ��" �:
� '�$�� ]��1��� � ����� � ����� 5 !� ��PKI( � '<��� �� ����� ��<�� 24 N/�� % �$������� �"������ �� ���� '�<� 2Q%$�� � .
��" �"���� 2Q%$��IETF X.509 �8��90�� ��� ��%���� ����4�� ���� ��� �"���� ���� !�" '�$�� ]��1��� � ����� � ����
'�$�� ]��1��� � �$� !�" � ����� �����9�� K,%� �E ���� �� ���� �3%��;� �A�9�G ���7�� ��A�%�G��.
��*��PKI����� � ����� ���: X � %��4; � ��" �" ���I� �����9�� ����� �� �������9�� K,%. X �� ���� � �( E� ���$�� H ��1��� �% �" ���I� � �� �� �. X ������ ��%���� TJ�-��� E F��� �������� '�����\� ����� '�� �����9 %��4; '� � /�� �����9��.
Universal Knowledge Solutions s.a.l
274
X ���9�� �����$� � ���� � ��� E*�� 3%��4�� ���� ���� �; '� ���� W�����*,%. X ��<���� ��� B���� ���0� ���� ���� �� .
��"��� $�Y� ��" � %& ������� � ����0� � ������� � :
������ $�Y� S�� � ��* SSL (Secure Socket Layer):
��� �������� ������ ������%��� �� ������%��� �/( %��$ ��%��� !�" ?� . ��%9 ��F �� .% � � '�Netscape ���� � �L��
�4�� ���:�(� ������%��� T�, � �� 3%�4� '���> HTTP ���� =%�� ������%� T�, '��� �� ��� B�� ?���" FTP. > �/( '��� ������%��� �� ��%����� �� S ��3%<������ % @� 3%<������A��0� E,%� .
W��( ��� ��* � �� ���%� E�%� SSL�( : 1 X 3%1 9�� !�" K��1���� ��,�4���:� �� ��%����� !�" '������ ������ �� �� T1� D � �9�� �������� 3%1. 2 X � ���� �� T�����: D � � �( �� T����� '� '����� )������� �1 � ��9� ( � �F% 3���9 '������. 3 X ]��1��� �����:9�\� ������ '�� N% ]��1� A��'�$�� ]��1��� % 19� '������ '����� !�; B�% . % 19� W1� '����� '��
8���� ]��1��� ���$��� ���%�� . 3%19� �����$��� ��%;� ����� � ��� !�� ��4��� '������ ������ ���� �/( �$�N%�� ]��1��� '������.
4 X T � ��� ���� � ����� : # L� '� �� �� ������ � � 3%19��� ���� ��� �F��� '� �� ��� ?� �-��� ���: ����'�����.
���$�� ��� SSL�������� 3���0� �� � �$�� ��F �� . ��$�� W��� � ��� W��� SSL�� '� %��< �� '� �����%� https �" ?�*�" http�� ��� %�4��� ���� � ��� �, . � ��* ���� ��� % 19� �;������%� �, ���� ��� % 19� �� � ��$, %-�� � '������ ����%;HTTP�� ��* % 19��� � ��" �0 �����%�
�� '������ ����%; '- ���� ��� % 19�� ��F �/; ��� ������ =��� !�" ���� ��� % 19�� '��������%� � �� % 19��� W, E ��� ��, �� ���%��� �4���� '���� E �� ��4���%�.
��" � ��* $��� ������TLS (Transport Layer Security):
�$ TLS �� � ���� � ��� �����%� SSL� ��� �� ���� D � :���� ������%� ��� �( !��0� ��� ��Record protocol
/ ��� ������%� ��� T�, 3��" E*�� N/���� ������%�� � ��" � ����"�TCP. ��� �� ��� ������%� �� � �$�� TLS ��,�4��� ������%� ��� ��, Handshake . T����� '������ ��[� ��4�� ��� �� ./( %,��
/ K��1� � ���� �N%�� ]��1��� !�" K��1���� �3%<������ � �$��� ��$� N/�� � ���� ���� ��" � ����"�. �, ����� �( ���SSL a, TSLN� 3%� 9�� �" ����� ��%1 9�� �� 2 '����� E �� .
'����� A�%� � �0� 2��(0� ����TLSE���� � ����;� ��� ��� � P9��� � ���F� �% 19��� ���� �, .
Universal Knowledge Solutions s.a.l
275
������ %���# � ��" � ��* $��� WTLS:
WTLS %� $��� ��* �,%$��� ���0� ��� �( WAP .� ������%��� T�, ��$ Transport Protocol Layer ?����� B�$� ��� %��� �� � �$�����=%�0� � ��7�� ��� . �/( B��9 ������%��� �������%���TLS � ������ K%"� ���$�� % �L��� ��� ��/ ����9�� !�" �*,� ��9� ��$�� B� �� '� ���
T *�� .4��� � ��" � �-��� ���� ��� '�� '"� ��� � ������%��� �/( 2 * W�/�]��1��� D ���� ��,� . �����9 '����� '"� W�/�WTLS'����� 2% �� � ���� �� T����� .
�������IP Security) IPSec(:
%� 2��� ��� ���IPSec ������%� ��$� � � �,� T � ��� ��� �, ��$ B�� �, � F���� ������%��� �" SSL �TLS �WTLS ���9 !�" ��: ��4�� � �L�� B��� ���: % @IPSec���: ����/ ��� ��%��� �$� !�; . �"� IPSec � 4�4���� ����� ��� ��7 �� ���� �� T��� ����� % ,�� �, �/( ���� ��� ���� ��� !�".
2����IPSec������� 5���� 3���� �J��� �������� 3���0� � � �� � �� 3%�4� . )���� E % ��9�� ���� ���� 3���0� !�" � ����� �4���� � *�%�,� ����9�� '"�� �1������ ��������IPSec.
�� �/( '����� %�9��� ���� �����%� '"� E� �����%� IP6 ��* N/�� IPSecB� 8���� %� $��� �� A��� . ?�* � '���� �� �� �,%$�IPSec '"� TCP/IP � '"� WAP.
���� $��� S�����
0� 5� ��0� � � E,%� �� ���� '���� ���� =%�0� ���0� # ��� �� � �$�� ������� ���� T � � ��" ?�* � %���"� � $� /�'�<��� '�$�� .�( �� ����� ./( '(�:
����" � $���� �:
( �� � � ���9�� �, ?����� ��%���� ./( ��9�� 8���'�" .���� �� �"���� �" 3%��" %���� %��� '� �� 3��" ���� �� ��% ����9�� �, � ������� �� �4���� ���9�� %��4� !�; ��4��� � �� � �0� B�1 <� ���� �41�� 3%�h�" '��� !�" ��$ *��
=%�0� . ��* %��4��� � ���� N%�� %��� 5 �%� N%�%*�� �� ��� ��%��� %�" �I��� !�; ��4��� � ����; � �-� ��" �I��������� E � ���� %��4���� '����� ��� ����� �; ��4��� �����9. 'J�� ��4�� W���� ���� �������� ��� ����� ������
3� � 3%�, ������� ������ !�" �4�9 %�� %��� ���� ��9 .
���� � ��=���&�� ���3 �VPN: ����9 H��VPN ���" ���9 � ���� )��%��� 3��"(�� ���9 !�; �4. �� �$� �" ����$ � /�� 8��90� � ����� ./( ����
��%��� %�" ���: �� % � �I��� ���9� ��4��. �� ���� #1� !�; ��4��� 3%�I� �4�� � � !�" ��4��� 8��90� AI�� �� ��� � ����� 3/( ���� ��F. � ��� '����VPN
Universal Knowledge Solutions s.a.l
276
����9 �, ��0� ���9� ������WLAN.
>��� �$������ J�? %"� � ���8 � $� : � � ����� �7F����� E� ���$��� ��" 3��"�������� � ��� !�" � ���� �� T��� � �: !�; ��� ������ ���� #���� E�� �� ��/. 8����
� ���� '������ ��� �� 3��" � ���� �� C���� T��� � ��" �, %�%��� !�; � ������� ���� �, �� % �� ./( !�; �,�*; ?7-� %�%���� �� ��" 3���� 3%�� % ���� � ���� '��� �F� �� '������ W7��� . 8��90� !�" ?��� 5$4�� �� �$� � ���$��� � /( S��
'�<��� !�; ��4���� � 4�%��� % @.
����� � S����� �: 4��� � F%����� ��� � ���" !�" ������ � ���� �� T����� '������ !��'�<��� !�; ��.
(� � ���� �� T����� �� =�F� C/���� %�� ���� ������ ��� �/( �� 8������ ���$� ���� W�� �-� � � ��� # ����� !�" ������ W�/��4����B���� ��9 !�" 2%$��� �� $�� � ��F ��9 ���4�� !�" 2%$��� ... �1, � ��" % @ ��� ����"� �� T% �� ./( ���9� g�;
-��� u ���� K,%�� !� �� !�; N�I� �� �0� �� % �������� � 4�%� 8��90 ]���� '�".
$��7� �����: ?�% ���� ��%9�� ��* ���� �� ����"� �� �� ?�%�: # ���I��� . �( ��*$� ��*%$�� ���� �$����� ���0� # ��� �;
���� E*�� '��� �� 5� ���� ���0� �� � #��$�� �� ����� ��*� ��� �I��� �, ���0� ����� ��� � J%�� ���������� � 1 �. � %�%*�� ���0� ��� �$� ��������� E�� '� �/; ��: % @ '�<��� �< ?� ��� �F�1�� � ��� ���� �I��� ����"� ��� �, !��.
�, 2$*0� � ���� ������ � �1 ���� �L� %�/�� �� ?��J�� 5� ���� ?��� �� ����� '�<���5�����'�1�� ��������� ���� ������ . �� $���� ���WAP
%� K%$� ���� ���� ���WAP� ��0� ������� B� P� 2$* 5�� �����7� .2%$�� ���9��� !�" ����� �� A���� �/( �,
�, � ��0������%� WAP ��(����� � 1 �.
����� � P� �� �� ������ 8���� ���0� �� �� �, � �����WAP1.x:
TLS: ���[� 3������ 2�%$���� ����� ��� ����. �, ���� ��� %�4�� ���7�� ������ � � � �� !�; � �� ��4�� E� ���$���� '��
�I��� .� ��� � �� ����F %�" ��4�� � ��" � ��$�� ./( ����� . �,WAP�� % 19� '� '������ % -0� %�" ����� A��-� ���� �%���� ���WTLS �%� '������ W70� %�"��� �-� ���SSL� �TLS . ��� ���� �, � �0� ���9��� ��� !�; 27��� �/(
WAP .%��� !�" E�� ��9� 2%$�� ���9��� � 41� �, ������ ��F��� ���WTLS �B��� �.
��%� % � � '�� ���WTLS� ������ K%" T *� �4���� ����14���� � ��7�� ����9�� �J � ���� � P � !�" ���$�� % �L���� %�� ���7�� � ���� ����� ���9����� ���TLS .�� ��7�� �J ��� �, � ��$1� B������ ��� N/��.
Universal Knowledge Solutions s.a.l
277
�-�� !�; ���,�*; ��� ���� ��� ���� '(� � ����� ����������%� WTLS���� ����� �TLS: X �1���� � �$� �� ��%��� '"� . '"�� � � �,SSL �TLS % 19� RSA '"�� WTLS% 19� RSA �DH �ECC. X �����9� S��� '�" ]��1� 3���9 2 %$�WTLS �����9 ��� �� � ��$, %-�� �(� X509. X ���� � '�� '"�UDP . %��� �� T ��� 3�" �/( ��������% 19� �� ?�A����� ��� ���� ��� � �(%�%�� ��J�%�� 3%��; !��
��� �%��. X '������ ]��1��� D ��� !�" ���� �"���� K��1��� '� D � '������ ]��1��� D ��� %� ����%��� �J�%�� ��$� ?�$�� W�/. X � ����$� ��" !�"� ]�*� 2 * ��� ��% /���� �� E�� �"����×A� . X � ��� ��,�4��� � �-�� T ��� ���$�� % �L��� ��/ �J ��� 5�� ��9� � ��$�� ./( T ���� ���� ��� ��%���� ��" �� ��
� ��7�� ����9��.
'��� ��� ��� ./( !�; �,�*G��WTLS �� �� � D7- ��T����� ������ � � ��4�� �� ����� �( 3%�h�$��: Class I WTLS : ������ � � �"�1�� 3%��"WAP �� T��� ���� � ����.
Class II WTLS : 3���9 '������ ������ B� �( %��<\� '����� '�� WTLS. Class III WTLS : 3%��" �� �� '�� WAP �%�[� 2% �� � �( �� T������ ������.
� �/�� ��F� ��� '������ � ���� �� T����� �� )���� �/( '��� .� ��� ?7-�,a) SIM ( '�<� �,GSM$� � ��� �����
��4�� �� T�����.
%& �2C ������� WAP
<��� A��� ' ��� �� '@%���WTLS �(�*� ���� ��� ���� �� � �$�� �����%� TLS ; ?� �� �����$��� ��[� ����� ������
� �� ���9�� 5�� B��.
8���� '����� 3%�%* �, ���9���WTLS �TLS� 8���� �� ���� #1� ��* a WAP . ���� W��( �� $� ���%� �1,�� � � ���%��������%�� . � ���� ./( ��� �� # ������%� WTLS� ��� 3%P- ���9� �%�� B1� .
h�" !�" '�� W�� ���%��� � ��" �; 3%�WAP '����� '� D � WTLSh�$��� ������� ������ � � � 3%� ������%�TLS � �
h�$���I��� '���� 3%� .�,h�" ��*� ���%��� ./( 3%�WAP>��� =������ % 19� W, ��" '�� '������ %19WTLS 3��";� %��� '������ .% 19���� ���TLS �H %4 8� �P 4� �����$��� ������ W�� % 19��� 3��";� W, � ��" A��-� . N/�� ����� �� E�
� N%P4� �� %4�� ���P 4� �����$��� B , !��� E� @ 3%��$�� �� � �� 3%P-�� ./( �<� ���� '�$�� T� ��� ��* 3����� %> %� $��� ��* ���0� )�*�� �, ��� ����WAP.
Universal Knowledge Solutions s.a.l
278
3%P- E� ���$��� ��%� � W��(WAP: X 3%�h�$�� !�" W�� 2$*�� � �� ���� ���F�h�$�� � ���� ������ �� �/� �� %���� ��%���� '������ 3%�� ��F�%��� �� �:� � �9�
�� ���� �� ���0�. X 3%��" ���WAP �I��� T� � ���� !�; �?� ��/ ���%��;.
( � ���� � /( � � %� ����(� �I���� ��% %�%F �" 3%��"� 3%��" T � � 3%��G � ,�*; %��4� W7��� � � �* ��� �" 3%��"
WAP�I��� ��* ��I��� ���� � !�" �������� � ��0� ��� ������. � %� $��� ��* ���9��� ./�� �� ��� ; '� <��� ��WAP2.x
WAP2.x:
%� $��� ����� ���� 3� ���� ��� ��� �� � �$�� W��(WAP2.x �%� '"� ���� � �(� %-�0� ��� ������� � ��� ��%��� ��� . ��F '����� !�; �/(����%� �-� �HTTP� TCP� IP ��� '����� � ��������%� TLS���� ��� ��[� ����� .
'���� ������ ����� ?�%<�WTLS%� ����\� H�4� ���( ���� ����TLS �I��� '��� !�; ������ ������ �� '��� ��
� ��4�� !�" ��4��� ������� �� ��:� �� �� � ��� !�; � ���� 3%P- 8�����WAP?����� .
>�*� � ����� J�? $��7�
��� �� E� 3%P- !�; .��WAP%�� ��� ���TLST � ��� =��� !�" ���0� ?����@ ��%� ��� !� .
� $*�� �, N%�%* T � ��� =��� !�" ���0� %��$ :
1 X � � ����� ��� ����� ��� ?���� � ���0� ��� ����"�����%� TLS. 2 X # �� �� ����� =������ !�; ��4��� 5�� ��� ��� ����" !�;� ���� ��I��.
8��� %�� ��� B�" D ���� ��� N/�� ��0��, �(���� �� ��� '����� WML .�'�" ��9� !�; � *�%�,� �����"G � $� '� ���� ��%� !�"� .���<�7� 5����� ����� K$� �� �� ,: X 5� �� !�" �F� �WML ��� �����$� !�; ��4��� 5� � ���; ���� � True!�; ���� �14sendreferer
3% 9L��� ��*<go>. X �� ��� %�4��� ���� �� ��L��� ����� �����$���� �4���� ���� �� ����$�� '�� N/�� ���%��� 8��� !�" 5�
� �%��� �, � $���REFERER 5� ��* HTTP T� � �� '��F B����$� '�� N/�� 5� �� �� �� ��L��� T �4.
Universal Knowledge Solutions s.a.l
279
X �� '����� 5� �����%� HTTPS � 2%$�� �, ��4�� %�4� !�" ����"� '�"� ��0� � ���� T��� � ����$� �" ��4�� ��� �, ?7-� 2�����.
8��� %�� ��� B�" D ���� ��� N/�� ���-���, WMLScript �Crypto API . E����� '������signText ������� ��* � ��%���Crypto ��F% E F�� A�9�; ��� '�$�� ]��1��� � ����� � ���� 5���� H�1 PKI 3%��G �'�" ]��1� �����9 %��4;. ./( H��
������ ���� � � � ��� !�; � ��� % 19�� � ������������.
Universal Knowledge Solutions s.a.l
280
�3? S��� � ��� �: A<�� � �*��� � ����� �LBS
������� � ����� � :
EF����� -���; �D �-� ����� �� �� �
����: ������ ./( ��� %��� �%� ���� �� �0� �( ��� EF����� � ��%��� ������� � (�� !�" ����� ./( �, 2%$�� . !�" 2%$�� ���
���F� =��� EF���� � ��� �, �������� �� ����� '(� .� ,�%P��� �����$��� ��<�� �" D ���� !�; B , T% ���.
������ ��!��: !�" �41�� �/( �, 5�� �� 2%$� :
€ ��� %� ���� �� �0�� EF����� � ��%��� ������� '��1�. € �������� 3���0� EF�� � ��� �, �������� �� ����� '(�. € EF����� � ��%��� �������� ���F7"� � ,�%P��� �����$��� ��<��. € EF����� � ��%��� ��� � ��� % � � ��� ��<�7�.
Universal Knowledge Solutions s.a.l
281
A<�� � �*��� � ����� �(LBS)
������ �� � �$�� ?�� �� ?���( ?��$� EF����� ���$���� �����$��� �,�*; � $� . � �� %���"� � $� EF���� /�L� ���� ��� � ��� �;������ �7 *1� �, ?� ��� # � ���� ��� 84�� ��4� ' ���� W�/� '������ � ��$, ��% �� ��9� ' �� !�" ���� EF��
W������ !4�� �J��, %,�� 3� �� ��%� !�; =������ 8 4�� ��� ��� ?�* � '��������I��� ��� � ��.
A<�� � J�? ��"� � ����� � :�.��D �.�� �J��: �������� T1� � �������������(� ���� A�9 !�" ���������� ��( EF���� !�" � ����� ������� �� � ��" 3�J�, ��/ �����
�������� 3���0� ������� ������. �������� 3%����� ����� !��� ���0� ����� �� EF����� � ��%��� ��� � ��� ��%��� 8��90� ����� C%��� .
T�.�� ���� ��I�� EF���� �����$� �� � 1�� ��� � � �" 3%��" �( EF���� !�" � ����� ������� %�4����������� ���.
T�.�� � � �� � � ������ �����$� �" ��4��� !�; ��F� � �� 5%F� ��� ; �� ������� ./( C%��� �� ��� A �B ��j%�� ��%� 5%F0 EF���� �����$�.
��� !�; � � ��� �J�% ��%\� EF����� � ��%� =%�� ��<�� '��� �F� ��%� �, %�$0� !�" ��* 1�� ��� ����� =�� ����B�%�� %�%�. TJ��� ���0�� � ��%� �"��� ./( ������ � ��" ����� D��-�� !�; ���-�� � ��� �� ���%��� ./( �, T��� C%�� �3%�����.
EF����� � ��%��� ������� � �� �� �� D7- W��(: X ��0� � ��� : ������� �����$��� ����; '������ �� 5� �� ��� � ��� ./(������ !�; B$F�� . ���90� ��� ��� �� ���
N� %� ����" ��9 !�" �����$��� ./�� ����_� �������� �����$��� ./( !�" ?�����"�'�� ��(����� �44�� �����$� T � ��� �� %��� '"� ���� 3�� ���..g�;.
X ���-�� � ��� :����� ��� EF���� �����$� ���� �� ��� � ��� ./�� ��� ������� ������ '���� ���� !�; � . EF���� �/( ��� ��%���� � 3�" �" � �� �,�� T%�1� ?�� F�.'��� ��0� � ��� ��� � � B� '��� ��� ����9� ����� � ��� �/( ��� � � .
X D��-�� � ��� : EF���� �����$� !�" T�� ��9� ��4��� ��� � ��� ./�� ��� ��"� ����� � ��� E �������$��� W�� !�" ?����. B����� �����$�� � ���� ������� �" � �: B�9 ��- ��� ' ��� ��� � ��� ./�� ��� � T% ����$������ �����$�. ./( '���
3� �" � ��� ��� � ����� 4�4��� !�" ��� � ��� ./( �-� A�*F 8�4�� ?���F K$��� ��� �� ��� '������ 3� 1�.
Universal Knowledge Solutions s.a.l
282
����*� �A<�� � �*��� �
� ������ ��� � ���� ���%9�� �� ������� !�" ��� ��$� ���� �� ��� �(��� ������� ./( �� , %�-�� ���� ��� � ��� '(� K%$��. � ������� W�%�; E� ��� � ��� ./( ���� E�� �� EF����� ��������� ���� 3�J�1�� ���%9��. � �/( D�� �� ��F ���� 0 �
��� � �LBS�� F� H�4� �� � �$ % �'����� ���.
�,�� �� '(� � ��� � ��� ./�� ?�"� 9 �������� %-��:
O���* � �����: j%�� ��%�� ��4�� � ������� ��� j%�� �� ��� �,�'� �; 3�"���� ��4 ;� '�$F�� � ��� '� . #�� �( ������ ./(�
����E911���� ���9� B���� ����� �� $��� ���%$�� 3�"��� '�" ��9� ������ ./( '���� ��� �� ���9�� �� %�� �� A���� �, 3%,���.
������ � ��� � �������: ��� � � K$� '���LBS '������ ������ EF���� � ��� !�" 3�"����� � T����� ���� EF��� �����$��� ./( #�� !�" '���
� ]�%�F��N%�%��� T����� ������ �*,0� %���.
����� �: ��� � ��� �� � �$�� 2 �4��� �/( ��� C%�� � ��I�� �" ����G� !�" ��%�� ���� ��� : � ���� �� �4� �� E �� 2 �"� " !�;
� ����"5"k ��?�� �$� %-�� ��I �": ( ����� E ��� � ��" A��-� B"���� 5����� ��-�0� %����k���%� 3�" !�" S�
��"���� � ����� � ���/: !�; 5%F0� ������ 5� !�; � �" 5%F� 2 ��� '� D �� � ��� ��� ������� �, A7�$�� ������ E��� ������ �� ������ ./( �$��
.���� EF�� . � %9�� ���%$� �J%� �� ������� ���� �, � ���$�� % �� ��9� ������ ./( � 1�� 2�$G��A�1 G�.
��*��7� ���/: '������LBS�� %���� ��4��� �F� % ���� ?7-� �������� ' �� � �� EF�� E��� ������ �� H�4 .
������� � A�� :
������ ������� �� �9 ������ ./(� ��% ��� ��������� E���� ����� ������� �������� ��� ������� ��$�� �� ��� ��/ �$��0�.
�����# � ��"#?9�: �� $� �� �� �, '(���� �7� � $� S���� ���$�� �����$�� '���$� ����� �, � ���� � ������� ��� ., ��" ��-��� � � !�$
�7 ��� K%$ B �� �*1��� ����� �� '������ '7"; '� �� ��� T�� ��%� �� 5�%�F� . �����$� 3��" ������ ./( 5� ��F�� �$, 3%�4� %9���� 3%�, !�; C���� W�/� EF���� �" ?��� �� .
Universal Knowledge Solutions s.a.l
283
B� � �����:
� ���� ��� ; �� ������� ������ '���� ������ ./( ������ '"� � !�" ?7-� %�-$��� �� , ����� ���� �� ���� �, �� ����� �� ��� ��F��2��@ 5$� �����.��� � �� ������� ./( �-� �% ��� ��� ������ �4�� ��������� 3%����� � ��� A�%9��.
-����������� ���� � A<�� �����:
�F�%��� ���%$�� EF�� � ��� �� % �� ./�� ��� D � ���%$�� �$���� ���� �( ?�%�I� ��� � � '� ���� �$J�9�� ������� ���������$��.
*0��� �: � ?�%�I� ���%$�� �� � �$�� ��* %,�� ������ EF���� ��� �����$� !�" ��4��� �� ���� J�%� ����� ��� � � 41� J�%�
� ���� T,�%����������� ����� E� ������� ./( S�� '� ?�%�I�.
S�* � �������: '������ EF�� 5�� #� �� �" �����$� � ��� '� �� ��� � 5%F� �F�� �����$��� �F� T�$�� �����$��� ./( ��� �4% � ��
N��. � ���� � 48�7� A<�� ����� ���"��
3���0� ./( EF�� � ���� �� % ��� �� �� �� �������� 3���0� EF��� � ��%��� ������ A�9�; ��F. ���� �� ����� �� � �$�� %,���
�����$��� ./( %,�� ����� �(����"� '� .
�� '� � �� ����� ./( ��� %� ��� %�%F �;( ������� �1���� ��( � ���" � � ������ !�" 3��" !�� %�%F��F���. �F��� )�1�%� E�,���� �$F����� �1���� E1�%� �� �" ��4��� 5�� ���.
�������� 3���0� ������ � � �1���� ./( )���� �� 3��"�� ��7�� ������ ����. !�" ����"� 3��" � %� ��� !�" 5�
� �����$��� ������� ������ �� ��� '(� ��� ���� �F� !�" 3%9��� 3%�4� %-I �����$��� ./( 2$*� � ��7�� ������ ���� ��EF���� �����$� � ���.
�$����� EF���� � ��� � ��� )��� EF���� � ��� �F� T�$�� ����� '<$� �,.
��� ���� ��F �� ��� � � ��� ���9�� !�" � ��� ���� W��( �� ���� �������� ��� ����� EF���� �����$� � ���� � ��7�� �����- ����. �1���� D � �� � ��� ������ ./( %��$�� %���0� ��J� � � ]��%�� �*1��� ������ ���� �F��� ���� ��%���� � E*� !������� 5�� W�/.
� E ��, ��1� ��������� ��� ����� !�" � ����� ������ ��� % �� ��9� �F��� � �� �1���� E,% �, % �� ��9� %-I� �������� ������ B1� ������� ������ ������ A������9�� �P9�� ������. �4� �F�� EF���� �����$� !�" ��4��� ��� ������ W�� '������
� %���� �$*� !���'������ ���� EF�� �� '��F� !��.
Universal Knowledge Solutions s.a.l
284
� ��9 ����� '<$� �, �*,0� 5 %���� ������ ���� ����$� �F�� �� !�" ��4��� W�/������� �1���.
�� -���G� � ��� EF���� � ��� �� ��� E ��� ��0� 2���� %��$ x,y ������� ������ � K�%$�� ������ HJ�%9�� �7� �����
��$�� �/( '���G � �0� T% ��.
� 48�7� A<�� ����� ���"��� ���� ��3 � J�? ����� � ���� �
%��$> � ��7�� ���9�� ���� 2�I� ���� ����-�� �� ���� '����� =��;����� ���� EF�� � ���� T% �� . N��� ./( �� ��
�������� 3���0� �� ��%�9G� ����� N� ��% K�%�"� ���� !�" �� ���� . �� 3���� � �� �� 3%�9G� /�L�� %-��������� ������ EF�� � ��� �� . '� ���� �������� �� ���� ��" ����� ���� ���" 3%�4�
EF���� ��� T�� �����$� !�" ��4���. '����� �, 3������� �������� ��� ����� E� ��$�� ���9�� !�" ��$���� ���� ��� �EF���� �����$� � ���� !��� 3� � ���$� .
(�'������ � : $��1���� D � �� =��� �(%-��� EF��� �����$� � ���� T% �� �� �� �� % �� ./( %�� .� � ��7�� � 7��� N� ���� � ��� �(
��$F�� �" r7�G�� '���� ������� � ����� ������ .� !�; � ���� 2%$� � ��� ��� B�\, ����- � �� ��� � �0� � ���� ���� ������ EF�� �����$�������� ���.
��� ���� % @ � ���� ���� ��* ������� ������ T F��� EF���� �� �, ���� �/�� A��� 5�����. !�� T%�1� �����$� �� % �� ./( %,��1 X2%���� � . EF���� �" ���" 3%�, /�0 ������ �����$��� ./( %��$�� W�� %,�� �����
� j%�� �� ������ � ,���� �����$����� T% �� !�" B ���������7"G�. � ���� ���� �� % �(%,�� ���� �F��� � ��� =%�� T% W��( <��� ���.
��"� F !�; '�� � 7��� K$�� � ���� ������ ��� �D�-�� !�� EF���� � ��� �, L ��� ��� �� ��� �� �/(.
!�� � ��� '����� ��� �F��� �� � ���� !�" ��4���TA � ������ T���� � ���� �" '������ �$� �,%$� �, �"�� �����% �� ��9� EF���� � ��� �, L ��� � ��� �������.
�� F� �� % �� ./( %��$� �� ���� 2%$� '������ EF���� � ��� �, ���$�� �F��� ��� �����. �����$� !�" ��4��� �����$� �\, 2b�TA� ���� %�0�� # � �������� EF����� � ��� ��%� !�; ��4��� ��MPC � N/��
� ��%� ��� � � ������ '������ EF���� �" ��41� �����$� %,� �� ��� API. ��4�7� ��� � � ����� � %� ��� ��� 5MPC �����$� !�" ��4��� TA� ���� ���� �����$� E� .
�� ���� �������� �� �[� ������ ��9�� H*� �� % ��* �(��9F2Q%$>�� ���� :
Universal Knowledge Solutions s.a.l
285
� �%� ��" T% �� ./( !���� ?�$� CGI-TA %�4��� �(� ��� � ���� � ��� ;%"�4 � >� � !�; ����� �� 5 %���� �/�� ���
� � �F�� SJ���100 !�; 200%�� .� ��� N� 5� �� ���� � ����� ./( � �� !�; ��� ?��� 3� � �F� �" 3%��" �( 3���0� �, D��������.
���(L��� T ����� �, �� ���� �,�-�� ?�%<� ����� ��* � ��$, %-�� �� % �� ./( �L� ?�* � %�/�� �� �� .
���� � $�4 ��"��TOA
��� � ��� �� � �$�� � ,���� �F��� !�" �4�� � ���� 2%$� E� ������ T��� � ��� ����"� ��" !������� ������� ���F ����� � ��� �, ��*�%$���.
��4��� ��� � ��� !"� ������ �/( �, %�[� 5 %����TOA� � ��4��� ��� T%,TDOA. EF���� � ��� �F� % �� ��9� ��� �� � ����� ./�� ��� . '���� ������� ������ E*�� � ���� 3���� � �� '����� �� ?�� TAO
D7- �� ��$�� '� �����$�� �� ���%-��. �� ���� E �� �� �������� '� 3%�9; �% ������� ������ �$�� �� % �� ./( ��$� ������ =�� ��*. ���%�� ��%; � � �4�1�� ����� 5��� �(�$� � �� �� '��� � ��������� ?7-� �� �� D7-� �� �
)T1,T2,T3 (� ��� 5� �� ?��� �� F� ����0� ./( ���� �� 5� ������ � ��$� E*� �� ���� E �� �, �F�� .� ��; 5� � �� �/( '�<�GPS� � � %/ �"��'�$� ��� ?�1��� %��$ � ���� 7�.
Universal Knowledge Solutions s.a.l
286
� ���� �" ������� ������ �,�� � ��� ����G�� H�4 B�\, ����- �"%� W%��� 3%�9G� �� ��� .� � �� �� 3������ �,���� ��� 3�J�, ��/ � � 3����� �� ���� EF��� !�; ��� ������� ������ ���� � ��� ��� �� �� D7- �� �����$��� '������ ���
�EF���� ���� ���" �� -���; !�; �� ���� !�; ��� ������ � ���� �� -���G� ���%� ��� �(�$�. � ��� '����� �� !�; B ����� �� ��( �� TOA���� ����9�� �, ?��� � ��" � ��� ���$� CDMA/CDMA2000 ����9�� ./( �0
� ����� /�� �������� � %/ �"� N� !�; C���� �GPS. EF���� � ���� ��4��� ��� � ��� '����� � � ������ ��9��
���� � ����4 ��"��AOA:
� ���� B��9� ��9� � ����� ./( ��$�TOA �G '�7�� ����� '����� �" ?�*�" ��� D7- !�; ��4��� ������� ������ ���� 3%�9� ���� !�; 3%�9G� ���� ��� � ����� � ����� ./( '���� �� �� . � ��� ��� �F0� !�" �� �� D7- �� �����$��� ./( �������
������� ������ E*��. �F� !�" ��4��� ��4��� ��� � ��� E� ��4��� � ��� � ��� ��<�0� K$� '����!�"�.
R��" ����� � 4�8� � J�? ��"� � ���� �
B1� ������� ������ !�" � ����� ������ '����� �� �� EF���� � ��� �, !�"� �F� !�" ��4��� 5�� ��� ��� ����".
EF���� � ��� � ��" �, � �� 3%�4� ������� ������ W%�9 ������ ./( �, . ���� ������ ./( �F� H�� �� D��-�� � ��� ����� 'LBS �T F� EF�� � ��� 5� �� ����. ���$ 7���� �L� ��� ���� � ��0� 27��� ���� EF���� 5��� �� % �� #1� !�" ���*%$� '��� � /�� E-OTD !�" ���$�
���$� � � �, � *%0� �� ����GPS� "��4�� %��F0� !�" .
� #��# �"��� � ��"�� �"�4 %(E-OTD): � ��� �;E-OTD ��" ����� B��9� ��9� ��$� TOA� ���� �" ?�� ����� 5�� ������� ������ !��� ���� . � ����� ./( ���$�
� 1���� � ,�%P� � ���� �, � �� �� ������� 3%�9_� '�7�� ����� 5�� !�". ��$ ���� ����-�� � ���� ������� ������ ��9 ��$� 5 !� ��LMU� �EF���� #� F 3���.
Universal Knowledge Solutions s.a.l
287
5� T F� EF�� !�" ��4����W�� 5���� � ��" �, �� �� D7- �� �����$��� W%�9� �. �� ���� !�" 5� � ����� ./( H����
������� ������ !�; T F� ��9� � F���� ��%;.5 %���� �/( '������ �� �0 �F��� #1� �, �%�9G� E �� ��%; 5� '��� #� ��� A��-� ��%� ���� �, ��� �F ������� ������� %�� �%� ��(LMU � ��" ��� �� T F� � F�� %�4� 3% �0� ���� D �
�����$��� �F� �� ��L��� #� ���. � ��� '"� N/�� ������� ������ '�� !�� ��� ��� /�� � ��" '�� �� ��E-OTD�� �� ���� �� ����� T%, � ��� �-7-. �(��"
������� ������ � � �,���� 5�� ��� � �� ���������� ��� F � � ����� T%, ��%���� W�/. �,�� !�; ����� T%, � ��� ��� ����- �"%� W%��� 3%�9G� �0. !�" '�� �� � ��$�� ./�� ��� D � ����� EF���� !�" ��4��� ��� ��,���� !�" ��4��� �$�
������� B1� �������� � ���� ��F ����� ���� EF�� !�" ?�����"� ��� ��� �� -���G� 5�� ��� �(�$�. ���%� �� !�" ?�����"� ������� ./�� '� ���� ������� ������ '�� � '"�� ?�* � ������ ���4�� � ���� D ��� � ��" �� �� ���E-
OTD. � ��� �� =%� T� ���E-OTD �� %,�� T F�������� �1���. !�� �4� �F� !�; ��4��� ��� D � 50 !�; 100%�� .
� ��� �� �� ������ ��9�� H*� E-OTD:
GPS �A-GPS
%��$> ����$�� EF���� � ��� '�<�GPS �� ����� %-�� ��%*���� �F��� �, � �$9 . �/( '��� � '�<��24 ��9� ����" �"��4 %�F K%0� ��� %��� '"�� ���� �7������ !�; ��%�9; ��%GGPS.
Universal Knowledge Solutions s.a.l
288
� D7- E� ��4�� ������� ��� ��<�� N� �, � $�4 %��F� E�%�.
������� � � %<� � W��( ��� �� 5� ����� � ��$�� ./( H�4��� �$�4�� %����� '����� E�� �� �/(GPS� ��0� ��* .
EF���� ��� F !�" ������� ��4� ��"� 3%9��� �� -���G� 5�� B��� �������$�� ���9�� '��� !�; �����$��� ��%;.
� ��� �, �4� ��� B��9� ��9�E-OTD ?� �� 3��$� 5���� � ��" %��$� ���� #L� ����$� 3%�F !�; C����.� ������� ���� �/; �� ������ � ��� E�4��� !�" 5� B1� ������� ������ !�" '�� ��� ��� ������� ����$��� 3%�F %,��� 5�4�� �� ��� �, ���
������� ������ %$ �, �1���� �� � ����.
����� '�� �������� ��� ����� �� � �$�� �,GPS� ���� '������ ������� ������ E� �4��� ����F ��41�� 3���� � 3%�4�D����� � ��� '������ � ��.
3��� �� !�$�� GPS�F� �� B�7��� !�" 3 ������ ��9 !�" 3%9��� 3%�4� % -L��� ��� 5�� ��� 5�4�� �� ��� N���� .
5 �4���� � %P4�� HJ�%9�� %�$� �;GPS � ./( '����� !�; ��� ��9� 3% �0� ���[� �, % �� ��9� K1��� �F �F� �� ���7���������� ��� ����� ��* �� �� 3%�4� � ������.
��$ GPS D �-��� !�" 3���$��� EF���� � ��� �� ���� B��9� ��9� , ��F �� ���A�%F ��� ��%�9; D�� � $�4�� %��F0� '��� D � '"�� ���� ��� �����GPS.
�, ���� .����� '� ��4�� �0 3%�9G� ./( ����� ���� 3���0� ��" �$�4�� %���� '���� �� # �.
������ '�� ������ !�; ��4��� �$�4�� %���� 3%�9; ���� �� ���� ����� � �� #� �� �������. %��F� �-7- �� ��� ��� ./( /�I� �F� %-�� EF�� �����$� A� "G �1����.
�F� A� "G �����$� !�" ��4��� � ,�� %��F� �-7- �� ��� ��� ��� %��F� �$�%� �� �����$� � ��$�� 5� �� ?� *� %� ,��.� ����$�4�� %���� �� �,���� � ��� /J��" ��� 3���� 3%�9G� �"% ����.
EF���� �, L � !�; ��� �F � ��-�� �� 2�� �� ���� A�� �, L ���, ?��� �� F� ����� ��� F ���� �� N%�%*�� ��, <�7� ��� !�; �4 300%���� � . �7���� '���� 5��� �/��GPS�����$��� �� �� ��L��� �$�4 %�F �� �, � %/ �"� �� ������� T F� �����.
D �-��� � ��" '�� �� ��� �$�4�� %���� �" �,���� 5�� �$��������� ������ ��� ��� �� -���G� � ��� . SJ��� � ����� ./( ���� � � ]��%�� �F��5 � !��40��40� EF���� �" ?�%�� .
� ?�* � !�� � 5� ��<�� �(���� ���� EF���� �����$� �GPS �� �� �� -���; ��*�� � K%$���?�* � )�1�%�.
���$� ���� ��<�0� ��� �� '@%���GPS% �� ��9� �F�1�� � � ����� �� F� EF�� �����$� ���� . ?���� ��%�/ ��� B�0 � ��4����$�4�� %���� E� %<� � W��( ��� �� 5� 3A�%F !�". ��������� ���"b� ������ 3% �� � ����� �$� � ���� ./(. �� � �$��,
� � ��0� ��* '����� 5� �� ��� � ���� !�" 5$4�� �� �$� ��� ���%$��GPS���� ��� ������ � ��� . ������ ��� ���� �F �� % '����� ./( 2$*�� � ���CGIXTOA��"�� �� % � .
Universal Knowledge Solutions s.a.l
289
0� � �0� ���9��� ��� � � ]��%� �F � ����� ./( '������ EF���� � ���� '�7�� ����� �( =%�20 !�; 40 � ��- �(� ?��� % �� 'F%��� � ��� �� � �$�� '����� ��� ��� .
�, � � �0� 2$*�� �� �� ������ ���� ������ ���GPS !� �� '����� �( A-GPS� � '�"���� ����$�� EF���� � ��� '�<� �����$� ������� '��� ���$� ������ 3���� '�<��� �/( '��� D �GPS���9�� '��� !�; ��A�%��� ��%; '- . % �0� '��
�7���� '������GPS =%�� )����9�� �� A�� ��9� �( ( ����� ���� �����$��� ���"GGPS������� ������� 8���� .
�7���� E ��� '� GPS��� �4���� ��%���� ��� ��J�� %��� ��,��� ���9�� %�" ���9 . �����$� ������� �7������ ./( '���GPS �"��4�� %���� ��F �� ��%��� � T%��1�� 5�� !�" 3%����� '(��� ��9� �����$��� ./�� �������� 3���0� � ���� '���
� 3%9��� ������� ���%�� % 19� W, !�; ������ ��� � ������$�4�� %���� �. ����- ����- ����� !�; 5�� ��� ����� �4 D � EF���� �����$� !�" ��4��� '�7�� ����� �, ?��� % �� T%, � ��$�� ./( T���.
5���� �� ��" '�� D �� ���9�� '��� !�; ��� ��� �����$� ��%\� ������� ������ '�� , %<��� �� ���$���� � ������� �L9� ���B �" 3��$���. 3��$���� ��%���� � ��� ������ ����$��� 3%�F H�� � !����� ��* ������ EF�� � ���� 3%�9G� � ���� ����0� �,
N� ����� 5��0�� EF���� � ��� �� , 5$4 ����.
�7���� � ��� '����GPS�%@�� ��9� � ���� � ,�%P��� �����$��� ��<�� E� � ��%� 3%�4� �7��� ��* �1������ T ����� �,. ��� � � �������� %-�� ���GPS ���%$��� 8���� EF���� � ��� '�<� �( ?�"� 9 �E����� �����. �� %-�� ������� ./( 5� �� ���$, ���$�� EF���� � ��� �%���� ,�%P��� �����$��� ��<�� %�� ��L ��(.
� ��� �� �� ������ ��9�� H*� A-GPS
Universal Knowledge Solutions s.a.l
290
! ��� ��&��2� � ������� � ��6"GIS
EF����� � ��%��� ������� � ��� � ��" �, �, 5������ ��� �������� 3���0� EF�� � ��� ��9 . EF���� �� -���; !�" ��4���,
E� ��� N%�%*�� �(� �� �� -���G� W��� B�$1� �� ���.
( � ,�%P��� �����$��� '�<��%� �" 3%��" � $ � ��4 ��/ =%�� �����$�� EF���� �����$� �% B����\� J�%��� E*�� 8�� S��� �� F EF���� �����$��!�$�.
�� ��0� EF���� ?7-� ��*�� �����$��� ��$�0� 3��$�� J�%� '������ 3��" �/( !�; ��4��� '� � �)%��9�� E*���� ����� �,�-��
��=%�0� �����$��� �� % -��.
2�L� �����$��� '�<� ���4�� ���� ��� �� �������� � ,�%P���� ��� ��%���� ����� ���� �� ��" A�%�; � 1 � ����$ � �%�� 8��9�� '�<��� �(��� ���� �����$� !�" � �����.
��<�� � 1�GIS� �� � *%@ T ��� �, :
X �� $� '��$� ��� ; :����$� ��� ; �, � ��$�� ./( � 1�e�$� ���� �" �� �� '�B� (�� �" . '$ � 5%F� ��� ; � ��$�� ./( ��*��
Universal Knowledge Solutions s.a.l
291
��� ?7-� ��F� � ������� ���� !�; ��4��� �*,0� %���� � ���. X � C/��� ��� ;��� � �9� :�� �(� ���"0� � ���� 3%���� ./( ��%��������� ��� ����� �� �, '��� . 3��" ���"0� '���
��� �,%$���� '�$� �" � ��%,G� �����$��� �" ?�� �����$��� E. �F ?7-� %��I� ��$� ���� � ��� ������ ��" ��-��� � � !�" %��I��� �/�� � ,������ 8��90� � ���" �� , ����� ���� �� ���� � ��� ������ �����$��� ��� ����.
��<�� 3�J�, �� ?����� H*���� ��GIS ��� 3% �� �������� ��� ��( �� ������ �J��, '��� ��<�0� ./( ���� �������� �J ��� 5�� �
��<�0� ./( �������� '(� �� �� ,: X %����� �, ��� �� ��� ; : ?�"� 9 �������� %-�� �� '����� �/( �$ ��������� ��� ����� �������. ���� EF�� A� "\�
%��� �� ��� \� '�<��� '�� ���� % F 24� ��* ��� .� �4�� ���%��� ���%��� ./( ��*�� �F�'"� ��� ���F��� �� �� � ���� $� ����� E ��� ���%� !��. X B����� �����$� :��������� �� ����� ������� ������ ?�* � ������ �������� ��� �(. X � � ����� �����$���: �" ��4���� � ������� K$� 5@% �F D � !�" '(����� EF�� �� �� %F H�4� � � '���� �����$� !
'������ .%�$ N/�� T % �� !�" N%�%� '����� ����� B ��� ��-��� � �. X E*����� �,�-� :���-��� � � !�" 'J�%��� !�"0� �,�-��� EF��� � ���� ���"0� �� % -��� 3� 1� ���� �F � � ��� �����$� �(. X E*����� �� �� :��� ����� � %P40�� � �<"0� )����� T ��� %4��� � � � ���� W�/.
A<�� � ������ � ����� � ��6"� ���*�
�1���� T% � 3��$�� �� ��� '���� 3��$� ��" �J � 5� �� ������� ./( ��� 3� �� T��� '��� 5���� EF����� ���$���� ������� ���,
�� ���� #1� !�; ���� �F . � ��� � � % � � )�*�� H�4 �$� )�*���� �/( �, ����%�� ��%�� %,�� '�" E�LBS?� �� ?��$4 ?�"�*�� .
'�� ������ ��� � ��� � ��%� ������ ?� ��� ������ API� "�� �� 3���� ���" 3%�4� �(� EF���� �����$� !�; ��4��� : X ���9�� !�" � ����� � ��%��� ��� � ��� ������ : � ���9�� '��� !�" EF���� �����$� %,��� D� N� �� �� �; ��4��� ���
� 2% �������� � �74�� W�. X ������� ������ !�" � ����� � ��%��� ��� � ��� ������ : ������ !�" EF���� �����$� � ��� '� D �� �� �; ��4��� ���
������ !�" ����$�� ��� � ��� T % �" %9��� ��9�. %,��� %� ��� � ��%� ������ EF����� ���$���� ������ 5�@� .�����$� !�; ��4��� '� EF���� � ��� ��%� T % �" EF����
�������MPC . EF���� � ��� �, �������� � ����� �" %<��� KP� � ��%��� ������� #1� '����� '� � � � %�� ��� % ,�� �������� %� ���. ���� �$ MPC���9��� �� ��� ������ � %� ��� ������ H �4�� .����� 3� � .�(����� 5� ���� �� ����� �� % -� �<�
��1������ ���P9��� ����� ���� ������� � � �������� # ���� !�; ������ 8�0���.
Universal Knowledge Solutions s.a.l
292
%9" ���-��� %9" E���� '���
��C��� $�����
������� � ����� � : %� 8����T � � � .
����: ���$�� ����� ./( �, ��� P� ��� ���� %��,0� K$�� � � � ��� ��%���� ��4 !�; 2��� ���� ��������� � %����� K$� E� ��$��
3����� ./( ���� �7�.
������� ��!�: !�" �41�� �/( �, 5�� �� 2%$� :
€ '����� � 1 �Visual studio T � � !�; ��4��� ���"
€ ��1�� '������ �4���� � � � ��� �� ����� K$�Xml ���� � �"��F� MSSQL � MS Access���� ��� %��4�� .
Universal Knowledge Solutions s.a.l
293
���? ��C��
�� ����� '���� ���� ��������� ��-�0� �� �"���� K�%$� 3����� ./( �, � �% �0� � ����� 8 4�� '�� ��* �� �" ��,%$� ���������� � �� %� ; ��* � *���� �����.
��7� ��C� �:
�( ��-��� �/( !�" ��$�� ���7�� ���� ����:
- % � ��� �J � %,��Visual Studio .NET
- Microsoft Mobile Internet Toolkit ��%�� T % �" ��� ���� �� �" ��4��� ��� ����� en=displaylang&9768f41f124fb28ea416-4e8b-21f597ae=familyid?aspx.details/downloads/com.microsoft.www://http.
- ���� '��� SQL MS������ !�" ���" .
- '��� ����IIS !�" ���" ������.
��: ���� � T � �� ��-� �" 3%��" ��-��� �/(ATM� � �� �7F��� A�%�; !�" 3%���� ���� ���� .
�� 5�� �, 3%,����� i������ ������ %������ %��<; ��-��� �/( �� K%P��.
1X ���� ��� 3�"�F :�4�� ���� ��� 3�"�F !�" � �%��� # � ��-��� �/( �, ��,�( �� %���"�� '������ '��� ��� ����-� 2�( '�� ��9 ��:
�������� 8�� ���-�� � � �������� 8�� ��0� � ���� ��( ������� ���� <�7� 2X �J � ��VS.NET ���� �� � �� )�%9� A�9�; %� ���� '���
Mobile Web Application. 3X ��� VS.NET 8�4��� � ��1���� �� �"���� ?� J���� 2���� ���(� � ��%���
MobileWebForm.aspx � MobileWebForm.vb) �P� ��%��� �/; Visual basic % � ��� .(
Universal Knowledge Solutions s.a.l
294
4X %4��" %�� '��� �������� 5��� C/��� '��� %4��" !�" N����� 5 ����� '������TextBox � Label � Button.
5X C/��� D7- �� �� �� 5��� ��14 2�L��
- �\� 8�� ��0���9�� �� �(� ������ � �� �����$� ���
- ��9�� �� �(� 5���� )�� %� ���� 8�� ���-��:
- ��9�� �� �(� SJ����� %��<\� 8��, D��-�� ���:
Universal Knowledge Solutions s.a.l
295
�� �� !�; % � ��� ������ '�$�� ��9�� ��I
6X ��14� ���%��� 8��� �,�*; ?� J���� '� �1������ '����� %4��" �,�*; =��
MobileWebForm1.aspx�� ��� ���%��� 8��� H�4 � : <%@ Page Language="vb" AutoEventWireup="false" Codebehind="MobileWebForm1.aspx.vb"
Inherits="MobileWebApplication1.MobileWebForm1" %>
<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<HEAD>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="http://schemas.microsoft.com/Mobile/Page"
name="vs_targetSchema">
</HEAD>
<body Xmlns:mobile="http://schemas.microsoft.com/Mobile/WebForm">
<mobile:form id="Form1" runat="server">
<P>Welcome to Account View</P>
<P>Login
<mobile:TextBox id="txtUserName" runat="server"></mobile:TextBox>Password
<mobile:TextBox id="txtPassword" runat="server"></mobile:TextBox>
<mobile:Command id="cmdOK" runat="server">OK</mobile:Command></P>
</mobile:form>
<mobile:form id="frmAccountView" runat="server">
<P>Welcome to Account View </P>
<P>Hello
Universal Knowledge Solutions s.a.l
296
<mobile:TextBox id="txtAccountViewName" runat="server"></mobile:TextBox>Select An
option
<mobile:SelectionList id="SelectionList1" runat="server">
<Item Value="0" Text="Checking Account"></Item>
<Item Value="1" Text="Saving Account"></Item>
<Item Value="2" Text="Credit Account"></Item>
</mobile:SelectionList>
<mobile:Command id="Command1" runat="server">OK</mobile:Command></P>
</mobile:form>
<mobile:form id="frmResults" runat="server">
<P>Welcome to Account View </P>
<P>Hello
<mobile:TextBox id="txtOutputName" runat="server"></mobile:TextBox>Account Type
<mobile:TextBox id="txtOutputAccountType" runat="server"></mobile:TextBox>Account
Balance
<mobile:TextBox id="txtOutputAccountBalance" runat="server"></mobile:TextBox>
<mobile:Command id="Command2" runat="server">Back</mobile:Command></P>
</mobile:form>
</body>
� 1���� �, ���%��� 8��� ���MobileWebForm1.aspx.vb: 'System and SQL Namespaces
Imports System.Data
Imports System.Data.SqlClient
Public Class MobileWebForm1
'Mobile Namespaces
Inherits System.Web.UI.MobileControls.MobilePage
'The source code contains Mobile Control's events in this
'section such as the two protected WithEvents shown below:
Protected WithEvents Password As _
System.Web.UI.MobileControls.Label
Protected WithEvents Form1 As System.Web.UI.MobileControls.Form
Protected WithEvents txtUserName As System.Web.UI.MobileControls.TextBox
Protected WithEvents txtPassword As System.Web.UI.MobileControls.TextBox
Protected WithEvents SelectionList1 As System.Web.UI.MobileControls.SelectionList
Protected WithEvents cmdOK As System.Web.UI.MobileControls.Command
Protected WithEvents frmResults As System.Web.UI.MobileControls.Form
Protected WithEvents frmAccountView As System.Web.UI.MobileControls.Form
Protected WithEvents Command2 As System.Web.UI.MobileControls.Command
Protected WithEvents txtAccountViewName As System.Web.UI.MobileControls.TextBox
Protected WithEvents Command1 As System.Web.UI.MobileControls.Command
Protected WithEvents txtOutputName As System.Web.UI.MobileControls.TextBox
Protected WithEvents txtOutputAccountType As System.Web.UI.MobileControls.TextBox
Protected WithEvents txtOutputAccountBalance As
System.Web.UI.MobileControls.TextBox
��� A��0� A�*, ��% ��� =%� ��� ?�� ���F�������� '����� %4��" E �� �" H %4�. 'Following constants define the type of account you want to query
Public Const CHECKING_Account = 0
Public Const SAVINGS_Account = 1
Public Const CREDIT_Line = 2
� �" �J���� �������� K%P� ����-�� ./( ��,%"5���� )�� � ��� �, '�F%0� '����.
Private Sub cmdOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles cmdOK.Click
'Get the username,if its a valid username then
'navigate to account view form
Universal Knowledge Solutions s.a.l
297
Dim strUser As String
strUser = GetUserName(txtUserName.Text, txtPassword.Text)
If Len(strUser) > 0 Then
ActiveForm = (frmAccountView)
Else
Response.Write("Invalid Username and/or Password")
End If
End Sub
%� !�" P*�� D�� ����$�� �4�� ������ �� % ��“OK” '� %����� '� D � ��0� C/����� �, �� % �� '������ %�� ����� %�%���GetUserName
Private Function GetUserName(ByVal sUserName As String, ByVal sPassword As
String) As String
'Get Username based on txtName.Text and
'txtPassword.Text from tblUsers
Static strUser As String
If Len(strUser) = 0 Then
Dim sql As String = "SELECT * FROM tblUsers Where tblUsers.UserName ='" &
sUserName & "'AND tblUsers.Password =_"
'"&sPassword &"'"
'Use ADO.NET Data Reader to get the data
Dim conn As New SqlConnection("workstation id=SKAIT;packet
size=4096;integrated security=SSPI;data source=SKAIT;persist security
info=False;initial catalog=Accounts")
Dim comm As New SqlCommand(sql, conn)
Dim reader As SqlDataReader
conn.Open()
reader = comm.ExecuteReader
While (reader.Read())
strUser = (reader("FullName"))
End While
conn.Close()
conn = Nothing
comm = Nothing
reader = Nothing
End If
GetUserName = strUser
End Function
K�%@0� '������ ���� ��� 3�"�F E� ��4�� � ��$� =%� ��� T���� E����� '�� sqlConnection �SqlCommand �SqlDataReader ������� ���� ��( <�7� SqlDataReader !�; ������ '�" 5��
���� ��� !�" � �$� N� A�%�;.
Private Sub Command1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Command1.Click
'navigate to the results form using Activeform
ActiveForm = (frmResults)
End Sub
%� P* D�� S��$� ������ �� % �� �-��OK5���� )�� %� ��� �$� ���-�� C/����� �, .
Private Sub frmResults_Activate(ByVal sender As System.Object, ByVal e As
Universal Knowledge Solutions s.a.l
298
System.EventArgs)
'get the data based on account type and username and then
'format the result
Dim intOption As Integer
Dim strOutput As String
intOption = (SelectionList1.SelectedIndex)
'0 =Checking,1 =Savings,2 =Credit Line
txtOutputAccountType.Text() = SelectionList1.Selection.Text() 'Account
Type
txtOutputName.Text = GetUserName(txtUserName.Text, txtPassword.Text) 'Get the
name
txtOutputAccountBalance.Text = Format$(Get_Account_Balance(intOption),
"$##.#####,###.00")
'Get the account value and format the string
End Sub
C/����� � $1� D�� S��$� ������ �� % �� �-��frmResultsSJ����� %��<\� '�� N/��� .
Private Function Get_Account_Balance(ByVal intAccountType) As Double
'Classic use of SQL data reader,it is atomic read,
'closoes 'the connection
'get the account balance based on relationship with the Table()
Dim sql As String = "SELECT *FROM tblAccounts,tblUsers Where
tblAccounts.User_ID = tblUsers.User_ID And tblUsers.UserName ='" & txtUserName.Text &
"'AND tblUsers.Password ='" & txtPassword.Text & "'"
Dim conn As New SqlConnection("Data Source=localhost;Integrated
Security=SSPI;Initial Catalog=Accounts")
Dim comm As New SqlCommand(sql, conn)
Dim reader As SqlDataReader
Dim dblAccountValue As Double
conn.Open()
reader = comm.ExecuteReader
Select Case intAccountType
Case CHECKING_Account
While (reader.Read())
dblAccountValue = Val(reader("Checking"))
End While
Case SAVINGS_Account
While (reader.Read())
dblAccountValue = Val(reader("Savings"))
End While
Case CREDIT_Line
While (reader.Read())
dblAccountValue = Val(reader("CreditLine"))
End While
End Select
conn.Close()
conn = Nothing
comm = Nothing
reader = Nothing
Get_Account_Balance = dblAccountValue
End Function
Universal Knowledge Solutions s.a.l
299
N/�� '������ 5�� )�� ��� �4���� �����$��� C�%���� ���� ��� 3�"��� ��4��� �4�� ������ �� % �������� � ��� '�F.
Private Sub Command2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Command2.Click
'Navigate to account view
ActiveForm = frmAccountView
End Sub
%� !�" %����� 8���� D���� S��$�Back C/����� �, frmResults �� %�: )�� �" '7$��� 3��$�� �������.
Private Sub frmAccountView_Activate(ByVal sender As System.Object, ByVal e As
System.EventArgs)
'Welcome the user
txtAccountViewName.Text = GetUserName(txtUserName.Text, txtPassword.Text)
End Sub
Private Sub InitializeComponent()
End Sub
End Class
7X �J � %,�� ��$�� �����VS.NET �� W�/� % � ��� �J � ��* �� ���� ��� 3�"�F ' �4�� A�9�G � �:
3/,�� %��<; �7�Server Explorer:
���� ��� 3�"�F A�9�\� ��( ���F 2 � <�7� D �Accounts���� ��� ������� N���� ����
8X �� �� ��$� '��� ����-�� =%�� T% �,�*; ��� ���� W�� %�%@ !�" ���� � ?7-� �� 5�� �� 5�
Universal Knowledge Solutions s.a.l
300
5�� �" '7$�� �, �(����$��.
9X %�0� '������ ��� � � A���� '��� �� �[� ������\� H�4�Build Solution ��J���� �� Build.
10X ��* ���� �, 5����� %���� ��* ����� ��� � � ��� �� ��L��� �$�WWWRoot 2Z%$>� �� ��* �7� �� �*�%�,� ����IIS T % �" %P4��� ��� � � � P9� ����� T � �� B� $1� �� ��L����
.%���� �1���� ��*%$��.
11X '������ ��� '"��� � �L� ������� ���"�� % @ ��*%$�� )���� '����� ?�* � ��( ��� 2�� �� �����"G� �* � 3���� ���J���Web.config.
"�C � ��C� �%
�������� 3���0� !�" #� �� ���� D ���� T�$� �� !�" ��-��� �/( �, ��$� . 2�� ����-� �, '����XML #� �� ���� ���� �� %�4��)����� %�4��� �/( �-� %,�� �� ��� D �.(
24�� '���� %�4��� �/( E� ���$���XmlReader�" N����� 2���� 3A�%�� K%P�� �/( '�� D � ! %4��$��� ��-���� � #� �� �����$�<city> � <updated> �<forcast> � <min> �<max> . 2�� ���
XML��9�� �� : <?xml version="1.0" ?>
<weatherinfo>
<auckland>
<updated>31/01/2002 09:00</updated>
<city>auckland</city>
<forecast>Fine. A mostly sunny day with light winds</forecast>
<min>24</min>
<max>25</max>
</auckland>
<chennai>
<updated>31/01/2002 09:00</updated>
<city>chennai</city>
<forecast>Fine.</forecast>
<min>35</min>
<max>38</max>
</chennai>
<hongkong>
<updated>31/01/2002 09:00</updated>
<city>hongkong</city>
<forecast>Early rain</forecast>
<min>23</min>
<max>25</max>
</hongkong>
<mumbai>
<updated>31/01/2002 09:00</updated>
<city>mumbai</city>
<forecast>Sunny day</forecast>
<min>29</min>
<max>35</max>
</mumbai>
<malaysia>
<updated>31/01/2002 09:00</updated>
Universal Knowledge Solutions s.a.l
301
<forecast>raining</forecast>
<min>24</min>
<max>25</max>
</malaysia>
<newdelhi>
<updated>31/01/2002 09:00</updated>
<city>newdelhi</city>
<forecast>Fine</forecast>
<min>30</min>
<max>35</max>
</newdelhi>
<newyork>
<updated>31/01/2002 09:00</updated>
<city>newyork</city>
<forecast>Very Cold</forecast>
<min>24</min>
<max>25</max>
</newyork>
<singapore>
<updated>31/01/2002 09:00</updated>
<city>singapore</city>
<forecast>rain day</forecast>
<min>31</min>
<max>35</max>
</singapore>
<tokyo>
<updated>31/01/2002 09:00</updated>
<city>tokyo</city>
<forecast>sunny day </forecast>
<min>22</min>
<max>25</max>
</tokyo>
<sydney>
<updated>31/01/2002 09:00</updated>
<city>sydney</city>
<forecast>Fine</forecast>
<min>21</min>
<max>25</max>
</sydney>
<washington>
<updated>31/01/2002 09:00</updated>
<city>washington</city>
<forecast>Fine.very cold</forecast>
<min>23</min>
<max>25</max>
</washington>
</weatherinfo>
//XML File End
8���� ���%��� 8��� ����� �[� ���%� �/;� 3A�%������ �/( �����$� %��<;��9�� �� ��� , 2: 'Source Code Starts
<%@ Page Inherits=" System.Web.UI.MobileControls.MobilePage"Language="vb" %>
<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<% @Import Namespace="System.Xml"%>
<script runat="server">
Public Sub List_ClickEventHandler(ByVal [source] As [Object], ByVal e As
ListCommandEventArgs)
Universal Knowledge Solutions s.a.l
302
Dim weatherReader As XmlTextReader = Nothing
weatherReader = New XmlTextReader(weatherFileName)
Dim selectedcity As [String] = e.ListItem.Value
While weatherReader.Read()
If weatherReader.NodeType = XmlNodeType.Element Then
If weatherReader.Name = e.ListItem.Value Then
WeatherLabel = e.ListItem.Text + ControlChars.Lf + "Weather"
If weatherReader.LocalName.Equals("updated") Then
WeatherLabel = WeatherLabel + ControlChars.Lf + weatherReader.ReadString()
End If
If weatherReader.LocalName.Equals("city") Then
WeatherLabel = WeatherLabel + weatherReader.ReadString()
End If
If weatherReader.LocalName.Equals("forecast") Then
WeatherLabel = WeatherLabel + weatherReader.ReadString()
End If
If weatherReader.LocalName.Equals("min") Then
WeatherLabel = WeatherLabel + "Min Temperature:" + weatherReader.ReadString()
End If
If weatherReader.LocalName.Equals("max") Then
WeatherLabel = WeatherLabel + "Max Temperature:" + weatherReader.ReadString()
End If
End If
End If
End While
ActiveForm = weather
End Sub 'List_ClickEventHandler
</script>
'List of cities
<mobile:Form runat="server">
<mobile:Label runat="server">Select a City</mobile:Label>
<mobile:List runat="server" id="Listcityvalue"
OnItemCommand="List_ClickEventHandler" >
<item Text="Auckland" Value="auckland" />
<item Text="Chennai" Value="chennai" />
<item Text="Hong Kong" Value="hongkong" />
<item Text="Mumbai" Value="mumbai" />
<item Text="Malaysia" Value="malaysia" />
<item Text="New Delhi" Value="newdelhi" />
<item Text="New York" Value="newyork" />
<item Text="Sydney" Value="sydney" />
<item Text="Singapore" Value="singapore" />
<item Text="Tokyo" Value="tokyo" />
<item Text="Washington" Value="washington" />
</mobile:List>
</mobile:Form>
<mobile:Form runat="server" id="SecondForm">
<mobile:Label runat="server" id="WelcomeMessage" />
</mobile:Form>
<mobile:Form id="weather" runat = "server">
<mobile:Label runat="server" id="WeatherLabel"/>
</mobile:Form>
'Source Code End
�41�� 2�� ��* B�4, ��� ��14�� �� A��� ���%��� 8��� C�%�\� ���F ���� <�7�.
Universal Knowledge Solutions s.a.l
303
B �C � ��C� �
��-��� �/( �, '���� �/( !�; ������ �� N/�� '������ !�" A��� T � � �����"; 8 4�� �$ D � �T � ��� '������ �/�� ���� % @ �����$� %��< �� ���� �� 2 1����� ������ �*% !�" ��4��� ?��� ?�$, 5��0� �/(
8�� ��9�. $� !�; ��4��� �� '������ ���� D � '�0� %�$� %��<G ����� T � � �� ����-� 2�L� �0� % ���� '�
�(��% %��� . '������ ��� ./( �����$� %��<; '� 2� B���� �� , �� ���� � ����� 3%��� �,� B� '�F N/�� %� ��� <1�
8�� ��9� B� ��9� '�0�. ���� � 3�"�F '������ '���MS Access � ���� '������ '���� ��-��� �/( E� TblUser� TblStock
3%��� ./( �, '����C#
TblUser
UserID Text
Pwd Text
TblStock
User ID Text
StockSymbols Text
������ ��� TblStock��9��� W�/� ���� ��� �4���� '�0� ��%9I� ��9�� �� �����$��� :
User ID Stock Symbols
User1 MSFT
User2 CSCO,NT,XRX
�<�7� :�� �����$� � ��� '�" ��$, '�<� �, �� ���� �� ��� E� ��� H %4�� ����9� %�� ���.
2���� !�; ��% P��� K$� A�%�; ?�� ����� web.config: <authentication mode="Forms" >
<forms loginUrl="login.aspx" name=".ASPXCOOKIEAUTH" path="/">
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>
� ��14�� �, C/����� ���� H�4�� � ���� �� T����� � ��" ���� ������ ��% P��login.aspx ����; '� D �
Universal Knowledge Solutions s.a.l
304
�(�$�� %�%��� ����� � ���� '� �, ���� ��� ��14�� !�; ��14�� ./( �� '������ B ��� '� C/����� '�� B� �� ���F '� ��� .����� � �� ��14 ' �4�� ?�� �����.
���� � 3�"�F '����� ��%��� �F �d�� ��� �Access ���� ��� �"���� ��4��� 8���� '����� %4�" %�� '���,
OleDbConnectionA�9�;� �����"; �*� W�/� ���� ��� 3�"�F !�" �� ��4�� ConnectionString. 8���� '����� %4�" %�� '��� �(�$�Command �4�� ����� ?�* � SQL:
SELECT COUNT(UserID) AS Expr1 FROM tblUser WHERE (Pwd = ?) AND (UserID =?)
K%@ '����� '� Command '������ �� T����� 8��� %� !�" %����� �4���� D���� S��$� �� % H*� ������ ���%���btnLogin.
Private Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs)
oleDbCommand1.Parameters.Add("Pwd", OleDbType.VarChar, 50)
oleDbCommand1.Parameters("Pwd").Value = txtPwd.Text
oleDbCommand1.Parameters.Add("UserID", OleDbType.VarChar, 50)
oleDbCommand1.Parameters("UserId").Value = txtUser.Text
oleDbConnection1.Open()
Dim nCount As Integer = CInt(oleDbCommand1.ExecuteScalar())
oleDbConnection1.Close()
If nCount = 1 Then
MobileFormsAuthentication.RedirectFromLoginPage(TextBox1.Text, True)
End If
End Sub 'btnLogin_Click
����� � 5� � ����: '�0� %�$� ' F %�<�� '�0� ���%� '������ '� B , %�< � �� C/��� �� ��( � �0� ����14 2�L��
���� ��*. �"G� �7 *1� � �$� '������ ��� �������� ����.
Universal Knowledge Solutions s.a.l
305
���� �� �( 5 �%��� 5�� C/����� �/( �, %4��$��Label – TextBox-Button-Button-ObjectList '��� '������ !�" 2%$��� �4���� '������ Context.User.Identity.Name
'��� %4�" �,�*\� '��� ������ � ��� ��������� ���F ���� �� % �� #1���OleDbConnection %4�"� '���OleDbCommand �4���� ����� CommandText �� ��� !�; :
SELECT StockSymbols, UserId FROM tblStock WHERE (UserId = ?)
��9�� ��14�� � ���� ���%��� 8��� /�L : Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
If Not IsPostBack Then
UserName = Context.User.Identity.Name
Label1.Text = UserName
TextBox1.Text = GetSymbolsForUser()
FillQuotes(TextBox1.Text)
End If
End Sub 'Page_Load
Code Snippet : Display the user's preferences and the values of the stock quotes.
Private Function GetSymbolsForUser() As String
oleDbCommand1.Parameters(0).Value = Context.User.Identity.Name
oleDbConnection1.Open()
Dim strSymbols As String = CStr(oleDbCommand1.ExecuteScalar())
oleDbConnection1.Close()
Return strSymbols
End Function 'GetSymbolsForUser
���� ����� ��, '�0� %�$� %��<\� '��� ���� �� % ��:
Private Sub FillQuotes(ByVal strSymbols As String)
Dim req As HttpWebRequest
Dim res As HttpWebResponse
Dim sr As StreamReader
Dim strResult As String
Dim temp() As String
Dim temp1() As String
Universal Knowledge Solutions s.a.l
306
Dim strcurindex As String
Dim fullpath As String
Dim ds As New DataSet
ds.Tables.Add("tblStk")
Dim SymbolColumn As New DataColumn
SymbolColumn.DataType = System.Type.GetType("System.String")
SymbolColumn.AllowDBNull = True
SymbolColumn.Caption = "Symbol"
SymbolColumn.ColumnName = "StkSymbol"
SymbolColumn.DefaultValue = "Stock"
' Add the column to the table.
ds.Tables("tblStk").Columns.Add(SymbolColumn)
'get stock quote for each row
Dim PriceColumn As New DataColumn
PriceColumn.DataType = System.Type.GetType("System.Decimal")
PriceColumn.AllowDBNull = True
PriceColumn.Caption = "Price"
PriceColumn.ColumnName = "StkPrice"
PriceColumn.DefaultValue = 0
' Add the column to the table.
ds.Tables("tblStk").Columns.Add(PriceColumn)
temp = strSymbols.Split(separator)
If temp.Length > 0 Then
Dim i As Integer
For i = 0 To temp.Length - 1
fullpath = "http://quote.yahoo.com/d/quotes.csv?s=" + temp(i) +
"&f=sl1d1t1c1ohgvj1pp2owern&e=.csv"
Try
req = CType(WebRequest.Create(fullpath), HttpWebRequest)
res = CType(req.GetResponse(), HttpWebResponse)
sr = New StreamReader(res.GetResponseStream(), Encoding.ASCII)
strResult = sr.ReadLine()
sr.Close()
temp1 = strResult.Split(separator)
If temp1.Length > 1 Then
'only the relevant portion.
strcurindex = temp1(1)
Dim myRow As DataRow = ds.Tables("tblStk").NewRow()
myRow(0) = temp(i)
myRow(1) = Convert.ToDecimal(strcurindex)
ds.Tables("tblStk").Rows.Add(myRow)
End If
Catch
End Try
Next i
ObjectList1.DataSource = ds.Tables("tblStk").DefaultView
ObjectList1.DataBind()
ObjectList1.TableFields = "StkSymbol;StkPrice"
End If
End Sub 'FillQuotes
����$�� �4���� �� % �� ��� %� %�� D��Refresh Quote
Private Sub Command3_Click(ByVal sender As Object, ByVal e As System.EventArgs)
FillQuotes(GetSymbolsForUser())
End Sub 'Command3_Click
Universal Knowledge Solutions s.a.l
307
'������ ���� ��� 3�"��� ��4�7� ?���� �$����� �� % �� #1� '����� !�; L��� '������� �4���� ���%�� D ����� K%@Connection K%@� Command E� �� F � ���CommandText �� ��� !�;
UPDATE tblStock SET StockSymbols = ? WHERE (UserId = ?)
'7$� �7��$��� % %��� <�7� ��� ��( '���SQL =�� ��*1��� '�0�� �4���� ���%�� D ���� W�/� '������.
Private Sub Command2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
oleDbCommand2.Parameters(0).Value = TextBox1.Text
oleDbCommand2.Parameters(1).Value = Context.User.Identity.Name
oleDbConnection1.Open()
oleDbCommand2.ExecuteNonQuery()
oleDbConnection1.Close()
FillQuotes(GetSymbolsForUser())
End Sub 'Command2_Click
�� ��� ��, C�%��� � �� %� P* D�� S��$�� 8���� ���%��� 8��� ���:
Private Sub Command1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
MobileFormsAuthentication.SignOut()
RedirectToMobilePage("login.aspx")
End Sub 'Command1_Click
EF�� �� ���7��� '� , '�0� %�$� ���� � %�4� ���Yahoo W�/ � S���%��� ������ 8��� �, �% �� 5��
������ %���� ��. fullpath = "http://quote.yahoo.com/d/quotes.csv?s=" + temp(i) +
"&f=sl1d1t1c1ohgvj1pp2owern&e=.csv"
Universal Knowledge Solutions s.a.l
308
S���%��� ������ 8��� �� �� ,:
2����Default.aspx
<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage" Language="VB"
Debug="true" %>
<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Data"%>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Web.Mobile" %>
<script runat="server" language="VB">
Public str As [String]
Public strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\inetpub\wwwroot\Prsnlmob\db1.mdb"
Private separator As Char() = ","c
Protected oleDbConnection1 As OleDbConnection
Protected oleDbCommand1 As OleDbCommand
Protected oleDbCommand2 As OleDbCommand
Private strUserName As String
Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
oleDbConnection1 = New OleDbConnection(strConn)
oleDbCommand1 = New OleDbCommand
oleDbCommand2 = New OleDbCommand
If Not IsPostBack Then
strUserName = Context.User.Identity.Name
Label1.Text = strUserName
TextBox1.Text = GetSymbolsForUser()
Universal Knowledge Solutions s.a.l
309
End If
End Sub 'Page_Load
Private Sub Command1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
'Signout
MobileFormsAuthentication.SignOut()
RedirectToMobilePage("login.aspx")
End Sub 'Command1_Click
Private Sub FillQuotes(ByVal strSymbols As String)
'this function will fetch stock quotes for each stock symbol specified by the user
and populate the data in a datatable. The data is finally bound to an ObjectList.
Dim req As HttpWebRequest
Dim res As HttpWebResponse
Dim sr As StreamReader
Dim strResult As String
Dim temp() As String
Dim temp1() As String
Dim strcurindex As String
Dim fullpath As String
Dim ds As New DataSet
ds.Tables.Add("tblStk")
Dim SymbolColumn As New DataColumn
SymbolColumn.DataType = System.Type.GetType("System.String")
SymbolColumn.AllowDBNull = True
SymbolColumn.Caption = "Symbol"
SymbolColumn.ColumnName = "StkSymbol"
SymbolColumn.DefaultValue = "MSFT"
' Add the column to the table.
ds.Tables("tblStk").Columns.Add(SymbolColumn)
'get stock quote for each row
Dim PriceColumn As New DataColumn
PriceColumn.DataType = System.Type.GetType("System.Decimal")
PriceColumn.AllowDBNull = True
PriceColumn.Caption = "Price"
PriceColumn.ColumnName = "StkPrice"
PriceColumn.DefaultValue = 0
' Add the column to the table.
ds.Tables("tblStk").Columns.Add(PriceColumn)
temp = strSymbols.Split(separator)
If temp.Length > 0 Then
Dim i As Integer
For i = 0 To temp.Length - 1
fullpath = "http://quote.yahoo.com/d/quotes.csv?s=" + temp(i) +
"&f=sl1d1t1c1ohgvj1pp2owern&e=.csv"
'
Try
req = CType(WebRequest.Create(fullpath), HttpWebRequest)
res = CType(req.GetResponse(), HttpWebResponse)
sr = New StreamReader(res.GetResponseStream(), Encoding.ASCII)
strResult = sr.ReadLine()
sr.Close()
temp1 = strResult.Split(separator)
If temp1.Length > 1 Then
'only the relevant portion .
strcurindex = temp1(1)
Dim myRow As DataRow = ds.Tables("tblStk").NewRow()
myRow(0) = temp(i)
myRow(1) = Convert.ToDecimal(strcurindex)
ds.Tables("tblStk").Rows.Add(myRow)
End If
Catch
End Try
Universal Knowledge Solutions s.a.l
310
ObjectList1.DataSource = ds.Tables("tblStk").DefaultView
ObjectList1.DataBind()
ObjectList1.TableFields = "StkSymbol;StkPrice"
End If
End Sub 'FillQuotes
Private Sub Command2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
'the following code will update the Stock Symbol preferences as specified by the
user.
oleDbCommand2.Connection = oleDbConnection1
oleDbCommand2.CommandText = "UPDATE tblStock SET StockSymbols = ? WHERE
UserId = ?)"
oleDbCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("StockSymbols",
System.Data.OleDb.OleDbType.VarWChar, 255, "StockSymbols"))
oleDbCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_UserId",
System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input,
False, CType(0, System.Byte), CType(0, System.Byte), "UserId",
System.Data.DataRowVersion.Original, Nothing))
oleDbCommand2.Parameters(0).Value = TextBox1.Text
oleDbCommand2.Parameters(1).Value = Context.User.Identity.Name
oleDbConnection1.Open()
oleDbCommand2.ExecuteNonQuery()
oleDbConnection1.Close()
FillQuotes(GetSymbolsForUser())
End Sub 'Command2_Click
Private Sub Command3_Click(ByVal sender As Object, ByVal e As System.EventArgs)
'Refresh the stock quotes
FillQuotes(GetSymbolsForUser())
End Sub 'Command3_Click
Private Function GetSymbolsForUser() As String
'Fetch the preferences specified by the user from the database
oleDbCommand1.Connection = oleDbConnection1
oleDbCommand1.CommandText = "SELECT StockSymbols, UserId FROM tblStock WHERE (UserId
?)"
Me.oleDbCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("UserId",
System.Data.OleDb.OleDbType.VarWChar, 50, "UserId"))
oleDbCommand1.Parameters(0).Value = Context.User.Identity.Name
oleDbConnection1.Open()
Dim strSymbols As String = CStr(oleDbCommand1.ExecuteScalar())
oleDbConnection1.Close()
Return strSymbols
End Function 'GetSymbolsForUser
</script>
<mobile:Form id = "Form1" runat="server">
<mobile:Label id="Label1" runat="server">Label</mobile:Label>
<mobile:TextBox id="TextBox1" runat="server"></mobile:TextBox>
<mobile:Command id="Command2" runat="server"
onClick="Command2_Click">Update Stock Symbols</mobile:Command>
<mobile:Command id="Command3" runat="server" onClick="Command3_Click">Refresh
Quotes</mobile:Command>
<mobile:ObjectList id="ObjectList1" runat="server" LabelStyle-StyleReference="title"
CommandStyle-StyleReference="subcommand"></mobile:ObjectList>
<mobile:Command id="Command1" runat="server"
OnClick="Command1_Click">Logout</mobile:Command>
</mobile:Form>
2�����Login.aspx <%@ Page Inherits="System.Web.UI.MobileControls.MobilePage" Language="VB"
Debug="true" %>
<%@ Assembly Name="System.Web" %>
Universal Knowledge Solutions s.a.l
311
Assembly="System.Web.Mobile" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Data"%>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.web" %>
<%@ Import Namespace="System.web.Security" %>
<%@ Import Namespace="System.Web.Mobile" %>
<script runat="server" language="VB">
Public str As [String]
Public strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\
inetpub\wwwroot\Prsnl\db1.mdb"
Protected oleDbCommand1 As OleDbCommand
Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
oleDbConnection1 = New OleDbConnection(strConn)
oleDbCommand1 = New OleDbCommand
End Sub 'Page_Load
Private Sub Command1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
'login using the credentials specified by the user
oleDbCommand1.Connection = oleDbConnection1
oleDbCommand1.CommandText = "SELECT COUNT(UserID) AS Expr1 FROM tblUser WHERE (Pwd =
?) AND (UserID = ?)"
oleDbCommand1.Parameters.Add("UserId", OleDbType.VarChar, 50)
oleDbCommand1.Parameters(0).Value = txtPwd.Text
oleDbCommand1.Parameters.Add("UserId", OleDbType.VarChar, 50)
oleDbCommand1.Parameters(1).Value = txtUser.Text
oleDbConnection1.Open()
Dim nCount As Integer = CInt(oleDbCommand1.ExecuteScalar())
oleDbConnection1.Close()
If nCount >= 1 Then
MobileFormsAuthentication.RedirectFromLoginPage(txtUser.Text, True)
End If
End Sub 'Command1_Click
</script>
<mobile:Form id = "Form1" runat="server">
<mobile:Label id="Label1" runat="server">ID:</mobile:Label>
<mobile:TextBox id="txtUser" runat="server"></mobile:TextBox>
<mobile:Label id="Label2" runat="server">Password:</mobile:Label>
<mobile:TextBox id="txtPwd" runat="server" Password="True"></mobile:TextBox>
<mobile:Command id="cmdLogin" runat="server"
onClick="Command1_Click">Login</mobile:Command>
</mobile:Form>
2���� /�L �Web.config ��9�� � �$��� �$� : <?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation defaultLanguage="VB" debug="true"/>
<customErrors mode="Off" />
<authentication mode="Forms" >
<forms loginUrl="login.aspx" name=".ASPXCOOKIEAUTH" path="/">
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>
<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime"
localOnly="true"/>
Universal Knowledge Solutions s.a.l
312
sqlConnectionString="data source=127.0.0.1;user id=sa;password=" cookieless="true"
timeout="20" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
| <httpRuntime useFullyQualifiedRedirectUrl="true" />
<mobileControls cookielessDataDictionaryType="System.Web.Mobile.CookielessData" />
<deviceFilters>
<filter name="isHTML32" compare="PreferredRenderingType" argument="html32" />
<filter name="isWML11" compare="PreferredRenderingType" argument="wml11" />
<filter name="isCHTML10" compare="PreferredRenderingType" argument="chtml10" />
<filter name="isGoAmerica" compare="Browser" argument="Go.Web" />
<filter name="isMME" compare="Browser" argument="Microsoft Mobile Explorer" />
<filter name="isMyPalm" compare="Browser" argument="MyPalm" />
<filter name="isPocketIE" compare="Browser" argument="Pocket IE" />
<filter name="isUP3x" compare="Type" argument="Phone.com 3.x Browser" />
<filter name="isUP4x" compare="Type" argument="Phone.com 4.x Browser" />
<filter name="isEricssonR380" compare="Type" argument="Ericsson R380" />
<filter name="isNokia7110" compare="Type" argument="Nokia 7110" />
<filter name="prefersGIF" compare="PreferredImageMIME" argument="image/gif" />
<filter name="prefersWBMP" compare="PreferredImageMIME" argument="image/vnd.wap.wbmp"
/>
<filter name="supportsColor" compare="IsColor" argument="true" />
<filter name="supportsCookies" compare="Cookies" argument="true" />
<filter name="supportsJavaScript" compare="Javascript" argument="true" />
<filter name="supportsVoiceCalls" compare="CanInitiateVoiceCall" argument="true" />
</deviceFilters>
</system.web>
</configuration>
Universal Knowledge Solutions s.a.l
313
��&�=� ��@��<:
http://www.w3schools.com/dotnetmobile/default.asp 1
http://www.aspnextgen.com/MobileQuickStart/(qz3zc5ygksjxka45e4wwv2uf)/Default.aspx 2
http://www.asp.net/default.aspx?tabIndex=3&tabId=44 3
http://www.wirelessdevnet.com/channels/wap/ 4
http://www.microsoft.com/downloads/details.aspx?FamilyID=8fb566e0-3e92-40e8-b5d4-
091d05ab8829&DisplayLang=en 5
http://www.ondotnet.com/pub/a/dotnet/2004/02/23/mobilewebserviceapps.html 6