Jim Brooks

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: Copy Text Copied Use a different Browser private string stripPassword(string connString) { if (string.IsNullOrEmpty(connString))

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: Copy Text Copied Use a different Browser <input type="checkbox" id="cbShowDef" name="cbShowDef"  onclick="javascript: show()" /> I can hide this in the code

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