Simple Example of IF/THEN using C#

CK CK 3788 
Created at
Updated at  
1,272 0 0

A C# based webpage is a website built using C# programming language on the server-side, often using ASP.NET framework, to handle logic and data processing. C# code interacts with HTML, CSS, and JavaScript to dynamically generate web pages, retrieve data from databases, and provide interactive features. The website is then served to users' browsers as static HTML, CSS, and JavaScript files for rendering.

Simple example of IF/THEN using C#
 

<%@ Page Language="C#" %>
<script runat="server"> 

void button1_Click(Object sender, EventArgs e)
{
  if (textbox1.Text == "ASPFree.com")
  {
    Literal1.Text = "Textbox Condition was <b>True</b>";
  }
  else
  {
    Literal1.Text = "Textbox Condition was <b>False</b>";
  }
} 
</script>
<html>
<head>
</head>
<body>
<h2 align="center">Simple If/Then statement in C# 
</h2>
<p align="left">

This is simple if/then statement to help get started learning C#.


Above source is replaceable with ASP.
 

Tags C# if statement if statement Facebook X
Comments 0
  1. How to run shell command by MFC ?
    441
  2. Binary Search Sample Code
    409
  3. Double Linked List based in C++
    799
  4. String Replace Function For C#
    1,559
  5. How to print character in C# by ASCII code
    479
  6. MFC based World Wide Web HTTP Server Source Code
    462
  7. Creating and Using a CAsyncSocket Object to use CAsyncSocket
    473
  8. UDP Send and Receive Using CAsyncSocket
    1,206
  9. Using the shell to receive notification of removable media being inserted or removed
    681
  10. Adding Custom Paper Sizes To Named Printers
    651
  11. Print HTML In C# With Or Without The Web Browser Control And The Print Dialog
    972
  12. A Customizable Printing Text Class
    439
  13. Simplified .NET Printing In C#
    696
  14. How To Print Text In C#
    456
  15. C# Lists
    1,162
  16. Fast and Good Keyboard/Mouse Test without the message handler
    985
  17. Simple CGI Programming in C
    550
  18. C++ CGI Example working on Apache
    490
  19. Simple C# CGI working on Apache
    486
  20. How to send binary data through C# CGI app?
    998
  21. Interacting With TinyPic From C#
    1,314
  22. Creating A Watched Folder With Assigned Events
    1,672
  23. Calling Your Main Thread From A Worker Thread In C#
    551
  24. HashTable Tutorial In C#
    1,794
  25. Stack Tutorial In C#
    674
  26. Queue Tutorial In C#
    1,753
  27. Create PDF Files On the Fly in C#
    1,009
  28. How to call Visual C/C++ implemented DLL functions in C# - Simple DLLImport
    1,174
  29. Send Email Using C#
    1,381
  30. How To Read And Write A Cookie
    365
Recently updated
  1. Google OAuth Token Expiration: Causes and Solutions
    29
  2. Why 100% SEO Guarantees Better User Engagement and How to Achieve It in Your Service
    55
  3. Why SPF and DKIM Are Essential for Linux Email Servers?
    49
  4. How do I create animated background for Google Meet?
    22,890
  5. MaxMind GeoLite2 vs. DB-IP Lite vs. ip-api.com: Choosing the Right Free IP Geolocation Solution
    271
  6. Meet Valkey: Why Redis Changed Its License, Why Valkey is Better, and How to Use It as a Drop-in Replacement
    103
  7. How Rogue Web Scrapers Are Stealing My Content and Destroying My Server
    168
  8. Array of arguments passed to script in PHP
    97
  9. Invalid Auction Storms in Ad Tech
    106
  10. Building MRC-Compliant Instrumentation in Ad Tech: Implementation Steps and Key Challenges
    207
  11. The Two Clocks of Ad Server Architecture
    77
  12. Frequency Cap Architecture Overview
    526
  13. Collecting Proof-of-Play from 100,000 Screens
    152
  14. Vector Search in Relational Databases (RDBs): Trends & Usage Environments
    302
  15. What is RedisVL?
    114
  16. Designing a Skill Registry Architecture: Minimize Token Usage and Maximize AI Performance
    246
  17. TPU & GPU Cluster Management Tools
    257
  18. The Concept of Scaffolding in AI Agents
    244
  19. Beyond Static Pipelines: Architecting LLM Multi-Agent Systems for Autonomous Workflow Orchestration
    596
  20. AI-DLC vs. AI-SDLC: Model-Centric vs. System-Centric AI Development
    267
  21. Fine-Tuning Open-Weight LLMs: Training, Licensing, and Deploying Custom Models with Ollama
    353
  22. Inside the Next-Generation Streaming Architecture: Ultra-Low Latency, SGAI, and AI Codecs
    206
  23. Machine Learning: Training vs. Ranking
    229
  24. The Continuous Learning Machine: Designing a Loop That Actually Turns
    228
  25. The Next-Gen Low-Latency Standards: LL-HLS & MoQ
    202
  26. Designing a Data Curation System Around a Vector Database
    230
  27. Extracting Context from Live Video: The Architecture Got Simpler When We Stopped Building Features
    263
  28. The New Ad Stack Behind Live Sports Streaming: Inside SGAI, EABN, and the Standards Race to Fix Live Monetization
    671
  29. Designing MLOps Architectures to Handle Seasonal Data Drift in EV Fleet Models
    200
  30. From 15 to 40+ FPS: Accelerating PyTorch Object Detection on Automotive ECUs
    232