Followings are some useful shortcuts for coders:
Copy a single line - CTRL+C [Move the insertion point at the begin or end and press space bar, then press the shortcut key combination]
Cut a single line - CTRL+X [Move the insertion point at the begin or end and press space bar, then press the shortcut key combination]
Comment a line - CTRL+K, CTRL+C [Keep the insertion point any where on line and press ]
UnComment a line - CTRL+K, CTRL+U [Keep the insertion point any where on line and press ]
Put/Remove a break point - F9
Remove all break points as once - CTRL+SHFT+F9
Expand/Collapse a region- CTRL+M, CTRL+M
Intellisense - Ctrl+Space [Press CTRL again make the drop down transparent]
Build Solution - Ctrl+Shft+B
Expand All regions - Ctrl+M+P
Collapse All regions - Ctrl+M+O
New Break Point - Ctrl+B
Switch to Code view - F7
Switch to Html view - SHIFT + F7
Html ParameterInfo - CTRL + SHIFT + SPACEBAR
GoTo window - CTRL + G
CompleteWord - ALT + RIGHT ARROW
CTRL + SPACEBAR
Comment Selection - CTRL + K, CTRL + C
Uncomment Selection - CTRL + K, CTRL + U
Line Cut - CTRL + L
Line Delete - CTRL + SHIFT + L
Make Lowercase - CTRL + U
Make Uppercase - CTRL + SHIFT + U
Friday, May 21, 2010
Tuesday, May 18, 2010
Creating aspnetdb database
go to below location
C:\Windows\Microsoft.NET\Framework\v2.0.50727
find aspnet_regsql.exe and follow the wizard to creat a new database
C:\Windows\Microsoft.NET\Framework\v2.0.50727
find aspnet_regsql.exe and follow the wizard to creat a new database
Saturday, May 15, 2010
Application Hit Counter
If you wanna know ho wmany times your application page hit you could use appllication start event of Global.aspx
Global.aspx file
Application["AppHitCount"] = 0;
lblConfCode.Text = Session["confCode"].ToString();
Application["AppHitCount"] = int.Parse(Application["AppHitCount"].ToString()) + 1;
lblAppHitCounter.Text = Application["AppHitCount"].ToString();
//lable to display the hits
Global.aspx file
Application["AppHitCount"] = 0;
lblConfCode.Text = Session["confCode"].ToString();
Application["AppHitCount"] = int.Parse(Application["AppHitCount"].ToString()) + 1;
lblAppHitCounter.Text = Application["AppHitCount"].ToString();
//lable to display the hits
Wednesday, May 12, 2010
Publish a Web site
1.On the Build menu, click Publish Web Site.
2.In the Publish Web Site dialog box, click the ellipsis button (…) to browse to the location to which you want to publish the Web site.
You can write the Web site output to a local or shared folder, to an FTP site, or to a Web site that you access with a URL. You must have Create and Write permissions in the target location.
3.To be able to change the layout (but not the code) of .aspx files after publishing the Web site, select the Allow this precompiled site to be updateable check box.
4.To name strongly named assemblies using a key file or a key container, select the Enable strong naming on precompiled assemblies check box, and then click OK.
Publishing status is displayed in the taskbar. Depending on the connection speed, the size of the site and the types of content files, publishing time can vary. When publishing is completed, the status of Publish succeeded is displayed.
5.Make any configuration changes that are necessary for your site. For more information, see How to: Configure Published Web Site Projects. You might also want to encrypt specific configuration settings. For more information, see Encrypting Configuration Information Using Protected Configuration.
2.In the Publish Web Site dialog box, click the ellipsis button (…) to browse to the location to which you want to publish the Web site.
You can write the Web site output to a local or shared folder, to an FTP site, or to a Web site that you access with a URL. You must have Create and Write permissions in the target location.
3.To be able to change the layout (but not the code) of .aspx files after publishing the Web site, select the Allow this precompiled site to be updateable check box.
4.To name strongly named assemblies using a key file or a key container, select the Enable strong naming on precompiled assemblies check box, and then click OK.
Publishing status is displayed in the taskbar. Depending on the connection speed, the size of the site and the types of content files, publishing time can vary. When publishing is completed, the status of Publish succeeded is displayed.
5.Make any configuration changes that are necessary for your site. For more information, see How to: Configure Published Web Site Projects. You might also want to encrypt specific configuration settings. For more information, see Encrypting Configuration Information Using Protected Configuration.
Tuesday, May 11, 2010
Accessing Config File Mail Settings Programmatically
The .NET Framework 2.0 provides APIs for accessing settings in a configuration file. Here's how you access the mail settings of a config file programmatically:
using System.Configuration;
using System.Web.Configuration;
using System.Net.Configuration;
Configuration configurationFile = WebConfigurationManager.OpenWebConfiguration("PathToConfigFile");
MailSettingsSectionGroup mailSettings = configurationFile.GetSectionGroup("system.net/mailSettings") as MailSettingsSectionGroup;
if (mailSettings != null)
{
int port = mailSettings.Smtp.Network.Port;
string host = mailSettings.Smtp.Network.Host;
string password = mailSettings.Smtp.Network.Password;
string username = mailSettings.Smtp.Network.UserName;
}
===============================================================
object path = "~/WebRegAdmin";
Configuration config = WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath);
ConfigurationSection appSettings = config.GetSection("connectionStrings");
if (bEncrypt)
{
appSettings.SectionInformation.ProtectSection "DataProtectionConfigurationProvider");
}
else
{
appSettings.SectionInformation.UnprotectSection();
}
config.Save();
using System.Configuration;
using System.Web.Configuration;
using System.Net.Configuration;
Configuration configurationFile = WebConfigurationManager.OpenWebConfiguration("PathToConfigFile");
MailSettingsSectionGroup mailSettings = configurationFile.GetSectionGroup("system.net/mailSettings") as MailSettingsSectionGroup;
if (mailSettings != null)
{
int port = mailSettings.Smtp.Network.Port;
string host = mailSettings.Smtp.Network.Host;
string password = mailSettings.Smtp.Network.Password;
string username = mailSettings.Smtp.Network.UserName;
}
===============================================================
object path = "~/WebRegAdmin";
Configuration config = WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath);
ConfigurationSection appSettings = config.GetSection("connectionStrings");
if (bEncrypt)
{
appSettings.SectionInformation.ProtectSection "DataProtectionConfigurationProvider");
}
else
{
appSettings.SectionInformation.UnprotectSection();
}
config.Save();
Monday, May 10, 2010
log4net DLL
log4net is a tool to help the programmer output log statements to a variety of output targets. In case of problems with an application, it is helpful to enable logging so that the problem can be located. With log4net it is possible to enable logging at runtime without modifying the application binary. The log4net package is designed so that log statements can remain in shipped code without incurring a high performance cost. It follows that the speed of logging (or rather not logging) is crucial.
At the same time, log output can be so voluminous that it quickly becomes overwhelming. One of the distinctive features of log4net is the notion of hierarchical loggers. Using these loggers it is possible to selectively control which log statements are output at arbitrary granularity.
log4net is designed with two distinct goals in mind: speed and flexibility
•Support for multiple frameworks
•Output to multiple logging targets
•Hierarchical logging architecture
•XML Configuration
•Dynamic Configuration
•Logging Context
•Proven architecture
•Modular and extensible design
•High performance with flexibility
At the same time, log output can be so voluminous that it quickly becomes overwhelming. One of the distinctive features of log4net is the notion of hierarchical loggers. Using these loggers it is possible to selectively control which log statements are output at arbitrary granularity.
log4net is designed with two distinct goals in mind: speed and flexibility
•Support for multiple frameworks
•Output to multiple logging targets
•Hierarchical logging architecture
•XML Configuration
•Dynamic Configuration
•Logging Context
•Proven architecture
•Modular and extensible design
•High performance with flexibility
Friday, May 7, 2010
What is the difference between JavaScript and jQuery?
JavaScript is a language whereas jQuery is a library written using JavaScript.
Subscribe to:
Posts (Atom)