File Structure


β”œβ”€β”€ customTable.aspx
(Data display)
β”œβ”€β”€ customTable.aspx.cs
(Code-behind for display)
β”œβ”€β”€ admCustomTable.aspx
(Admin configuration)
β”œβ”€β”€ admCustomTable.aspx.cs
(Code-behind for admin)
β”œβ”€β”€ /styles/
β”‚ └── customTable.css (Styling)
β”œβ”€β”€ /scripts/
β”‚ └── customTable.js (JavaScript)
β”œβ”€β”€ /images/customTable/
β”‚ β”œβ”€β”€ /thumbs/ (Thumbnails)
β”‚ └── (uploaded images)
└── /install/
β”œβ”€β”€ installCustomTable.aspx
(Installer)
└── installCustomTable.aspx.cs
(Installer code-behind)

πŸ” Search function tips

⚠️ Note: The search function works only within the custom table. Not the entire website.

space OR - at least one word my text
+ AND - all words my+text
! or " Exact phrase !my text or "my text"
- Exclude my -voice
πŸ“Œ Searches in: text, dates, numbers & bools

Best Practices

Configure permissions carefully
Set appropriate read/write levels for each column

Use pagination
Enable pagination for tables with more than 50 records


Monitor uploads
Regularly clean up unused images from the upload folder

Test changes first
Test configuration changes with a small dataset first

Use HTTPS URLs
Encourage HTTPS for external image URLs

Keep metadata cached
Allow metadata caching for better performance

Review logs
Regularly check /App_Data/pro_custom.log for security events

Backup before changes
Always backup your database before major configuration changes

Export
- Set Min Export Level appropriately for your data sensitivity,
- Monitor export logs in
/App_Data/pro_custom.log,
- Consider rate limiting when exporting large datasets.

Security
- Review **Read Levels** before enabling export for lower-level users,
- Test export with different user levels to verify permissions,
- Enable **Allow Export** only if needed.

Parameter Recommendations

Use Case Max Visible Columns Page Size Paging Threshold
Administration 10-15 20-50 50
Catalogue/Products 8-12 30-50 100
Simple Lists 3-5 20-30 50
Data Entry 5-8 10-20 30
Reports/Logs 12-19 50-100 200
Mobile View 3-5 10-15 30

Troubleshooting

Error: "No metadata found"
Possible Causes Solutions
CustomMeta table is empty Go to Admin β†’ Custom Table Configuration
Admin configuration hasn't been run Click "Reset to Default" to create default configuration

Error: "Object reference not set to an instance of an object"
Possible Causes Solutions
Metadata not loaded correctly Clear cache: Cache.Remove("CustomMeta")
Cache issues Restart the application pool

Error: "Type of value has a mismatch with column type"
Possible Causes Solutions
Date column contains '0000-00-00' or '0001-01-01' Update date columns to NULL: UPDATE customData SET fDate1 = NULL WHERE fDate1 = '0000-00-00'
Invalid data type in database Ensure connection string includes: AllowZeroDateTime=True; ConvertZeroDateTime=True

Error: "Error saving configuration"
Possible Causes Solutions
Repeater/GridView not bound correctly Ensure col_File1_DataType is set to 'FILE'
Missing column in database Run the SQL script to update the schema

Error: File upload not working
Possible Causes Solutions
col_File1_DataType is not 'FILE' Update: UPDATE customMeta SET col_File1_DataType = 'FILE' WHERE Id = 1
Upload path doesn't exist Ensure folders exist: /images/customTable/ and /images/customTable/thumbs/

Error: "Rate limit exceeded"
**Cause:** More than 30 requests per minute from same IP
**Solution:** Wait a moment and try again

Error: "Max record limit reached"
**Cause:** Query would return more than 10,000 records
**Solution:** Add WHERE filters to narrow the result set

Error: CSV Export not working
**Cause:** User level below MinExportLevel or AllowExport is false
**Solution:** Check admin configuration and user permissions

Error: Header preview not showing
**Cause:** JavaScript error or missing header ID
**Solution:** Check browser console for errors, ensure header has `id="adminHeader"`


Custom Table Module

- a Flexible Data Management Solution

Overview

The Custom Table is a dynamic data management tool for the n-gen.net CMS that allows administrators to create and manage custom data structures without writing any code. It provides a flexible interface for defining columns, setting permissions, and managing data - all through the admin interface.

The tool is designed to replace static HTML tables with a fully configurable, intelligent data management solution that adapts to your specific needs.

What the Module Does

For End Users

Feature Description
View Data Display custom table data in a responsive grid with pagination
Search Search across multiple text columns
Sort Sort data by any visible column
Create/Edit/Delete Manage records with appropriate permissions
Image Upload Upload images with automatic thumbnail generation
External URLs Use external image URLs with HTTPS validation

For Administrators

Feature Description
Configure Columns Define which columns are visible and their labels
Set Permissions Control read/write access per column per user level
Enable Pagination Configure when and how pagination activates
Add Calculations Enable sum and average for numeric columns
Apply Filters Set WHERE clauses for data filtering
Manage Images Configure upload paths and thumbnail sizes
Column Order Drag-and-drop column reordering in admin


Features

1. Column Management

Feature Description
19 Pre-defined Columns Integers, decimals, strings, dates, booleans, and file upload
Column Visibility Show/hide individual columns
Column Labels Customise display names for each column
Column Order Drag-and-drop column reordering
Data Types Each column has a specific data type
(INT, DECIMAL, VARCHAR, TEXT, DATE, DATETIME, BOOLEAN, FILE)

2. Permission System

Feature Description
Granular Security Set read and write permissions per column per user level
User Levels Guest (0), Registered (1), Authenticated (2), Admin (3), Owner (4)
Column-Level Access Control exactly who can see and edit each column
Automatic Detection Logged-in users skip certain validation checks

3. Data Management

Feature Description
Full CRUD Create, Read, Update, Delete operations
Pagination Configurable page size and activation threshold
Search Search across text columns
Sorting Sort by any visible column
Calculations Sum and average for numeric columns
Modal Editing All data fields in a clean modal dialog

4. Image Handling

Feature Description
Upload Support Upload JPG, JPEG, WEBP, PNG, GIF images
Thumbnail Generation 240 x 240 pixel thumbnails with white borders
Original Filename Preserves original filename with automatic renaming
URL Support Use external image URLs with HTTPS validation
Full Size View Click thumbnail to view full image in new window

5. Export Data

Feature Description
User-level access control Configure minimum user level for export (Guest, Registered, Auth, Admin)
Column permissions respected Users can only export columns they have read access to
On-the-fly download No files stored on server
UTF-8 with BOM Excel compatible
Rate limiting Prevents abuse (30 requests/minute)

6. Admin Header Preview (WYSIWYG)

Feature Description
Live preview Headers update instantly when selected
No save required See changes before saving configuration
Authentic preview* Uses actual header HTML


Usage

For End Users (/customTable.aspx)

Action How to
View Data Navigate to the custom table page
Search Use the search box to filter records
Sort Click column headers to sort
Add Record Click the "+ Add Record" button
Edit Record Click the edit icon (✏️) or click any row
Delete Record Click the delete icon (πŸ—‘οΈ)
Upload Image In the edit modal, use the file input or enter a URL
Toggle Boolean Click the checkbox directly (AJAX saves instantly)

For Administrators (/admCustomTable.aspx)

Action How to
Access Admin Navigate to Admin β†’ Custom Table Configuration
Configure General Settings Set header, description, pagination, etc.
Configure Columns Set labels, visibility, permissions, and calculations
Reorder Columns Drag and drop rows using the ☰ handle
Save Configuration Click "Save Configuration" to apply changes
Reset to Default Use "Reset to Default" to restore factory settings

Configuration Properties

General Settings

Property Description Default
Header Select which site header to display First available
Table Header The title displayed above the table "Custom Data Table"
Description Optional description below the header Empty
Max Visible Columns Maximum columns shown before modal 5
Use Modal for Rest Show remaining columns in modal on click true
Show Add Button Display the "Add Record" button true
Show Search Display the search box true
Allow Export Enable/disable CSV export for users true
Min Export Level Minimum user level to export data Registered (1)

Pagination Settings

Property Description Default
Enable Paging Enable/disable pagination true
Page Size Records per page 20
Paging Threshold Records before pagination activates 50

Column Configuration

Property Description Default
Label Display name for the column Column name
Show Label Show the label in the table true
Show Data Show the data in the table true (for visible columns)
Read Level Minimum user level to read this column 0 (All)
Write Level Minimum user level to write this column 3 (Admin)
Sum Show sum in footer (numeric columns only) false
Avg Show average in footer (numeric columns only) false


Technical Details

Column Structure

The module provides 19 pre-defined columns with specific data types:

Column Group Columns Data Type
Integers fInt1, fInt2, fInt3, fInt4 INT
Decimals fDec1, fDec2 DECIMAL(10,2)
Strings fStr1, fStr2 VARCHAR(250)
Text fStr3, fStr4 TEXT
URL fStr5 VARCHAR(500)
File fFile1, fThumb1 VARCHAR(250)
Dates fDate1, fDate2, fDate3 DATE
DateTimes fDateTime1, fDateTime2 DATETIME
Booleans fBool1, fBool2 BOOLEAN

Permission Levels

Level Name Description
0 Guest Anonymous visitors (read-only)
1 Registered Self registered user who are logged-in
2 Authenticated Verified users
3 Admin Administrators (full access)
4 Owner Site owners (full access)


Security Features

Feature Description
Admin Access Only level 3+ users can access the admin configuration
Column Permissions Granular read/write permissions per column
User Detection Automatically detects logged-in users
Level-Based Access Permissions based on user level
SQL Injection Protection All queries use parameterised statements, all column names are validated against a whitelist
XSS Protection HTML encoding and sanitation on all user-supplied content
File Upload Validation MIME, extension and size validation. Uploaded images are verified using Image.FromStream()
URL Validation HTTPS validation for external URLs
CSRF Protection Token-based cross-site request forgery protection
Rate Limiting Max. 30 requests per minute per IP address to prevent abuse
Max Record Limit 10,000 records max to prevent DoS attacks
Export Access Control Configurable minimum user level for data export


Logging

The log location: /App_Data/pro_custom.log

Log Examples


File Operations:
2026-07-28 12:34:56.789 -- CustomTable -- [INFO ] -- User: Level 4 -- IP: 85.191.109.xxx -- File uploaded: img_001.jpg
2026-07-28 12:35:10.123 -- CustomTable -- [SUCCESS ] -- User: Level 4 -- IP: 85.191.109.xxx -- Record 15 updated successfully

Security Events:
2026-07-28 12:40:15.456 -- CustomTable -- [SECURITY] -- User: Level 0 -- IP: 192.168.1.1 -- Unauthorized admin page access attempt
2026-07-28 12:45:20.789 -- CustomTable -- [SECURITY] -- User: Level 1 -- IP: 10.0.0.1 -- Unauthorized edit attempt on column fInt1



Database Tables


customData (Data Storage)
Column Type Description
Id INT Primary key, auto-increment
fInt1-4 INT Integer columns
fDec1-2 DECIMAL(10,2) Decimal columns
fStr1-2 VARCHAR(250) Short text columns
fStr3-4 TEXT Long text columns
fStr5 VARCHAR(500) URL column
fFile1 VARCHAR(250) Filename for uploaded images
fThumb1 VARCHAR(250) Thumbnail filename
fDate1-3 DATE Date columns
fDateTime1-2 DATETIME DateTime columns
fBool1-2 BOOLEAN Boolean columns
CreatedBy INT User ID who created the record
CreatedAt DATETIME Creation timestamp
UpdatedBy INT User ID who last updated the record
UpdatedAt DATETIME Last update timestamp

customMeta (Configuration)
Column Type Description
Id INT Primary key
HeaderId INT Header ID from hdr table
TableHeader VARCHAR(250) Title displayed above the table
TableDescription TEXT Description below the header
col_XXX_Label VARCHAR(250) Custom label for each column
col_XXX_ShowLabel BOOLEAN Show/hide column label
col_XXX_ShowData BOOLEAN Show/hide column data
col_XXX_ReadLevel INT Minimum level to read this column
col_XXX_WriteLevel INT Minimum level to write this column
col_XXX_DataType VARCHAR(20) Data type of the column
col_XXX_Sum BOOLEAN Enable sum in footer (numeric only)
col_XXX_Avg BOOLEAN Enable average in footer (numeric only)
MaxVisibleColumns INT Maximum visible columns before modal
UseModalForRest BOOLEAN Show remaining columns in modal
ShowAddButton BOOLEAN Show "Add Record" button
ShowSearch BOOLEAN Show search box
UseWhere BOOLEAN Enable WHERE clause filtering
WhereColumn1-2 VARCHAR(50) WHERE clause columns
WhereOperator1-2 VARCHAR(10) WHERE clause operators
WhereValue1-2 VARCHAR(250) WHERE clause values
WhereLogic VARCHAR(5) AND/OR logic between conditions
EnablePaging BOOLEAN Enable pagination
PageSize INT Records per page
PagingThreshold INT Records before pagination activates
ColumnOrder TEXT JSON array with column display order
CreatedAt DATETIME Creation timestamp
UpdatedAt DATETIME Last update timestamp

AllowExport BOOLEAN| Enable/disable CSV export (default: TRUE)
MinExportLevel INT Minimum user level to export data (default: 1)
ColumnOrder TEXT JSON array with column display order

What the Tool Does For End Users View Data - Display custom table data in a responsive grid with pagination Search - Search across multiple text columns Sort - Sort data by any visible column Create/Edit/Delete - Manage records with appropriate permissions Image Upload - Upload images with automatic thumbnail generation External URLs - Use external image URLs with HTTPS validation For Administrators Configure Columns - Define which columns are visible and their labels Set Permissions - Control read/write access per column per user level Enable Pagination - Configure when and how pagination activates Add Calculations - Enable sum and average for numeric columns Apply Filters - Set WHERE clauses for data filtering Manage Images - Configure upload paths and thumbnail sizes Features a. Column Management 19 Pre-defined Columns - Integers, decimals, strings, dates, booleans, and file upload Column Visibility - Show/hide individual columns Column Labels - Customize display names for each column Column Order - Drag-and-drop column reordering (when implemented) Data Types - Each column has a specific data type (INT, DECIMAL, VARCHAR, TEXT, DATE, DATETIME, BOOLEAN, FILE) b. Permission System Granular Security - Set read and write permissions per column per user level User Levels - Guest (0), Registered (1), Authenticated (2), Admin (3), Owner (4) Column-Level Access - Control exactly who can see and edit each column Automatic Detection - Logged-in users skip certain validation checks c. Data Management Full CRUD - Create, Read, Update, Delete operations Pagination - Configurable page size and activation threshold Search - Search across text columns Sorting - Sort by any visible column Calculations - Sum and average for numeric columns Modal Editing - All data fields in a clean modal dialog d. Image Handling Upload Support - Upload JPG, JPEG, WEBP, PNG, GIF images Thumbnail Generation - 240x240 thumbnails with white borders Original Filename - Preserves original filename with automatic renaming URL Support - Use external image URLs with HTTPS validation Full Size View - Click thumbnail to view full image in new window Usage For End Users (customTable.aspx) View Data - Navigate to the custom table page Search - Use the search box to filter records Sort - Click column headers to sort Add Record - Click the "+ Add Record" button Edit Record - Click the edit icon (✏️) or click any row Delete Record - Click the delete icon (πŸ—‘οΈ) Upload Image - In the edit modal, use the file input or enter a URL For Administrators (admCustomTable.aspx) Access Admin - Navigate to Admin β†’ Custom Table Configuration Configure General Settings - Set header, description, pagination, etc. Configure Columns - Set labels, visibility, permissions, and calculations Save Configuration - Click "Save Configuration" to apply changes Reset to Default - Use "Reset to Default" to restore factory settings Configuration Properties General Settings Property Description Default Header Select which site header to display First available Table Header The title displayed above the table "Custom Data Table" Description Optional description below the header Empty Max Visible Columns Maximum columns shown before modal 5 Use Modal for Rest Show remaining columns in modal on click true Show Add Button Display the "Add Record" button true Show Search Display the search box true Pagination Settings Property Description Default Enable Paging Enable/disable pagination true Page Size Records per page 20 Paging Threshold Records before pagination activates 50 Column Configuration Property Description Default Label Display name for the column Column name Show Label Show the label in the table true Show Data Show the data in the table true (for visible columns) Read Level Minimum user level to read this column 0 (All) Write Level Minimum user level to write this column 3 (Admin) Sum Show sum in footer (numeric columns only) false Avg Show average in footer (numeric columns only) false Technical Details Column Structure The tool provides 19 pre-defined columns with specific data types: Column Group Columns Data Type Integers fInt1, fInt2, fInt3, fInt4 INT Decimals fDec1, fDec2 DECIMAL(10,2) Strings fStr1, fStr2 VARCHAR(250) Text fStr3, fStr4 TEXT URL fStr5 VARCHAR(500) File fFile1, fThumb1 VARCHAR(250) Dates fDate1, fDate2, fDate3 DATE DateTimes fDateTime1, fDateTime2 DATETIME Booleans fBool1, fBool2 BOOLEAN Permission Levels Level Name Description 0 Guest Anonymous visitors (read-only) 1 Registered Logged-in users 2 Authenticated Verified users 3 Admin Administrators (full access) 4 Owner Site owners (full access) Security Features Access Control Admin Access - Only level 3+ users can access the admin configuration Column Permissions - Granular read/write permissions per column User Detection - Automatically detects logged-in users Level-Based Access - Permissions based on user level Input Validation SQL Injection Protection - All queries use parameterized statements XSS Protection - HTML encoding on all user-supplied content File Upload Validation - Extension and size validation URL Validation - HTTPS validation for external URLs Logging The tool logs to multiple locations: Primary Log: /App_Data/pro_db.log All security events are logged Includes timestamp, user, IP, and specific reason File Operations: text 2026-07-22 12:34:56.789 -- CustomTable -- [SECURITY] -- User: Level 4 -- IP: 85.191.109.xxx -- File upload: img_001.jpg 2026-07-22 12:35:10.123 -- CustomTable -- [SUCCESS] -- User: Level 4 -- IP: 85.191.109.xxx -- Record 15 updated Security Violations: text 2026-07-22 12:40:15.456 -- CustomTable -- [BLOCKED] -- User: Level 0 -- IP: 192.168.1.1 -- Attempted to access admin page 2026-07-22 12:45:20.789 -- CustomTable -- [BLOCKED] -- User: Level 1 -- IP: 10.0.0.1 -- Unauthorized edit attempt on column fInt1 Parameter Recommendations Use Case Max Visible Columns Page Size Paging Threshold Administration 10-15 20-50 50 Catalog/Products 8-12 30-50 100 Simple Lists 3-5 20-30 50 Data Entry 5-8 10-20 30 Reports/Logs 12-19 50-100 200 Mobile View 3-5 10-15 30 Integration Examples Example 1: Basic Data Management aspx <%@ Page Language="C#" AutoEventWireup="true" CodeFile="customTable.aspx.cs" Inherits="customTable" %>

Example 2: Admin Configuration aspx <%@ Page Language="C#" AutoEventWireup="true" CodeFile="admCustomTable.aspx.cs" Inherits="admCustomTable" %>

Column Configuration

All Registered Auth Admin Owner

Troubleshooting Error: "No metadata found" Possible Causes: CustomMeta table is empty Admin configuration hasn't been run Solutions: Go to Admin β†’ Custom Table Configuration Click "Reset to Default" to create default configuration Error: "Object reference not set to an instance of an object" Possible Causes: Metadata not loaded correctly Cache issues Solutions: Clear cache: Cache.Remove("CustomMeta") Restart the application pool Error: "Type of value has a mismatch with column type" Possible Causes: Date column contains '0000-00-00' or '0001-01-01' Invalid data type in database Solutions: Update date columns to NULL: UPDATE customData SET fDate1 = NULL WHERE fDate1 = '0000-00-00' Ensure connection string includes: AllowZeroDateTime=True; ConvertZeroDateTime=True Error: "Error saving configuration" Possible Causes: Repeater/GridView not bound correctly Missing column in database Solutions: Ensure col_File1_DataType is set to 'FILE' Run the SQL script to update the schema File upload not working Possible Causes: col_File1_DataType is not 'FILE' Upload path doesn't exist Solutions: Update: UPDATE customMeta SET col_File1_DataType = 'FILE' WHERE Id = 1 Ensure folders exist: /images/customTable/ and /images/customTable/thumbs/ Best Practices Configure permissions carefully - Set appropriate read/write levels for each column Use pagination - Enable pagination for tables with more than 50 records Monitor uploads - Regularly clean up unused images from the upload folder Test changes first - Test configuration changes with a small dataset first Use HTTPS URLs - Encourage HTTPS for external image URLs Keep metadata cached - Allow metadata caching for better performance Review logs - Regularly check /App_Data/pro_db.log for security events File Structure text /CustomTable/ β”œβ”€β”€ customTable.aspx (Data display) β”œβ”€β”€ customTable.aspx.cs (Code-behind for display) β”œβ”€β”€ admCustomTable.aspx (Admin configuration) β”œβ”€β”€ admCustomTable.aspx.cs (Code-behind for admin) β”œβ”€β”€ /styles/ β”‚ └── customTable.css (Styling) β”œβ”€β”€ /scripts/ β”‚ └── customTable.js (JavaScript) └── /images/customTable/ β”œβ”€β”€ /thumbs/ (Thumbnails) └── (uploaded images) Database Tables customData (Data Storage) Column Type Description Id INT Primary key, auto-increment fInt1-4 INT Integer columns fDec1-2 DECIMAL(10,2) Decimal columns fStr1-2 VARCHAR(250) Short text columns fStr3-4 TEXT Long text columns fStr5 VARCHAR(500) URL column fFile1 VARCHAR(250) Filename for uploaded images fThumb1 VARCHAR(250) Thumbnail filename fDate1-3 DATE Date columns fDateTime1-2 DATETIME DateTime columns fBool1-2 BOOLEAN Boolean columns CreatedBy INT User ID who created the record CreatedAt DATETIME Creation timestamp UpdatedBy INT User ID who last updated the record UpdatedAt DATETIME Last update timestamp customMeta (Configuration) Column Type Description Id INT Primary key, auto-increment HeaderId INT Header ID from hdr table TableHeader VARCHAR(250) Title displayed above the table TableDescription TEXT Description below the header col_XXX_Label VARCHAR(250) Custom label for each column col_XXX_ShowLabel BOOLEAN Show/hide column label col_XXX_ShowData BOOLEAN Show/hide column data col_XXX_ReadLevel INT Minimum level to read this column col_XXX_WriteLevel INT Minimum level to write this column col_XXX_DataType VARCHAR(20) Data type of the column col_XXX_Sum BOOLEAN Enable sum in footer (numeric only) col_XXX_Avg BOOLEAN Enable average in footer (numeric only) MaxVisibleColumns INT Maximum visible columns before modal UseModalForRest BOOLEAN Show remaining columns in modal ShowAddButton BOOLEAN Show "Add Record" button ShowSearch BOOLEAN Show search box EnablePaging BOOLEAN Enable pagination PageSize INT Records per page PagingThreshold INT Records before pagination activates Last updated 22-07-2026 15:30:00

Last updated 03-08-2026 01:10:22