Sunday, February 17, 2013

How to Set default button from C# to a Content Page

Here is how we can use default button property of the form to set Default Button for a content page from Code behind using C#
 
// Setting default button
this.Master.Page.Form.DefaultButton = this.btnSubmit.UniqueID;
 
Here is how we can set default button for the page which doesn’t have Master Page
// Setting Default Button           
this.Page.Form.DefaultButton = btnSubmit.UniqueID;
 
Hope this helps!!

Sunday, February 10, 2013

File Handling by Source Control

What are the files that needs to be check in VSS for better handling of files when we do development. There are many file types and are stored and updated internally for each developer based on their own settings. So in other words these files doesn’t need to be part of Source control system. Here are the list of file types that we might need to look in as developer

You can add the following files to Visual Studio source control:

  • Solution files (*.sln).

  • Project files, for example, *.csproj, *.vbproj files.

  • Application configuration files, based on XML, used to control run-time behavior of a Visual Studio project.

But the Files that you cannot add to source control include the following:

  • Solution user option files (*.suo).

  • Project user option files, for example, *.csproj.user, *.vbproj.user files.

  • Web information files, for example, *.csproj.webinfo, *.vbproj.webinfo, that control the virtual root location of a Web project.

  • Build output files, for example, *.dll and *.exe files.

For more information

Saturday, January 26, 2013

How to get Line break in a button using HTML and CSS

Some times there are some scenarios where we might put some line breaks in buttons while doing HTML code your pages. There are few different ways that you can achieve this using HTML and CSS.

Here are few code snippets

   1: <!-- Method 1 -->
   2: <input type='submit' value='my \n button'>
   3: <!-- Method 2 Using HTML break-->
   4: <input type='submit' value='my &lt;br> button'> 
   5: <!-- Method 3: Using CSS -->
   6: <input type="submit" value="My button" style="white-space:normal"/>

Hope this helps!!

Friday, July 20, 2012

How To: Delete/Remove Services In Windows

Users can usually uninstall applications from their computers quite easily, however the same cannot be said for Windows services, of course you can disable a service, but the entry for it may still remain.

If you are looking for a way to completely delete a service from Windows here is how we can do this.

Open a command prompt, by going to Start > Run and type in cmd without the quotes and hit the Enter key.

Once a command prompt has opened up, type the command sc delete service name without the quotes

image

Once a service has been deleted you should see a message saying [SC] DeleteService SUCCESS, this should mean that the service has been deleted, to ensure that, just click on the refresh button in the services.msc window and confirm that the service has been deleted.

Note: You should always delete services in safe mode, just in case it causes you any problem, you may also want to create system restore points, just in case something goes wrong. But If you are a developer and its your own service then you don’t need to do this since you know about your service how it works.  Smile