Translate

Friday, 20 May 2016

set default button in asp.net

<form id="form1" runat="server" DefaultButton="btnLogin">

 <asp:TextBox ID="txtUserName" runat="server" ToolTip="Enter Your User Name"
              TabIndex="1"  placeholder="User Name"></asp:TextBox>

      <asp:TextBox ID="txtpassword" runat="server" ToolTip="Enter Your PassWord Name"
                               TabIndex="2" placeholder="Password" TextMode="Password"></asp:TextBox>

 <asp:Button ID="btnLogin" runat="server" Text="Sign In"  TabIndex="3"
                                                   OnClientClick="return Validate()" OnClick="btnLogin_Click" />

  </form>

Monday, 4 January 2016

c# send mail through Zoho mail

 public bool send_mail()
    {
        try
        {
            MailMessage msg = new MailMessage("user123@dokra.com", "pabitra.best28@gmail.com");
            msg.Subject = "My Subject";
            msg.Body = "hello";
            msg.IsBodyHtml = true;
            AlternateView view;
            SmtpClient client;
            msg.IsBodyHtml = true;
            client = new SmtpClient();
            client.Host = "smtp.zoho.com";
            client.Port = 587;
            client.Credentials = new System.Net.NetworkCredential("user123@dokra.com", "password");
            client.EnableSsl = true; //Gmail works on Server Secured Layer
            client.Send(msg);
            return true;
        }
        catch (Exception ex)
        { throw ex; }

    }

Thursday, 3 December 2015

MVC equerry mail

http://www.mikesdotnetting.com/article/268/how-to-send-email-in-asp-net-mvc

Angular JS

http://www.codeproject.com/Articles/869433/AngularJS-MVC-Repository-Dispose

Thursday, 26 November 2015

c# add stylesheet with .less file in your website

Install 

Tools –> Library Package Manager –> Package Manager Console
PM> Install-Package dotLess



<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>@ViewBag.Title - My ASP.NET MVC Application</title>
        <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" />
        @Styles.Render("~/Content/less")
        @Scripts.Render("~/bundles/modernizr")
    </head>


And add your bundle to the appropriate location within BundleConfig.cs

public class BundleConfig
{
    public static void RegisterBundles(BundleCollection bundles)
    {
        // NOTE: existing bundles are here 

        // add this line
      bundles.Add(new LessBundle("~/Content/less").Include("~/Content/*.less"));
    }
}


dotLess will apply transforms to your web.config when you install it 
through NuGet to provide handlers which can process a specific LESS 
file:
---------------------

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler, dotless.Core" />
  </configSections>
  <!-- these probably do something useful -->
  <dotless minifyCss="false" cache="true" web="false" />
  <system.webServer>
    <handlers>
      <!-- for IIS7+ -->
      <add name="dotless" path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler,dotless.Core" resourceType="File" preCondition="" />
    </handlers>
  </system.webServer>
  <system.web>
    <httpHandlers>
      <!-- for IIS6 -->
      <add path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler, dotless.Core" />
    </httpHandlers>
  </system.web>
</configuration>



-----------------------
Or Follow this Link
http://www.brendanforster.com/blog/yet-another-implement-less-in-aspnetmvc-post.html