ASP.Net

Code test

Copy Text Copied Use a different Browser — 1. Insert posts INSERT INTO wp_posts ( post_author, — change to your WP user ID (usually 1) post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_name, post_modified, post_modified_gmt, post_type, comment_count, guid ) SELECT 1 AS post_author, p.DateCreated AS post_date, UTC_TIMESTAMP() AS post_date_gmt, — or convert properly if […]

Code test Read More »

Stripping Out Passwords

I have a page in my ASP.Net application where I show all of my AppSettings, connection strings, etc.  But I didn’t want to show the passwords.  I wanted something like: server=MyServer;uid=MyUserId;pwd=*******;database=MyDatabase; So here is the code to strip out the password:     private string stripPassword(string connString) { if (string.IsNullOrEmpty(connString)) return connString;   int pos

Stripping Out Passwords Read More »

Changing HTML Attributes on ASP.NET Pages in the Code Behind

Not many developers realize that you can change a plain HTML object’s attributes in the code behind without having to convert it into an ASP.Net control. So if I have a checkbox like this: <input type=”checkbox” id=”cbShowDef” name=”cbShowDef”  onclick=”javascript: show()” /> I can hide this in the code behind with: ((System.Web.UI.HtmlControls.HtmlInputCheckBox) Form.FindControl(“cbShowDef”)).Style.Add(“display”,”none”);

Changing HTML Attributes on ASP.NET Pages in the Code Behind Read More »