Web Development

Windows and Linux-based Web development: PHP – Node,js – ASP.NET – C#
IIS – Apache / Visual Studio – Atom – Notepad++

Grow TextArea Height Along with User Input

2017/06/14
By
Modified: 2017/04/30
TextArea---Allow-to-Grow

There are situations, when you do not want to have scroll bars inside a TextArea. Main reason not to have scroll bars inside TextArea is to make your pages more mobile-friendly.  For example on iPhone Safari scroll bar inside TextArea will not even show up.  Another reason not to have scroll bars is to improve page readability.   When you have lots of TextArea(s) on a page,  it is much faster to review the information without scrolling inside each individual TextArea. Here is a solution that would allow you to set TextArea height exactly to the amount of information in it and grow its height as needed with user input. Your can use…

Read more »


MySQL Upgrade on Windows – Easy and Painlessly

2017/06/06
By
Modified: 2017/04/30

How to update MySQL Server on Windows Machine   Preliminary notes: These steps work for MySQL Server that is running as a service on Windows machine. These steps were tested, when MySQL data directory is located on a different drive from MySQL  installation directory.   Determine your current MySQL version.  Run MySQL command shell: ..\YourMySQLFolder\bin\mysql.exe -u root   You should see something like this: Server version: 5.5.8 MySQL Community Server (GPL)   Rename MySQL installation directory   Download a *.zip file from Oracle (not *.msi).   GA stands for “Generally Available”.   Select x32 or x64 package from: http://dev.mysql.com/downloads/mysql/   Stop MySQL Service   Create empty MySQL install directory and unzip content of…

Read more »

Control WordPress 3.X.X Admin Bar Options for Subscribers

2017/06/01
By
Modified: 2017/04/30
WP-331-Admin-Bar-Removed

WordPress admin bar contains many interesting and convenient links for admins and editors. But it is totally useless, redundant and confusing for regular users. Here is how to hide it for subscribers while viewing the site. Open your theme functions.php file and add these  lines at the very end: if(current_user_can('subscriber')) add_filter( 'show_admin_bar', '__return_false' );   To hide Admin bar while users are in Control Panel, you need to add these lines at the end of your theme style.css file: #wpadminbar { display: none; visibility: hidden; }     The final questions to answer: -01- Can we do all these changes one file and -02- How to remove an ugly empty space at the top of…

Read more »

Preventing Duplicate Inserts on Browser Refresh (F5)

2017/05/29
By
Modified: 2017/04/30

You have an insert button that inserts a record into a database. If user presses refresh (F5) button immediately after inserting a new record, more and more new records continue to be written into the database.

Read more »

How to Move MySQL D/B Files (Windows)

2017/05/27
By
Modified: 2017/04/30

Locate your MySQL installation files and central configuration file basedir="C:/Program Files/MySQL/MySQL Server 5.1/" Your MySQL configuration is stored in "my.ini" file Locate your MySQL Database location: datadir="C:/Documents and Settings/All Users/ Application Data/MySQL/MySQL Server 5.1/Data/" Stop MySQL service. Modify My.ini file to point to a new D/B location and Save. Move your Data directory to a new location Restart MySQL service. You are done.  All pages (even if you were in the middle of the editing) continue to work.  Amazing!

Read more »

WordPress Error 500 – Internal server error on Empty Comment

2017/05/17
By
Modified: 2017/04/30
WordPress Error 500 – Internal server error on Empty Comment

Problem – Embarrassing Error 500 I am running latest Word Press 3.0.1 on IIS 7.0.  If visitor tries to leave an empty comment or forgets to enter name or email, an ugly 500 – Internal server error will appear on the screen.  This is extremely embarrassing for the host and for the site. I approximately know that I have three ways to approach this problem: – Disable error 500 on IIS side to allow WordPress to handle it; – Lower level of error generated in WordPress code (IIS will not catch it then) or – Write a local JavaScript to prevent user from posting with empty fields. Solution – One click in…

Read more »

Integrating bbPress Forum with WordPress Theme

2017/05/13
By
Modified: 2017/04/30
WordPress-plus-bbPress

Problem When I was preparing to roll out bbPress forum as a part of  WordPress site,  I discovered that process of bbPress user and login integration has a very good coverage on the Internet. This article deals with integrating bbPress forum “look and feel” with WordPress. How to make bbPress forum look like your  regular WordPress page?  How to create a deep integration,  so users wouldn’t feel that they are leaving one site and now are in a completely different site. You can judge, how well this advice works based on how close our Forum interface integrated with WordPress theme. One should be able to tell the difference between bbPress styles and WordPress…

Read more »

Move WordPress to a new Windows Server 2012 on Amazon AWS

2017/05/11
By
Modified: 2017/04/30
Move WordPress to a new Windows Server 2012 on Amazon AWS

This article is about moving your Windows-based WordPress and other sites (some ASP, some ASP.NET) from older to a newer instance using AMAZON cloud server  instances.  Procedures described here do not involve any installation.  Just copy files and edit CONFIG files.  We do not manipulate Registry as well (except to change inbound RDP port). Sample installation in this article was tested on Amazon Small instance.  Image used  was Windows 2012 Server x64 with SQL Server2012 Express.  This article can be used to create you own check list while preparing to migrate to a new Amazon server. Why would you decide to upgrade or move to a new instance/server?  Here are some driving reasons:  Something is no…

Read more »

The EXECUTE permission was denied on the object ‘aspnet_CheckSchemaVersion’, database ‘YourDB’, schema ‘dbo’

2017/05/09
By
Modified: 2017/04/30

ASP.NET page returns this erorr: The EXECUTE permission was denied on the object ‘aspnet_CheckSchemaVersion’, database ‘YourDB’, schema ‘dbo’. (1) First try runing this command/wizard: %WinDir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe   (2) If this doesn’t work, try this query:  -- Add user ASPNET to DB role USE YourDB GO sp_addrolemember 'aspnet_Membership_FullAccess', 'ASPNET' These steps should resolve your issue.

Read more »

Use DELEGATE in C# to Communicate Between Controls

2017/05/05
By
Modified: 2017/04/30

As your custom ASP.NET Web control grows, you might realize that it is time to split it into two or more controls. But how new pieces will communicate with each other? This article describes how event in one control can trigger a method in other control. [Environment: Visual Studio 2008, VS2008]

Read more »