This topic is locked
[SOLVED]

 Sending a simple SMS

1/14/2019 6:31:51 AM
ASPRunner.NET General questions
M
Mdware author

Hi
Can anyone help me with a sending a simple text sms?

I have created a Twilio trial account and i have verified my own number for sending sms for testing purposes (i can send sms to my number from twilio),
I have then set up my twilio credentials in the miscellaneous section of saprunner10.net,

i have created a button and entered the following code on the ClientBefore event of the button


string number = "my verified personal mobile number here";

string message = "Test Sms from My app";
MVCFunctions.runner_sms(number, message);


But nothing happens when i click on the button, i have tried to move this code to server and serverAfter events but still nothing happens when i click on the button and there is no error either.
Is there anything i am missing? Maybe in the settings?
Thanks in advance for you help

Boni

admin 1/14/2019

You cannot add C# code to Javascript event such as ClientBefore. It needs to be added to Server event. No code should go to either ClientBefore or ClientAfter events.
If something doesn't work you need to follow troubleshooting steps provided in this article:

https://xlinesoft.com/asprunnernet/docs/troubleshooting_custom_buttons.htm

jadachDevClub member 1/19/2019



Hi
Can anyone help me with a sending a simple text sms?

I have created a Twilio trial account and i have verified my own number for sending sms for testing purposes (i can send sms to my number from twilio),
I have then set up my twilio credentials in the miscellaneous section of saprunner10.net,

i have created a button and entered the following code on the ClientBefore event of the button


string number = "my verified personal mobile number here";

string message = "Test Sms from My app";
MVCFunctions.runner_sms(number, message);


But nothing happens when i click on the button, i have tried to move this code to server and serverAfter events but still nothing happens when i click on the button and there is no error either.
Is there anything i am missing? Maybe in the settings?
Thanks in advance for you help

Boni


Did you ever get this to work? I would love to see your finished code to make this happen. Thanks

jadachDevClub member 1/19/2019



Did you ever get this to work? I would love to see your finished code to make this happen. Thanks


OK, this is too easy. I didn't know we could send SMS via events. I just tested and it works perfectly. This is great!!

M
Mdware author 2/26/2019

Sorry guys i have been off the forum, my subscription run out.
This is now solved, It was a school boy error i mistakenly used a number that is not verified by Twilio for testing. That's why it did not work.

the code is fine and is working, the code below on (on the ClientBefore event of the button)
string number = "my verified personal mobile number here";

string message = "Test Sms from My app";
MVCFunctions.runner_sms(number, message);