Android Question Post to Asp.net from B4A

Discussion in 'Android Questions' started by apty, Jun 14, 2015.

  1. apty

    apty Active Member Licensed User

    I have a B4A application that has 2 edittext and a button. I also have an asp.net page on the server that has two textboxes and a submit button. I would like to be able to pass the B4A values to the asp.net webform and automatically click the submit button for the processing to happen on the server.

    i have tried the code below but processing still doesn't happen on the server even after i get the "success!" message. Please assist

    Code:
    Sub cmdSubmit_Click
        
    Dim jobPost As HttpJob
       jobPost.Initialize(
    "JobPostName",Me)
       jobPost.PostString(
    "http://xxx.mmm.com/aa.aspx","TextBox1=bb.com&TextBox2=webmn")
    End Sub
    Sub JobDone (Job As HttpJob)
        
    Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
        
    If Job.Success = True Then
            
    Select Job.JobName
                
    Case "JobPostName"
                    
    ToastMessageShow("Success!"True)
            
    End Select
        
    Else
            
    Log("Error: " & Job.ErrorMessage)
            
    ToastMessageShow("Error: " & Job.ErrorMessage, True)
        
    End If
        Job.Release
        
    End Sub
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Can you post the html form?
     
  3. apty

    apty Active Member Licensed User

    Kindly find below

    Code:
    <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="web.aspx.cs" Inherits="webp.weba" %>
    <asp:Content 
    ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
        <style 
    type="text/css">
            .auto-style1 {
            color: 
    #000000;
                text-align: left;
            
    }
        .auto-style2 {
            color: #009900;
        }
            .auto-style3 {
                text-align: center;
            }
        </style>
    </asp:Content>


    <asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
        <p class="auto-style3">
        Email</p>
    <p class="auto-style1">
                    &nbsp;<asp:TextBox ID="TextBox1" runat="server" BorderStyle="Ridge" Width="98%"></asp:TextBox>
                      </p>
    <p class="auto-style1">
                    Folder</p>
    <p class="auto-style1">
                    <asp:TextBox ID="TextBox2" runat="server" BorderStyle="Ridge" Width="98%"></asp:TextBox>
                             </p>


    <p class="auto-style1">
                    <asp:Button ID="Button1" runat="server" Text="Submit" Width="99%" OnClick="Button1_Click" UseSubmitBehavior="False" />
                </p>
       
          
    </asp:Content>
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    This is the asp code not the generated html. You need to find out which request is sent when you click on the submit button. You can use FireBug or a similar tool to see it.
     
Loading...