VWD - Mobile web RRS feed

  • Question

  • User-141638621 posted

    Hi all

     i am just querying of what sort of program can you create within vwd that will work well with mobile phones - i.e. using the wml language.

    Tuesday, January 9, 2007 6:52 AM

All replies

  • User2032526919 posted


    with VWD you generally create web sites. You can add mobile web forms to a web site. Mobile web forms are ASP.NET pages using a special set of controls called mobile controls which target at mobile devices. Thanks to ASP.NET's adaptive rendering architecture they use the most suitable mechanism to render a form in a specified device. If device supports only WML it will get the form rendered with WML, but if it supports HTML 3.2 it will get that and so on. So essentially you can build the form once and get support for large set of mobile devices.

    Here's more information about mobile asp.net applications: http://www.asp.net/default.aspx?tabIndex=3&tabId=44

    Tuesday, January 9, 2007 9:27 AM
  • User-141638621 posted

    Many thanks for that,  


    Could you take me the through the steps that i need to constuct one within vwd, and then transfer it to a toolkit - so it produces the wml code.

    also, give me a example that would be useful for viewing the page on the device -- a calculator/ currency converter perhaps - any other ideas? 

    is this the 'add new item' bit where you add the mobile page.




    Is vwd better for wml than hard coding

    Tuesday, January 9, 2007 10:06 AM
  • User2032526919 posted

    Adding of the mobile page happens yes from "Add New Item Dialog". This is very silly example but demonstrates the thing.

    1. Select Add New Item -> Mobile Web Form and name it say myCalc.aspx (You didn't mention do you use VB or C# so I use VB, and I have "Place code in separate file" checked)

    2. Have the aspx as

    1    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="myCalc.aspx.vb" Inherits="myCalc" %>
    2    <%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %>
    4    <html xmlns="http://www.w3.org/1999/xhtml" >
    5    <body>
    6        <mobile:Form id="Form1" runat="server">
    7            <mobile:Label ID="lblNumber1" Runat="server">Integer 1</mobile:Label>
    8            <mobile:TextBox ID="txtNumber1" Runat="server" />
    10           <mobile:Label ID="lblNumber2" Runat="server">Integer 2</mobile:Label>
    11           <mobile:TextBox ID="txtNumber2" Runat="server" />
    13           <mobile:Command ID="btnCalSum" Runat="server" SoftkeyLabel="Add" >Add</mobile:Command>
    15           <mobile:Label ID="lblNumberSum" Runat="server" />
    16       </mobile:Form>
    17   </body>
    18   </html>

    3. Into code-behind file myCalc.aspx.vb put the code  like

    2    Partial Class myCalc
    3        Inherits System.Web.UI.MobileControls.MobilePage
    5        Protected Sub btnCalSum_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCalSum.Click
    6            Dim numberOne As Integer = Integer.Parse(txtNumber1.Text)
    7            Dim numberTwo As Integer = Integer.Parse(txtNumber2.Text)
    9            lblNumberSum.Text = numberOne.ToString() & " + " & numberTwo.ToString() & " = " & (numberOne + numberTwo).ToString()
    11       End Sub
    12   End Class

    This demonstrates you a form with three labels labels, two textboxes and a command button. Integers given to textboxes are added and the result is displayed on the sum label. You can view this page normally on your browser (right-click on the file in VWD and choose Browse with). If you'd have device emulator etc available you could biew the page in such. However, putting the page on any web server having .NET Framework 2.0 and IIS, you could view the page with almost any mobile device and it will be displayed on it.

    Tuesday, January 9, 2007 10:33 AM
  • User-141638621 posted

    Hi again,

     but this is not wml.

    The wml code contains <card> tags, and all kinds of different tags.


    what i would like to do, is to create the wml application within vwd, then transfer it to the 'nokia software', for instance: the 'nokia mobile browser' to view the page created, and the nokia developer toolkit to develop the page or pages further.

    Tuesday, January 9, 2007 1:17 PM
  • User2032526919 posted


    this was from that point that WML browser could use ASP.NET mobile page (e.g previous stuff would be rendered as WML for that device). I understood you want to develop ASP.NET mobile web application. Visual Web Developer is just web developer tool focused on ASP.NET stuff.

    Tuesday, January 9, 2007 2:01 PM
  • User-141638621 posted

    Could you send me that file that what you created, i seem to be having problems - lots of syntax errors.

     You will be able to zip it, and send it by www.savefile.com.


    Once all that is created, im i right in saying that the aspx file, can be loaded within the nokia toolkit - the microbrowser, that will generate the wml code?


    thanks for all your help


    Tuesday, January 9, 2007 5:35 PM