.Net , C#, ASP MVC , Telerik , Xamarin

Xamarin

Xamarin Code

Learn more

C# ASP MVC

.Net App with ASP MVC 5 and EF 5

Learn more

IOS Swift

IOS app with native language

Learn more

Other

Some other thing that i may lookback

Learn more

How to remove Day in DatePickerDialog in Xamarin Android

 

Forcing Firefox to obey autocomplete=”off” for password fields

From Jason Hinkle’s Blog

This is a very old article. Again I should stress that the point of this trick is not to wipe out the saved password for login forms. I use it for registration forms and preferences pages that allow users to change their password.  In these cases, auto-filling the password can cause problems for the user.  This is not a security fix.

I have a new technique now which is much simpler.  Create a hidden “honeypot” password field at the top of your form. Browser auto-complete features will only fill in the first password field that they hit. So, by having a dummy password field at the top of your form, you can trick the browser into filling out that field instead of the real password field. It looks like this:

— ORIGINAL POST BELOW —

Autocomplete is a nice feature which fills in common form fields automatically for the user. However, in some cases you don’t want this to happen.  Some examples could be an account management page where you don’t want the admin password to be auto-filled in when you are creating and managing accounts.  Another example is any site that has a “My Account” page with a field allowing you to change your password.  Auto-complete can accidentally fill in these fields because it thinks it is a login form.

IE uses a non-standard attribute (autocomplete=”off”) that can be added to an entire form or one specific input control. Besides the fact that this attribute will make your HTML markup fail compliance tests, Firefox seems to consider this tag merely a “suggestion” and will disregard it at times.

In particular, Firefox will *always* populate certain password fields. There is seemingly no way to tell Firefox not to fill in a field if it really wants to do so. This can be a very bad thing if you are dealing with a user preference page or something sensitive where you don’t want autocomplete to ever occur under any circumstance. Setting value=”” is equally worthless because Firefox seems to populate this value just after the page is rendered.

The following code however will work. The concept is basically to set a timeout a fraction of a second after the page loads which clears the password field. Technically Firefox still populates the field, however this script code removes it almost instantly. As an added bonus, because you are not using autocomplete=”off” your HTML markup should still validate. This code should be placed at the bottom of your page beneath your form.

This code could probably be made more generic by enumerating through the form elements and searching for a certain class name. This way you could have one script and simply append a classname to any field that you don’t want auto-complete to occur. This technique is similar to one posted on Chris Holland’s blog. Chris’s solution, however, is aimed exclusively at the Wc3 compliance issue. As you can see in his code he adds the autocomplete=”off” attribute, which allows the page to validate properly, but doesn’t solve the Firefox/Password field issue.

If you have a more graceful solution and/or decide to flesh this idea out, please post a comment and I’ll provide a link to your site.

 

How to delete duplicate rows in sql server?

 

http://gamesicons.com/

This is the flash game site from my friend : http://gamesicons.com

 

Get Active directory users info using UserPrincipal

//Config ADFS as tutorial in the link below :

http://www.dotnetcurry.com/windows-azure/1158/using-adfs-azure-single-signon-aspnet-mvc

http://blogs.msdn.com/b/card/archive/2010/06/25/using-federation-metadata-to-establish-a-relying-party-trust-in-ad-fs-2-0.aspx

ecsp-banner2

//——————————————————//

Please note : we pass Sam-Account Name as Name in Claim Rule setting

//Get Property of user in AD for .Net 4.0 -4.5

// Get groups

Query and update an Excel 2010 spreadsheet via a linked server

First  I downloaded and installed the ‘AccessDatabaseEngine_x64.exe’ file on the SQL Server from http://www.microsoft.com/download/en/details.aspx?id=13255. No restart was required.

Next I started SQL Server Management Studio as ‘Administrator’.

 

 

Next I enabled the ‘Allow inprocess’ option for the Microsoft.ACE.OLEDB.12.0 provider.

 

 

The linked server was created with this script:

IOS design layout , icon , size ….

Resolutions and Display Specifications

Device Retina Portrait (px) Landscape (px)
iPhone 6+ Retina HD 1080 x 1920 1920 x1080
iPhone 6 Retina 750 x 1334 1334 x 750
iPhone 55, 5S, 5C Retina 640 x 1136 1136 x 640
iPhone 44, 4S Retina 640 x 960 960 x 640
iPhone1st, 2nd & 3rd Generation No 320 x 480 480 x 320
iPad Air / Retina iPad1st & 2nd Generation / 3rd & 4th No 1536 x 2048 2048 x 1536
iPad Mini2nd & 3rd Generation Retina 1536 x 2048 2048 x 1536
iPadMini, 1st & 2nd Generation No 768 x 1024 1024 x 768

 

Device Asset Resolution PPI Display Size
iPhone 6+ @3x 401 5.5″
iPhone 6 @2x 326 4.7″
iPhone 55, 5S, 5C @2x 326 4.0″
iPhone 44, 4S @2x 326 3.5″
iPhone1st, 2nd & 3rd Generation @1x 163 3.5″
iPad Air / Retina iPad1st & 2nd Generation/ 3rd & 4th @2x 264 9.7″
iPad Mini2nd & 3rd Generation @2x 326 7.9″
iPad Mini1st Generation @1x 163 7.9″
iPad1st & 2nd Generation @1x 132 9.7″

App Icons

Device App Icon AppStore Icon Spotlight Settings
iPhone 6+ 180×180 px 1024×1024 px 120×120 px 87×87 px
iPhone6, 5S, 5, 5C, 4S, 4 120×120 px 1024×1024 px 80×80 px 58×58 px
Old iPhones1st, 2nd, 3rd Generation 57×57 px 1024×1024 px 29×29 px 29×29 px
Retina iPadsMini 2 & 3, Air, 3 & 4 152×152 px 1024×1024 px 80×80 px 58×58 px
Old iPads1, 2, Mini 1 76×76 px 1024×1024 px 40×40 px 29×29 px

Icon dimensions for iOS 8 apps:

Name Size (px) Usage
Icon-Small.png 29×29 iPad Settings
Icon-Small@2x.png 58×58 iPhone Settings, iPad Settings for Retina display
Icon-Small@3x.png 87×87 iPhone Settings for Retina display
Icon-40.png 40×40 iPad Spotlight results
Icon-40@2x.png 80×80 iPhone Spotlight results, iPad Spotlight results for retina display
Icon-40@3x.png 120×120 iPhone Spotlight results for retina display
Icon-60@2x.png 120×120 iPhone App Icon
Icon-60@3x.png 180×180 iPhone App Icon for Retina display
Icon-76.png 76×76 iPad App Icon
Icon-76@2x.png 152×152 iPad App Icon for Retina display
Icon-120.png 120×120 CarPlay App Icon
iTunesArtwork.png 512×512 App Submission
iTunesArtwork@2x.png 1024×1024 App Submission

FTPS with C#

This post will show how to upload , download a file via FTPS protocol with C#

Open Nuget manager , search for AlexFTPS package, then add it into your project .

This function below demo how to use it :

Payment online with Payway Api (Westpac)

Hi , i wrote this tutorial in order to help you when you want to develop an app which is support payment with credit card online by using Payway Api (Westpac Bank). If you want to have more information about this , please visit its website Payway

First we need this function to initialize the API .

The second function will be used to capture the payment from customer .

Next , if we want to register the customer with Payway , we can use this function below .

Finally , If we want to do the recurring payment with registered customer without credit card detail, we can use this function :

Sending Email in ASP MVC with Mvc Mailer

This is a very simple and good email API that we can use in asp mvc app. It allow us to have something below ( i got it from MVC Mailer site )

  • Write clean code to send emails instead of spaghetti code
  • Reuse the power of master pages, views and data
  • Easily write unit test for email sending code
  • Send multi-part emails
  • Do some or all the above painlessly.

Now shall we start to implement it?

  • Create a new ASP  app with VS 2013.
  • Search and Add MvcMailer nuget from Nuget Manager or command :

  • Create a new folder which called “Mailer” which contains 3 files :
  • ExampleEmailModel.cs

  • IExampleMailer.cs

  •  ExampleMailer.cs

  •  Create a sub-folder in View folder which called “ExampleMailer”. It will contain 3 files:
  • _Layout.cshtml

  •  Template1.cshtml

  •  Template2.cshtml

  •  After that , we open the HomeController and add these line of codes into Index action

  •  Please remember to declare the ExampleMailer class first , in the HomeController

  •  Final thing need to be take care of is the email setting in web.config . Please take a look at <system.net> <mailSetting> . We need to put in our email address , server name , username and password.  For example :

That’s all .

Code Sample Download

Post of the day

July 2016
M T W T F S S
« Jun    
 123
45678910
11121314151617
18192021222324
25262728293031