I know you can do this
<%= Request.Form[0] %>
But how do you do something like this?
<% if(Request.Form[0]!=null)
echo "abc";
%>
The echo command is one of the most commonly and widely used built-in commands for Linux bash and C shells, that typically used in a scripting language and batch files to display a line of text/string on standard output or a file. 2.
In computing, echo is a command that outputs the strings that are passed to it as arguments. It is a command available in various operating system shells and typically used in shell scripts and batch files to output status text to the screen or a computer file, or as a source part of a pipeline. echo.
Output : In any programming language output means to display some data on screen, printer or in any file. C programming language provides a set of built-in functions to output required data.
Unlike some other language constructs, echo does not have any return value, so it cannot be used in the context of an expression. echo also has a shortcut syntax, where you can immediately follow the opening tag with an equals sign.
<% if(Request.Form[0]!=null)
Response.Write("abc");
%>
Maybe you want to show the form value unless it doesn't exist then show "abc"?
<%= Request.Form[0] ?? "abc" %>
Or you could can use if blocks and normal markup inside.
<% if(Request.Form[0]!=null) { %>
<div class="echo">abc</div>
<% } %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With