Posts

Encrypt web.Config sections using c# in asp.net

To give secuity to to your web application you need to make your applications secured you can encrypt the certain sections of web.config . To accomplish this task microsoft has provided library in the namespace System.Web.Configuration . To Encrypt the web.config section you can use the following code using System.Configuration.Provider; using System.Configuration.Assemblies; using System.Web.Configuration; Configuration confi = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath); ConfigurationSection section = confi.ConnectionStrings; section.SectionInformation.ProtectSection("DataProtectionConfigurationProvider"); To Decrypt the web.config section you can use the following code using System.Configuration.Provider; using System.Configuration.Assemblies; using System.Web.Configuration; Configuration confi = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath); ConfigurationSection section = confi.ConnectionStrings; section.Sec

Regular Expression for numeric field in Asp.net 2.0 & 3.5

Any new developer needed to understand importance of the validation in their application to avoid future errors or bug in application. For this purpose developer must ensure the user input to their application is proper and well handled to avoid future bug or error in the application. In the list of validation the important validation is numeric validation. in numeric validation user must enter or application must prompt the user to enter only numeric field. In asp.net we/developer normally use the Regular Expression Validation but proper regulion expression is as follows ^\d*[0-9](|.\d*[0-9]|,\d*[0-9])?$ Use this to restrict the user to enter Only numeric field give me ur feedback if any Enjoy

Javascript print() method not printing Images ? then no problem i have a solution

If you are using window.Print() method of javascript to print the page but it prints only letters and does not print images of the page then use following solution for this problem firstly try to use absolute url path in images src attribute like http://something.com/imger.jpg then it will be render correctly secondly copy and paste below code in script tag  function printContent(id){ var str=document.getElementById(id).innerHTML newwin=window.open('','printwin','left=0,top=0,width=1,height=1,menubar=no') newwin.document.write('<HTML>\n<HEAD>\n') newwin.document.write('\n') newwin.document.write('<script>\n') newwin.document.write('function chkstate(){\n') newwin.document.write('if(document.readyState=="complete"){\n') newwin.document.write('window.close()\n') newwin.document.write('}\n') newwin.document.write('else{\n') newwin.document.write('setTime

Add MouseOver and Mouseout effect to asp.net Calendar Control

When I thought that give some interesting effect to calendar control, which will improve look and feel of the Calendar I started working on it and I created the following code which I want to share following is my design code.... <div> <asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="Black" BorderStyle="Solid" CellSpacing="1" Font-Names="Verdana" Font-Size="9pt" ForeColor="Black" Height="250px" NextPrevFormat="ShortMonth" onselectionchanged="Calendar1_SelectionChanged" Width="779px" ondayrender="Calendar1_DayRender"> <SelectedDayStyle BackColor="#333399" ForeColor="White" /> <TodayDayStyle BackColor="#999999" ForeColor="White" /> <OtherMonthDayStyle ForeCo

Hello Bloggers

Hello World!!! ENTER YOUR ESCAPED CODE SNIPPET HERE