Asp.net

Currency Converter

1. Add Currency Dropdownlist in Master Page with Currency Code and  On Page Load Of Master Page: if (!IsPostBack) { if (Session[“currency”] == null) { Session[“currency”] = “INR”; } else { drpdwncurrency.SelectedValue = Session[“currency”].ToString(); } } On dropdownlist change event : Session[“currency”] = drpdwncurrency.SelectedValue; drpdwncurrency.SelectedValue = Session[“currency”].ToString(); Response.Redirect(Request.Url.ToString()); use a session as selected currency 2.AddContinue Reading “Currency Converter”

Asp.net

Email Setting with web config

In web Config add below section <system.net> <mailSettings> <smtp deliveryMethod=”Network” from=”xxx@xxxxxxx.com”> <network defaultCredentials=”false” host=”Smtp.gmail.com” password=”xxxxxxx” port=”25″ userName=”testing”/> </smtp> </mailSettings> </system.net> In Page write below code For Edit in web config. using System.Configuration; using System.Net.Configuration; using System.Web.Configuration; System.Configuration.Configuration config = System.Web.Configuration.WebConfigurationManager. OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath); System.Net.Configuration.MailSettingsSectionGroup settings = (System.Net.Configuration.MailSettingsSectionGroup) config.GetSectionGroup(“system.net/mailSettings”); settings.Smtp.Network.UserName = txtIUsername.Text.Trim(); config.Save();

Asp.net

Ms capcha with webconfig setting

Web-config setting Put Below System.webserver <system.webServer> <modules runAllManagedModulesForAllRequests=”true”/> <handlers> <add name=”MSCaptcha” verb=”GET” path=”CaptchaImage.axd” type=”MSCaptcha.CaptchaImageHandler, MSCaptcha”/> </handlers> </system.webServer> Put in http handler in system.web <httpHandlers> <add verb=”GET” path=”CaptchaImage.axd” type=”MSCaptcha.CaptchaImageHandler, MSCaptcha”/> </httpHandlers> => This capcha is server control add dll in tool box. Click here to download mscapcha.dll

Asp.net

Get a Font From Path at server side

public struct LoadedFont { public Font Font { get; set; } public FontFamily FontFamily { get; set; } } public static LoadedFont LoadFont(FileInfo file, int fontSize, FontStyle fontStyle) { var fontCollection = new PrivateFontCollection(); fontCollection.AddFontFile(file.FullName); if (fontCollection.Families.Length < 0) { throw new InvalidOperationException(“No font familiy found when loading font”); } var loadedFont = new LoadedFont();Continue Reading “Get a Font From Path at server side”

Asp.net

Paging with Datalist using pager control

Download pager control ASPnetPagerV2_8.dll Bind Datalist: string MulRowCol = Convert.ToString(PagerV2_1.PageSize); if (Request.QueryString[“pageindex”] != null) { PagerV2_1.CurrentIndex = Convert.ToInt32(Request.QueryString[“pageindex”]); PagerV2_2.CurrentIndex = Convert.ToInt32(Request.QueryString[“pageindex”]); } MatrixRow = Convert.ToInt32(MulRowCol); PagerV2_1.Visible = false; PagerV2_2.Visible = true; ViewState[“MatrixRow”] = MatrixRow; int Pagesize = PagerV2_1.PageSize; int CurrentPage = PagerV2_1.CurrentIndex;

Asp.net

Visual studio 2010 shortcut

Shortcut Description Ctrl-X or Shift-Delete Cuts the currently selected item to the clipboard Ctrl-C or Ctrl-Insert Copies the currently selected item to the clipboard Ctrl-V or Shift-Insert Pastes the item in the clipboard at the cursor Ctrl-Z or Alt-Backspace Undo previous editing action Ctrl-Y or Ctrl-Shift-Z Redo the previous undo action Ctrl-Shift-V or Ctrl-Shift-Insert PastesContinue Reading “Visual studio 2010 shortcut”