Posts

Buying or selling of Industrial Units, Plots, Machineries or Scrap

Buying or selling of industrial units, plots, machinery, or scrap in Ankleshwar, Dahej, Jaghadia, Panoli, Bharuch, and Surat.  We will help you to reach potential buyers/sellers.  Please share your details over email: himanshu.hajariwala@gmail.com

ASP.NET MVC Good Practice

http://www.codemag.com/Article/1405071

ASP.NET Identity Articles

Good articles for ASP.NET Identity: http://www.asp.net/identity/overview/getting-started/aspnet-identity-recommended-resources http://www.asp.net/identity/overview/features-api/account-confirmation-and-password-recovery-with-aspnet-identity

Entity Framework: Get Started

Following video will help you to get started with Entity Framework:   or visit http://msdn.microsoft.com/en-us/data/entity-framework-model-first

Asynchronously Streaming Video with Web API

Nice articles to learn how to use Web API beyond the classic and traditional user as API Asynchronous Streaming with Web API Asynchronously Streaming Video with Web API

MVC 4 Web API

The great video to start with MVC 4 WEB API download the following video and learn from PM of ASP.NET team http://media.ch9.ms/ch9/a9c8/95120d80-784c-453c-a3c7-36bd8897a9c8/DanRothDemonstratesWebAPIUsingVisualStudio2012RC_mid.mp4

Phone Number Auto Increment Decrement Focus

Following Jquery functions are used to set focus on text box on max length and set focus to prev text box on click of backspace when length gets zero. $(function () { $('.phoneText,.AlternatePhoneText,.FaxText').keyup(function (e) { if (e.which == 8) { if ($(this).val().length == 0)  $(this).prev(':input').focus(); } else { if ($(this).val().length == $(this).attr('maxlength'))  $(this).next(':input').focus(); } }) })  

SetProperty and GetProperty with C# Reflection

SetProperty and GetProperty with C# Reflection   private object getProperty ( object containingObject, string propertyName ) { return containingObject. GetType ( ) . InvokeMember ( propertyName, BindingFlags. GetProperty , null , containingObject, null ) ; } private void setProperty ( object containingObject, string propertyName, object newValue ) { containingObject. GetType ( ) . InvokeMember ( propertyName, BindingFlags. SetProperty , null , containingObject, new object [ ] { newValue } ) ; }

Receive Json Web response in C#

Following code use to get Json Response in My object using (var twitpicResponse = (HttpWebResponse)request.GetResponse()) {         using (var reader = new StreamReader(twitpicResponse.GetResponseStream())) {             JavaScriptSerializer js = new JavaScriptSerializer();             var objText = reader.ReadToEnd();             MyObject myojb = (MyObject)js.Deserialize(objText,typeof(MyObject));         }     }

IIS 7 : To Execute function/code for very first request only

//In Following method call to FirstRequestInitialization is done every time beginRequest called for a Application. protected void Application_BeginRequest( Object source, EventArgs e) {     HttpApplication app = ( HttpApplication )source;     HttpContext context = app.Context;     // Attempt to peform first request initialization     FirstRequestInitialization .Initialize(context); } //Following Class will check the Flag(s_InitializedAlready) and according that it will execute Initializer function and check that request comes for first time or not. class FirstRequestInitialization {     private static bool s_InitializedAlready = false ;     private static Object s_lock = new Object ();     // Initialize only on the first request     public static void Initialize( HttpContext context)   ...

Jquery Ajax call, dont want to load from Cache.

To avoid loading data or content from cache when making Ajax call using Jquery, the following statement need to add in the document.ready block. $(document).ready( function () { $ . ajaxSetup ( { // Disable caching of AJAX responses     cache : false }); }); the above code will disable caching for Ajax response on the page.

Gridview to show header when Empty

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.showheaderwhenempty.aspx

Print Area of the Page

Following Jqury Plugin is used to print selected div or html to print http://plugins.jquery.com/project/PrintArea

Disable COPY PASTE and CUT

following link will help to disable copy paste and cut with jquery http://jquerybyexample.blogspot.com/2010/12/disable-cut-copy-and-paste-function-for.html

Required Field validation using Custom Validation for FCKEditor

//Following are the Html Part of aspx page. <FCKeditorV2:FCKeditor ID="fckeditor_test" runat="server" Height="500px" Width="520px" UseBROnCarriageReturn="true" Visible="true" > </FCKeditorV2:FCKeditor> <asp:CustomValidator ID="CustomValidator1" runat="server" ValidationGroup="validate" ClientValidationFunction="ValidateFCK" ErrorMessage="Pls Enter Some Comments"></asp:CustomValidator> <asp:Button ID="Button1" runat="server" Text="Button" CausesValidation="true" ValidationGroup="validate" /> //Following is the Javascript part   function ValidateFCK(source, args) { var FEditorID = 'ctl00_ContentPlaceHolder1_fckeditor_test'; var text = GetPlainText(FEditorID); if (text.length == 0) { args.IsValid = false; FCKeditorAPI.GetInstance(FEditorID).Focus(); return; } args....

Get Plain Text from FCKEditor in any Browser.

The Following Function will help to get plain text from the FCKEditor in almost any browser. // below is the protyping for trim string. function trimString (str) { str = this != window? this : str; return str.replace(/^\s+/g, '').replace(/\s+$/g, ''); } String.prototype.trim = trimString; //following function will return plain text function GetPlainText(FCKEditorID) { var FEditor = FCKeditorAPI.GetInstance(FCKEditorID); var Result = ""; if (FEditor.EditorDocument.body.textContent || FEditor.EditorDocument.body.textContent=="" ) { //Firefox compitable browser Result = FEditor.EditorDocument.body.textContent.trim(); } else { //IE compitable browser Result = FEditor.EditorDocument.body.innerText.trim(); } return Result; }

Ten Simple Tricks To Remembering Names

From The Following link you can find out Ten Simple Tricks To Remembering Names. Ten Simple Tricks To Remembering Names.

Nice & Cool things coming with the VS 2010 and .NET 4 release

From The Following link you can find out Nice new things coming with the VS 2010 and .NET 4 release. Scott Guthrie had explain it so nice. New Things Coming With The VS 2010 and .NET 4 release.

SFTPPro Example

first include the class in ur page using SFTPPro.SFTPServer; Example of SFTP Connection and methods Sftp sftpServer = new Sftp(strSFTPHost,strSFTPUserName,strSFTPPassword); sftpServer.Connect(); if (sftpServer.Connected) { ArrayList alFilelist=sftpServer.GetFileList(""); sftpServer.Get("strfromFilePath", "strToFilePath"); sftpServer.Put("strfromFilePath", "strToFilePath"); sftpServer.RemoveFile("<filename>"); } sftpServer.Close();

SFTPPro Example

first include the class in ur page using SFTPPro.SFTPServer; Example of FTP Connection and methods FTP FTPServer=new FTP("FtpHost", "username","password"); string []strResult=FTPServer.FileList(""); FTPServer.UploadFile("<DestinationFileName>", "<SourceFileName>"); FTPServer.DownloadFile("<SourceFileName>", "<DestinationFileName>"); FTPServer.RemoveFile("<FileName>"); FTPServer.MakeDirectory("<DirectoryName>"); FTPServer.RemoveDirectory("<DirectoryName>");