asp.netvb.netsmsgetresponseozeki

Send SMS to ozeki Message Server from Website


I have created a website and I want to send sms to my users. The sms is sent correctly to 0zeki server message but the problem is that it is being redirecting to the server URL, while I only want the sms to be sent and that there is no response redirect to the server can someone help please

    Dim con As New SqlConnection(_start)
    con.Open()
    Dim sql1 As String = "SELECT TOP (1) Member.PhoneNumber FROM  (SELECT  TOP (2) BidID, Date, BiddingPrice, Status, AuctionID, BuyerID, WinningPrice from BID ORDER BY BidID DESC) AS tabel1 INNER JOIN Buyer ON tabel1.BuyerID = Buyer.BuyerID INNER JOIN Member ON Buyer.MemberID = Member.MemberID INNER JOIN Auction ON tabel1.AuctionID = Auction.AuctionID WHERE(Auction.AuctionID = @auction) ORDER BY tabel1.BidID"
    Dim auction1 As Integer = Convert.ToInt32(lblauction.Text)
    Dim sqlcommand As New SqlCommand(sql1, con)
    sqlcommand.Parameters.AddWithValue("@auction", auction1)
    Dim phone As String = sqlcommand.ExecuteScalar

    Dim sql2 As String = "SELECT Item.Name FROM Item INNER JOIN Auction ON Item.ItemID = Auction.ItemID WHERE (Auction.AuctionID = @auction)"
    Dim cmd As New SqlCommand(sql2, con)
    cmd.Parameters.AddWithValue("@auction", auction1)
    Dim name As String = cmd.ExecuteScalar

    Dim message As String = "Your bid has been overbid please, Visit the Website to bid against on auction " + name + "thanks you"

    Response.Redirect("http://localhost:9333/Ozeki?login=admin&password=abc123&action=sendMessage&messagetype=SMS&recepient=" + phone + "&messageData=" + message)

Solution

  • Just replace Response.Redirect with

    WebRequest.Create("http://localhost:9333/Ozeki?login=admin&password=abc123&action=sendMessage&messagetype=SMS&recepient=" + phone + "&messageData=" + message)
    .GetResponse();
    

    It will call the service and won't redirect the page.