views:

34

answers:

1

Hi,

I am using an SMS Gateway to make my application receive SMSs. For this, the SMS Gateway sends a request to one of the pages in my application with the message as a querystring parameter. eg. http://myapplication/SMSReceiver.aspx?Message=PaulaIsHome.

Now after my page gets invoked, I need to send an OK response to the SMS Gateway so that it doesn't keep retrying to send the same message to my application again and again. I cannot figure out how to send the OK response.

I am using ASP .Net and C#.

Thanks

A: 

You are invoking an ASPX page, so I am guessing that a bunch of HTML is being returned in the response. Use a generic handler instead (this is what they are for), and then you can easily control all of the output...

context.Response.ContentType = "text/plain"
context.Response.Write("OK")
context.Response.End()
Josh Stodola