Skip to main content

Posts

Showing posts from 2013

Make sure "AjaxControlToolkit.Properties.Resources.NET4.resources" was correctly embedded or linked

Error Message Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "AjaxControlToolkit.Properties.Resources.NET4.resources" was correctly embedded or linked into assembly "AjaxControlToolkit" at compile time, or that all the satellite assemblies required are loadable and fully signed. Reason AjaxControlToolkit’s control load reference refers to the base System.Web.UI.Control method which is present as a part of the ASP.NET AJAX Libraries and those libraries are referenced only when the ScriptManager is referenced in the page. Solution Add ScriptManager in the page

Validating DropDownList using RequiredFieldValidator

In ASP.NET we need to validate DropDownList controls. But validating the DropDownList control with RequiredFieldValidator is not a straight forward as validating a TextBox control with RequiredFieldValidator. It requires little extra work. Following are the steps for validating a  DropDownList  with  RequiredFieldValidator Step 1: Create a DropDownList control 1: < asp:DropDownList ID ="ddlFruit" runat ="server" Height ="22px" Width ="200px" > 2: < asp:ListItem > - Select - </ asp:ListItem > 3: < asp:ListItem > Apple </ asp:ListItem > 4: < asp:ListItem > Orange </ asp:ListItem > 5: < asp:ListItem > Banana </ asp:ListItem > 6: < asp:ListItem > Pineapple </ asp:ListItem > 7: </ asp:DropDownList > Step 2: Add a RequiredFieldValidator 1: < asp:RequiredFieldValidator ID ="rfvFruit" runat =&q

Get the BIOS Serial Number with C#

Fisrt you have to import the following referenece in to your project. System.Management Sample Code 1: using System; 2: using System.Management; 3: using System.Windows.Forms; 4:   5: namespace DemoProjects 6: { 7: public partial class frmBIOSSerial : Form 8: { 9: public frmBIOSSerial() 10: { 11: InitializeComponent(); 12: } 13:   14: private void btnGet_Click( object sender, EventArgs e) 15: { 16: string serialNumber = string .Empty; 17:   18: ManagementObjectSearcher MOS = new ManagementObjectSearcher( " Select * From Win32_BIOS " ); 19: foreach (ManagementObject getserial in MOS.Get()) 20: { 21: serialNumber = getserial[ "SerialNumber" ].ToString(); 22: } 23:   24: lblSerialNumber.Text = serial