Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Clear Form Field Inputs

Posted on June 10, 2014October 26, 2015 By David Kittell
ClearInputs(Page.Controls);
private void ClearInputs(ControlCollection ctrls)
{
    foreach (Control ctrl in ctrls)
    {
        if (ctrl is TextBox)
            ((TextBox)ctrl).Text = string.Empty;
        else if (ctrl is DropDownList)
            ((DropDownList)ctrl).ClearSelection();

        ClearInputs(ctrl.Controls);
    }
}

Reference: http://stackoverflow.com/questions/4872364/clearing-all-fields-in-an-asp-net-form

Originally Posted on June 10, 2014
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

C# ASPX Code CSharp

Post navigation

Previous post
Next post

Related Posts

Ektron Current Version

Posted on October 23, 2013October 26, 2015

This script will display the current Ektron version. Works In: 8.0.2, 8.5, and 8.7 SELECT convert(VARCHAR, version) AS "Current Ektron Version" FROM settings Source: http://www.skonet.com/Articles_Archive/Helpful_Sql_Scripts_for_Ektron_CMS_400_Net.aspx Originally Posted on October 23, 2013Last Updated on October 26, 2015 All information on this site is shared with the intention to help. Before any…

Read More

Age Verification

Posted on December 16, 2013October 26, 2015

private bool ValidateMemberUnderage(DateTime dtBirthday, int nYears) { if (DateTime.Today.Year – dtBirthday.Year > nYears) return true; else if (DateTime.Today.Year – dtBirthday.Year == nYears) { DateTime dtBirthdayThisYear = dtBirthday.AddYears(nYears); if (DateTime.Today >= dtBirthdayThisYear) return true; else return false; } else return false; } if (ValidateMemberUnderage(DateTime.Parse("1981-04-04"), 12) == false) { MessageBox.Show("Too Young"); }…

Read More

Mac OSX Terminal – Get Mac Internal/External IP

Posted on June 17, 2016June 7, 2019

#!/bin/bash clear # Get IP – Start ip=$(ipconfig getifaddr en0) nen=0 while [ -z $ip ]; do let nen=nen+1 eth="en$nen" #echo $eth ip=$(ipconfig getifaddr $(echo $eth)) done echo "Internal IP: " $ip # Get IP – Stop #Variables – stop #echo "External IP: " $(curl -s https://www.kittell.net/ip.php) echo "External IP:…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes