ASP.NET

ASP.NET – A Wonderful world of web development.
So many secrets to share
So many tricks to learn


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 »

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 »

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 »

ASP.NET Combine Validators and Client OnClick Events

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

  Imagine you need to use control validators, and you also need to attach  additional logic to OnClick event. These two will fight with each other, if you use conventional interface features. If you add OnClick attribute too early (say in GridView_RowEditing event)  it will be overwritten by Validators.  If you add OnClick  attribute very late (say in  Render event) Validators logic will be lost. To make this work, you need to  use a special JavaScript function that combines both procedures. Here is how you do it: You need to change  a few things on the button that causes validation:                     <asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="false"                         OnClientClick="return isValid(this);" ImageUrl="~/Images/Update32x32.png"                         Text="Update"…

Read more »

Using Ajax Toolkit Controls on Pages With Other Scripts and Master Pages

2017/04/25
By
Modified: 2017/03/03
Ajax Extended Calendar

[ASP.NET – This  material was tested on Win7, W2K8 Server,  IS7 and IIS 7.5  and Microsoft Visual Web Developer 2010]   Install Proper Version Download and unzip proper version form http://ajaxcontroltoolkit.codeplex.com/releases/view/76976 Open the site where you intend to uses Ajax Controls, Follow  generic instruction and add a new control tab inside your Visual Studio or Web Dev. By doing this, you copy a file “AjaxControlToolkit.dll” and others into your site Bin directory. Text file  “/Bin/AjaxControlToolkit.dll.refresh” has a pointer to a folder where you unzipped your Ajax Toolkit. If you move Toolkit installation files somewhere, you can always update the pointer manually.   Use Ajax Control Open the page that you intend to…

Read more »

Store ASP.NET User Security Inside Your SQL Database

2017/04/21
By
Modified: 2017/03/03

How to move all ASP.NET security tables to your custom SQL database and how make it all work together. Consists of three steps: -01- Create security tables in your current custom database; -02- Generate a machine key -03- Modify web.config

Read more »