locked
Phonecall Problem RRS feed

  • Question

  • User1375797696 posted

    Hey,

     

    Im working on an address book and want to use the phonecall control so that when a user selects the name they can make a phone call.

     

    Ive tried it wil setting the values on the control and it seems to have worked, but when i try to bind it to my list I get a blank screen on my emulator.

     

    i have three forms on the one aspx page.

     

    One contains a textbox and a button to search an individual, once the button is clicked the list of users matching the critera are returned.  once i click on the user name the it displays thier name and phone number, but i want it not as a link but as a link to make a phonecall.

     

     <CODE>

    FRONT END -->

        <!--START OF THE ADDRESS BOOK SECTION-->   
        <!-- START of ADDRESS BOOK Main Form -->
        <mobile:Form ID="frmAddressBook" Runat="server">
                <mobile:Command ID="mobCmdRtnDefault" OnClick="mobCmdRtnDefault_Click" Runat="server">Return Home</mobile:Command>
                <mobile:Label ID="mobLblStaffSearch" Runat="server">Enter in Staff name</mobile:Label>
                <mobile:TextBox ID="mobTxtStaffSearch" runat="server" />
                <mobile:Command ID="mobCmdStaffSearch" OnClick="mobCmdStaffSearch_Click" Runat="server">Search</mobile:Command>
            </mobile:Form>
        <!-- END of ADDRESS BOOK Main Form -->

        <!-- START of STAFF Results Form -->
        <mobile:Form ID="frmStaffResults" Runat="server">
                <mobile:Command ID="mobCmdRtnfrmAddressBook" OnClick="mobCmdRtnfrmAddressBook_Click" Runat="server">Back</mobile:Command>
                <mobile:List ID="mobListStaffResults" Runat="server">   
            <%--        <DeviceSpecific>
                        <Choice>
                            <ItemTemplate>
                                <mobile:PhoneCall ID="PhoneCall1" phonenumber='<%# eval("phone")%>' Text='<%# eval("stafffullname")%>' Runat="server" >
                                </mobile:PhoneCall>
                            </ItemTemplate>
                        </Choice>
                    </DeviceSpecific>--%>   

    <!--If i comment out the following line then the lsit of staff is returned but if i add the phonecall control it is not working-

      <mobile:PhoneCall ID="PhoneCall1" phonenumber='<%# eval("phone")%>' Text='<%# eval("stafffullname")%>' Runat="server" >

    ->
                                            <mobile:PhoneCall ID="PhoneCall1" Runat="server" PhoneNumber="02075548268" Text="name" AlternateFormat="{0}" />


       
            </mobile:List>
            </mobile:Form>
        <!-- END of STAFF Results Form -->
       
      
       
        <!-- START of STAFF Results Form -->
        <mobile:Form ID="frmPerson" Runat="server">
                <mobile:Label ID="mobLblName" Runat="server" />
            </mobile:Form>
        <!-- END of STAFF Results Form -->
    <!--END OF THE ADDRESS BOOK SECTION--> 

     

    CODE-BEHIND

    protected void Page_Load(object sender, EventArgs e) {
            //MobileCapabilities mobCaps = (MobileCapabilities)Request.Browser;
            //lblBrowser.Text = mobCaps.PreferredRenderingType;
            ActiveForm = frmAddressBook;
        }

        protected void mobCmdRtnDefault_Click(object s, EventArgs e) {
            Response.Redirect("default.aspx");
        }

        protected void mobCmdRtnfrmAddressBook_Click(object s, EventArgs e) {
            ActiveForm = frmAddressBook;
        }

        protected void mobCmdStaffSearch_Click(object s, EventArgs e) {
            ActiveForm = frmStaffResults;

            string strQuery = mobTxtStaffSearch.Text;

            mobListStaffResults.Items.Clear();


            using (conDB = new SqlConnection()) {
                conDB.ConnectionString = ConfigurationManager.ConnectionStrings["conBMS"].ConnectionString;
                conDB.Open();
                using (cmd = new SqlCommand()) {
                    cmd.Connection = conDB;
                    cmd.CommandText = "QUERY IN HERE";
                    dtrResults = cmd.ExecuteReader();
                    if (dtrResults.HasRows) {
                        while (dtrResults.Read()) {
                            mobListStaffResults.ItemsAsLinks = true;
                            mobListStaffResults.Items.Add(WValue.WStr(dtrResults["Staff ID"]) + dtrResults["StaffFullName"] + " " + WValue.WStr(dtrResults["Phone"]));
                        }
                    }
                    dtrResults.Close();
                }
            }
        }

     

    </CODE> 

     

    I have tried creating a phonecall in the code behind and adding this control to the moblistREsults but it has not worked. 

     

    Many thanks in advance.

     

    Zal 

    Thursday, May 31, 2007 5:13 AM

Answers

  • User-22218653 posted

     use wtai protocol href ........ will be more easy.... like

    <a runat="server"  href="wtai://wp/mc;+88017XXXXXX">CallMe</a>

    see this live example in my application using your internet 

    http://wap.cellbazaar.com/customerCare.aspx 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 22, 2007 12:54 AM