To a server method, the client wants to send a value 20, when this value exceeds 20 a message should be sent to the client. What will you do for achieving for this

Showing Answers 1 - 2 of 2 Answers

rajesh kumar

  • Sep 8th, 2011
 

Write a custom handler for such a request. the handler will examine the querystring value and write appropriate message using response.write. register ur handler in config, and you are through. please refer to attached code.
thanks,
Rajesh

Code
  1. Public class MyHandler() : HttpHandler

  2. {

  3.  

  4. ProcessRequest()

  5. {

  6. string value= HttpContext.current.request.Querystring["intvalue'];

  7. try

  8. {

  9.  

  10. if(Convert.ToInt32(value)>20)

  11.  

  12. HttpContext.Current.Response.Write("greater than 20");

  13. }

  14. catch(System.Exception e)

  15. {

  16. HttpContext.Current.Response.Write("data not in correct format");

  17. }

  18. }

  19.  

  20.  

  21. }

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions