Apr
13
2013

How to fix Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list

I get this error when installing the IIS 7.5 on my Windows 7 64bit system. So after Google around to find the solution, I've figured out that some how the ASP.NET is not installed or is not installed completely because the managed handler is used. However, I had to run the ASP.NET register IIS from the command prompt to fix this problem. Here are the steps on how to solve it: Run CMD (command prompt) as Administrator Type or copy the following commands to the CMD and hit enter: %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i That's how I solved the issue. Good luck!  
Mar
24
2013

SEO add meta tags dynamically in ASP.NET C#

Here is an example how to add meta tags such as page title, meta description, and meta keywords in asp.net C#.   namespace reference use: using System.Web.UI.HtmlControls; Add the following code into your (.aspx.cs) page: protected void Page_Load(object sender, EventArgs e) { // set page title Page.Title = "Welcome to Phi's Homepage - PhiBui.com"; //Page description HtmlMeta pagedesc = new HtmlMeta(); pagedesc.Name = "Description"; pagedesc.Content ="Phi Bui is Software Engineer & IT Professional in Louisville KY"; Header.Controls.Add(pagedesc); //page keywords HtmlMeta pagekeywords = new HtmlMeta(); pagekeywords.Name = "keywords"; pagekeywords.Content = "Programmer,ASP.NET,SEO,C#,C/C++,HTML/CSS,JavaScript/JQuery,MS SQL Database,MySQL Database,PostgreSQL"; Header.Controls.Add(pagekeywords); }
Mar
24
2013

Simple way to encrypt and decrypt password or data in ASP.NET C#

For the security reasons that you wanted to encypt your password or sensitive data before storing it to the database and decypt after pulling it from the database using ASP.NET C#. Here is two simple method on how to encrypt and decrypt password:   In the code behind (aspx.cs) page, use the following code:   /// <summary> /// To encrypt the input password /// </summary> /// <param name="txtPassword"></param> /// <returns>It returns encrypted code</returns> public string EncryptPassword(string txtPassword) { byte[] passBytes = System.Text.Encoding.Unicode.GetBytes(txtPassword); string encryptPassword = Convert.ToBase64String(passBytes); return encryptPassword; } /// <summary> /// To Decrypt password /// </summary> /// <param name="encryptedPassword"></param> /// <returns>It returns plain password</returns> public string DecryptPassword(string encryptedPassword) { byte[] passByteData = Convert.FromBase64String(encryptedPassword); string originalPassword = System.Text.Encoding.Unicode.GetString(passByteData); return originalPassword; }   As you see the source code above, you would call the EncryptPassword(string txtPassword) method passing user input password in parameter to encrypt the password, from there you can save the encrypted password to the database.   When you need to decode the encrypted password, you would call the DecryptPassword(string encryptedPassword) method which passing the encrypted password in parameter to return the original password.   That's it. Have fun and good luck!
Oct
23
2012
ASP.NET // C#

Get html input text values in asp.net C# code behind

Here is how to get html input text values with out having runat="server" from asp.net c# code behind.   Example:   Front-end (.aspx) page: <input type="text" id="text1" name="text1" /> <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />   Back-end (.aspx.cs) page:  protected void Button1_Click(object sender, EventArgs e) { string getTextValues = Request["text1"].Trim();  }    OR: protected void Button1_Click(object sender, EventArgs e) { string getTextValues = Page.Request.Form["text1"].ToString();  }

Calendar

<<  October 2020  >>
MoTuWeThFrSaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar