Response with plain text

0
0

How can I return a simple string (plain text) to the browser in some circumstances?
For example, by passing some parameters to the page (?mypar=1), I get only text/plain output.

  • You must to post comments
0
0

You can pass the parameters like this:

Application.Navigate("?mypar=1");

You can then get the values like so:
AlertBox.Show(Application.QueryString.ToString());
returns: mypar=1

And this returns just the value:
string[] values = Application.QueryString.GetValues(0);
AlertBox.Show(values[0]);

returns: 1

See attached sample

You might also find these forum threads to be helpful:
https://wisej.com/support/question/url-parameters
https://wisej.com/support/question/url-arguments

  • Davide Mercanti
    I explained myself poorly. I have no problem reading the parameters but (using a page) change the response type to plain text and write a simple text string to the output stream.
  • Julie(ITG)
    I’m not quite sure what you mean, can you explain in more detail? Can you provide a use case-what are you trying to achieve here?
  • Julie(ITG)
    If you want to respond to the web request returning text. That is outside of wisej.net. It’s already easily available with Asp.net through an httphandler or asp.net core through a middleware extension.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.