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

Iterate Form Fields

Posted on February 22, 2013October 26, 2015 By David Kittell
string sDiagCode = "";
int nDiagCode = 0;

NameValueCollection submittedValuesCollection = Request.Form;
foreach (string key in submittedValuesCollection.AllKeys)
	{
		if (key.Replace("ctl00$MidContentPlaceHolder$", "").Contains("chk_icd9_"))
			{
				if (submittedValuesCollection[key] == "on")
					{
						nDiagCode = nDiagCode + 1;
						sDiagCode += key.Replace("ctl00$MidContentPlaceHolder$chk_icd9_", "") + "|";
					}
			}
	}

foreach (string key in Request.Form.Keys)
	{
		if(key.Replace("ctl00$MidContentPlaceHolder$", "").Contains("additionaldiags_"))
			{
				nDiagCode = nDiagCode + 1;
				sDiagCode += Request.Form[key].Replace(".","").Trim() + "|";
			}
	}
Originally Posted on February 22, 2013
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

Code CSharp

Post navigation

Previous post
Next post

Related Posts

Get Windows Shortcut (.lnk) Details

Posted on March 17, 2016

The below will help you get the full path of a Windows shortcut (.lnk) in your program. The below examples specifically create a command-line executable file but you could use the function in your program just as well. View the full code in GitHub at https://github.com/dkittell/lnk-parser using System; using System.Collections.Generic;…

Read More

Ektron DMS File List

Posted on February 3, 2015October 26, 2015

Following my code on Ektron – DMS Content List I created this Ektron Widget <%@ Control Language="C#" AutoEventWireup="true" CodeFile="DMSFileList.aspx.cs" Inherits="widgets_DMSFileList" Debug="true" %> <asp:MultiView ID="ViewSet" runat="server" ActiveViewIndex="0"> <asp:View ID="View" runat="server"> <asp:Label runat="server" ID="lblDMSList">DMS Files</asp:Label> <asp:ListView ID="lvDMSList" runat="server" ItemPlaceholderID="aspItemPlaceholder" Visible="false"> <EmptyDataTemplate> <asp:Literal ID="litEmptyDataBasic" runat="server" Text="text" OnInit="litEmptyData_Init" /> </EmptyDataTemplate> <LayoutTemplate> <div class="form" style="max-width:…

Read More

Azure CLI – Convert VM Dynamic IP to Static IP

Posted on April 5, 2018

If you create your VM with Dynamic IPs DHCP will grab the first available IP but some VMs are best on a static IP. This script below will get the existing IP of the ipconfig and reassign it to the same ipconfig as a static IP. Dynamic_To_Static () { nic="$4"…

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