.Net Mobile

  Home  Microsoft .Net Technologies  .Net Mobile


“Microsoft .Net Mobile frequently Asked Questions by expert members with experience in .Net Mobile. These interview questions and answers on Microsoft .Net Mobile will help you strengthen your technical skills, prepare for the interviews and quickly revise the concepts. So get preparation for the Microsoft .Net Mobile job interview”



22 .Net Mobile Questions And Answers

21⟩ What is .NET Mobile Input Validation. Explain with an example?

Validation controls are used to validate an input control. They provide a message if the validation fails on the control. By default validation is applied on the command event of an input control. One can disable this by setting the input control’s causes validation property to false.

Example:

<%@ Page Inherits= "System.Web.UI.MobileControls.MobilePage"%>

<%@ Register TagPrefix="Mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %>

<script runat="server">

private void Page2(Object Sender, EventArgs e)

{

If (Page.IsValid)

{

ActiveForm=f2;

text2.Text="You are " + age.text + " years old";

}

}

</script>

<Mobile:Form id="f1" runat="server">

<Mobile:CompareValidator runat="server" ControlToValidate="txtage" Type="Integer" ValueToCompare="12" Operator="GreaterThanEqual"> You must be at least 12</Mobile:CompareValidator>

<Mobile:Label runat="server">What is your Age?</Mobile:Label>

<Mobile:TextBox id="txtage" runat="server" />

<Mobile:Command OnClick="Page2" runat="server">Submit</Mobile:Command>

</Mobile:Form>

<Mobile:Form id="f2" runat="server">

<Mobile:Label id="text2" runat="server" />

</Mobile:Form>

This will display a message if the user input is less than 12

 131 views

22⟩ What is .NET Mobile Images control. Explain with an example?

Various mobile devices have different displaying capabilities. The Image control enables developers to specify different types of images fir different devices.

Example: Devices which display GIF, some devices which display BMP or WBMP images.

<%@ Page Inherits= "System.Web.UI.MobileControls.MobilePage"%>

<%@ Register TagPrefix="Mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %>

<Mobile:Form runat="server">

<Mobile:Image runat="server">

<DeviceSpecific>

<Choice ImageURL="image1.gif" />

<Choice ImageURL="image1.bmp" />

<Choice ImageURL="image1.wbmp" />

</DeviceSpecific>

</Mobile:Image>

</Mobile:Form>

 126 views