add

Tuesday, 5 June 2018

How to Create excel or Export Excel from Html Table using MVC (asp.net MVC)

Create excel or Export Excel from Html Table using MVC (asp.net MVC)

1)First Create HTML or CSHTML extention File:-

1.There Is No Required html body etc Tage
2.If You Are Using Asp.net MVC Partial Page Your Page Extention Is ".CSHTML"
  Example:-

<div style="margin-top:10px;"></div>
    <table style="border:1px solid black;padding:5px;font-weight:100">
        <tbody style="border:1px solid black;padding:5px;font-weight:100"><tr style="border:1px solid black;padding:5px;font-weight:100">
        <td colspan = "5" style ="text-align:center;border:1px solid black">
            <h1 style="color:red;text-decoration:underline">Your Invice</h1></td>
        </tr>

        <tr>
            <td colspan="5" style="border:1px solid black;padding:5px;font-weight:100">Searching criteria</td>
        </tr>

        <tr>
            <td colspan="2" style="border:1px solid black;padding:5px;font-weight:100">Search Param 1</td>
            <td colspan="3" style="border:1px solid black;padding:5px;font-weight:100">8821650318629</td>
        </tr>
        <tr>
            <td colspan="2" style="border:1px solid black;padding:5px;font-weight:100">Period</td>
            <td colspan="3" style="border:1px solid black;padding:5px;font-weight:100">04/04/2017 - 03/05/2017</td>
        </tr>
        <tr>
            <td colspan="2" style="border:1px solid black;padding:5px;font-weight:100">Search Param 2</td>
            <td colspan="3" data-xls-col-index="2">Call Details</td>
        </tr>
        <tr>
            <td colspan="3" style="border:1px solid black;padding:5px;font-weight:100"> GPS Location Information</td>
            <td colspan="2" style="border:1px solid black;padding:5px;font-weight:100"> -</td>
        </tr>
        <tr>
            <td colspan="2" style="border:1px solid black;padding:5px;font-weight:100">Search Param 3</td>
            <td colspan="3" style="border:1px solid black;padding:5px;font-weight:100">MS - ORIGINATING</td>
        </tr>
        <tr>
            <td colspan="3" style="border:1px solid black;padding:5px;font-weight:100">MS - TERMINATING</td>
            <td colspan="2" style="border:1px solid black;padding:5px;font-weight:100"> -</td>
        </tr>
        <tr>
            <td colspan="5" style="border:1px solid black;padding:5px;font-weight:100">Summary Report</td>
        </tr>
        <tr>
            <td colspan="5" style="border:1px solid black;padding:5px;font-weight:100">Originating Call Details</td>
        </tr>
        <tr>
            <td style="border:1px solid black;padding:5px;font-weight:100">Number calling</td>
            <td style="border:1px solid black;padding:5px;font-weight:100">Number called</td>
            <td style="border:1px solid black;padding:5px;font-weight:100">Date(YYYY/MM/DD HH:MM:SS) </td>
            <td style="border:1px solid black;padding:5px;font-weight:100">Call Duration(sec) </td>
            <td style="border:1px solid black;padding:5px;font-weight:100">Country</td>
        </tr>
        <tr>
            <td style="border:1px solid black;padding:5px;font-weight:100">8821650318629 </td>
            <td style="border:1px solid black;padding:5px;font-weight:100">393662555630 </td>
            <td style="border:1px solid black;padding:5px;font-weight:100">2017/05/02 16:31:17 </td>
            <td style="border:1px solid black;padding:5px;font-weight:100">0 </td>
            <td style="border:1px solid black;padding:5px;font-weight:100">Mediterranean Sea</td>
        </tr>
        <tr>
            <td style="border:1px solid black;padding:5px;font-weight:100">
                8821650318629 </td >
                <td style="border:1px solid black;padding:5px;font-weight:100"> 393662555630 </td >
                <td style="border:1px solid black;padding:5px;font-weight:100" > 2017 / 05 / 02 03:40:30
            </td>
            <td style="border:1px solid black;padding:5px;font-weight:100">
                0 </td >
                <td style="border:1px solid black;padding:5px;font-weight:100"> Italy </td >
                </tr >
                <tr >
                <td colspan= "5" style="border:1px solid black;padding:5px;font-weight:100">Terminating Call Details
            </td>
        </tr>
        <tr>
            <td style="border:1px solid black;padding:5px;font-weight:100">Number calling</td>
            <td style="border:1px solid black;padding:5px;font-weight:100">Number called</td>
            <td style="border:1px solid black;padding:5px;font-weight:100">Date(YYYY/MM/DD HH:MM:SS) </td>
            <td style="border:1px solid black;padding:5px;font-weight:100">Call Duration(sec) </td>
            <td style="border:1px solid black;padding:5px;font-weight:100">Country</td>
        </tr>
        <tr>
            <td  colspan="5" style="border:1px solid black;padding:5px;font-weight:100">No Record found.</td>
        </tr>
        <tr>
            <td colspan="5" style="border:1px solid black;padding:5px;font-weight:100">GPS Location Information</td>
        </tr>
        <tr>
            <td style="border:1px solid black;padding:5px;font-weight:100">IMEI</td>
            <td style="border:1px solid black;padding:5px;font-weight:100">Date(YYYY/MM/DD HH:MM:SS) </td>
            <td style="border:1px solid black;padding:5px;font-weight:100">Country</td>
            <td style="border:1px solid black;padding:5px;font-weight:100">Latitude</td>
            <td style="border:1px solid black;padding:5px;font-weight:100">Longitude</td>
        </tr>
        <tr>
            <td style="border:1px solid black;padding:5px;font-weight:100">3560130010789500 </td>
            <td style="border:1px solid black;padding:5px;font-weight:100">2017/05/03 16:02:51 </td>
            <td style="border:1px solid black;padding:5px;font-weight:100">ITALY</td>
            <td style="border:1px solid black;padding:5px;font-weight:100">45.220586 </td>
            <td style="border:1px solid black;padding:5px;font-weight:100">12.282395 </td>
        </tr>

        </tbody>
    </table>

2) Second We Need To Create Action Method From Which We Use:- 

It is a Get Action Request Action Method Write This Code in Your Controller

using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Validation;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using AngularFirstWithMVC.DataEntity;
using AngularFirstWithMVC.Filter;
using AngularFirstWithMVC.Models;

namespace AngularFirstWithMVC.Controllers
{
    [Authorize]
    public class EmployeeController : Controller
    {
      
 public ActionResult Export()
        {
            return View();
           
        }
    }
}

3) Third We Need To Create View of Export Action Method:- 

For User View We need Create View of Export Action Method View By Following Steps
1).Righ Click On Export Action Method
2).Chose Create View Option 
3). Finally create Empty View  View Like This 
         a). View name: Export(already Inserted When You Create View From Action Method)
         b). Template: Select Empty (Without model ) Option Becouse We Do note Any model in  this                   action method
         c). Model class: set To Be Empty
         d). Data Context Class: set To Be Empty
         e). Select Option
                           1). Create as a Partial View (leave unchecked the Check box)
                           2). Render Script Librery (leave unchecked the Check box)
                           3). Use a Layout Page (Checked the Check box) , and select path of layout Page
         e). finaly click on add Button

4) Fourth We Need To Design View of Export Action Method:- 

You Need To write Your Code of View Mannuly Becouse you select template type is Empty
This Is View design Code 

@{
    ViewBag.Title = "Employee List";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@using (Html.BeginForm())
{
  
    @Html.Partial("invoice")

    <input type="submit" value="Convert To Excel" />
}

In Above Code we use Layout Page and Also Used HTml.BeginForm For Submitting On Post Method of Export

5) Fifth We Need To Post Verb Type of Export Action Method:- 

Here The Code of Post Metho Of Export Action Method With Get Action Method



using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Validation;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using AngularFirstWithMVC.DataEntity;
using AngularFirstWithMVC.Filter;
using AngularFirstWithMVC.Models;

namespace AngularFirstWithMVC.Controllers
{
    [Authorize]
    public class EmployeeController : Controller
    {
//Get httpVerb Method      
 public ActionResult Export()
        {
            return View();
           
        }
//Post httpVerb Method
        [HttpPost]
        [ValidateInput(false)]
        public FileResult Export(FormCollection frm)
        {
            string body = string.Empty;

            using (StreamReader reader = new StreamReader(Server.MapPath("~/Views/Shared/invoice.cshtml")))
            {
                body = reader.ReadToEnd();
            }       

            return File(Encoding.ASCII.GetBytes(body), "application/vnd.ms-excel", "Grid.xls");
        }
    }
}


1).here We Used [validate Input (false)] Attribut to allow a String input that containt Tages if we Do not use this attribute Server Not allow to input html string into the post request 
2).FormCollection Class Indicate The Entire Form Element from Where the post request Come 
3).We Are Using StreamReader Class to read string from Html or partial Cshtml file (which content Table Data
4).We Use Action Result type is file Becose we return file type content Which extention is .xls
 
Finally Done Thank You



How To Create Dynamic Draggable Html Element Using Javascript and Css

                                 


Ans

This is The Way By which You Can Create Dynamic Draggable Element of WebPage

1).Here Red Color Used for Html part of Code
2).yellow used For Css
3).Green Used for Javascript 

Note : You can Also Use Diffrent File for Define external Css and Javascript 

 
<!DOCTYPE  html> <html>
<style>
#mydiv {
position: absolute;
z-index: 9;
background-color: #f1f1f1;
text-align: center;
border: 1px solid #d3d3d3;
left:0;
}
#mydiv1 {
position: absolute;
z-index: 9;
background-color: #f1f1f1;
text-align: center;
border: 1px solid #d3d3d3;
}
#mydiv2 {
position: absolute;
z-index: 9;
background-color: #f1f1f1;
text-align: center;
border: 1px solid #d3d3d3;
}
#mydivheader {
padding: 10px;
cursor: move;
z-index: 10;
background-color: #2196F3;
color: #fff;
}
</style>
<body>
<h1>Draggable DIV Element</h1>
<p>Click and hold the mouse button down while moving the DIV element</p>
<div id="mydivonmousedown="dragElement(this)">
<div id="mydivheader">Click here to move</div>
<p>Move</p>
<p>this</p>
<p>DIV</p>
</div>
<div id="mydiv1onmousedown="dragElement(this)">
<div id="mydivheader">Click here to move</div>
<p>Move</p>
<p>this</p>
<p>DIV</p>
</div>
<div id="mydiv2onmousedown="dragElement(this)">
<div id="mydivheader">Click here to move</div>
<p>Move</p>
<p>this</p>
<p>DIV</p>
</div>
<script>
//Make the DIV element draggagle:
//dragElement(document.getElementById(("mydiv")));
function dragElement(elmnt) {
var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
if (document.getElementById(elmnt.id + "header")) {
/* if present, the header is where you move the DIV from:*/
document.getElementById(elmnt.id + "header").onmousedown = dragMouseDown;
} else {
/* otherwise, move the DIV from anywhere inside the DIV:*/
elmnt.onmousedown = dragMouseDown;
}
function dragMouseDown(e) {
e = e || window.event;
// get the mouse cursor position at startup:
pos3 = e.clientX;
pos4 = e.clientY;
document.onmouseup = closeDragElement;
// call a function whenever the cursor moves:
document.onmousemove = elementDrag;
}
function elementDrag(e) {
e = e || window.event;
// calculate the new cursor position:
pos1 = pos3 - e.clientX;
pos2 = pos4 - e.clientY;
pos3 = e.clientX;
pos4 = e.clientY;
// set the element's new position:
elmnt.style.top = (elmnt.offsetTop - pos2) + "px";
elmnt.style.left = (elmnt.offsetLeft - pos1) + "px";
}
function closeDragElement() {
/* stop moving when mouse button is released:*/
document.onmouseup = null;
document.onmousemove = null;
}
}
</script>
</body>
</html>

Monday, 4 June 2018

Error While Udpate Data in entity Framework of MVC


Error While Udpate Data in entity Framework of MVC

//This Is Get Action Of  Edit

 public ActionResult Edit(int ?id)
        {
            if (!id.HasValue)
                return RedirectToAction("index");

            using (FirstAngularJsWithMVCEntities db = new FirstAngularJsWithMVCEntities())
            {
                var Employee = db.Employees.Find(id);
                return View(Employee);
            }
       

        }
   //This Is Post Action Of  Edit
        [HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult Edit(Employee employee)
        {
            if (!ModelState.IsValid)
                return View(employee);
            using (FirstAngularJsWithMVCEntities db = new FirstAngularJsWithMVCEntities())
            {
                var Emp=db.Employees.Find(employee.id);
                if (Emp != null)
                {
                    //Emp.Fname = employee.Fname;
                    //Emp.address = employee.address;
                    //Emp. Age = employee.Age;
                    //Emp.  phoneno = employee.phoneno;
                    //Emp. UserId = employee.UserId;
                    db.Entry(employee).State = EntityState.Modified;

                    if (db.SaveChanges() > 0)
                    {
                        return View("index");
                    }
                    else
                    {
                        return View(employee);
                    }
                }
                else
                    return View(employee);
            }

        }
//Problem:-
(Now The Problem Is Your entity is not modified so you need to Follow The Solution
System.InvalidOperationException
  HResult=0x80131509
  Message=Attaching an entity of type 'AngularFirstWithMVC.DataEntity.Employee' failed because another entity of the same type already has the same primary key value. This can happen when using the 'Attach' method or setting the state of an entity to 'Unchanged' or 'Modified' if any entities in the graph have conflicting key values. This may be because some entities are new and have not yet received database-generated key values. In this case use the 'Add' method or the 'Added' entity state to track the graph and then set the state of non-new entities to 'Unchanged' or 'Modified' as appropriate.
  Source=EntityFramework
  StackTrace:
   at System.Data.Entity.Core.Objects.ObjectContext.VerifyRootForAdd(Boolean doAttach, String entitySetName, IEntityWrapper wrappedEntity, EntityEntry existingEntry, EntitySet& entitySet, Boolean& isNoOperation)
   at System.Data.Entity.Core.Objects.ObjectContext.AttachTo(String entitySetName, Object entity)
   at System.Data.Entity.Internal.Linq.InternalSet`1.<>c__DisplayClassa.<Attach>b__9()
   at System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(Action action, EntityState newState, Object entity, String methodName)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Attach(Object entity)
   at System.Data.Entity.Internal.InternalEntityEntry.set_State(EntityState value)
   at System.Data.Entity.Infrastructure.DbEntityEntry`1.set_State(EntityState value)
   at AngularFirstWithMVC.Controllers.EmployeeController.Edit(Employee employee) in D:\Angular demos\AngularFirstWithMVC\AngularFirstWithMVC\Controllers\EmployeeController.cs:line 111
   at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
   at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c.<BeginInvokeSynchronousActionMethod>b__9_0(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__11_0()

   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_1.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2()

Soulution:-
Finally The Solution Is Update Code in Post Method of Edit action
like this



        [HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult Edit(Employee employee)
        {
            if (!ModelState.IsValid)
                return View(employee);
            using (FirstAngularJsWithMVCEntities db = new FirstAngularJsWithMVCEntities())
            {
                var Emp=db.Employees.Find(employee.id);
                if (Emp != null)
                {
                    
                    db.Entry(Emp).CurrentValues.SetValues(employee);
                    if (db.SaveChanges() > 0)
                        {
                            return View("index");
                        }
                        else
                        {
                     return View(employee);
                        }
                   
                }
                else
                    return View(employee);
            }

        }



System.InvalidOperationException HResult=0x80131509 ,Entity Framework Issue, Update Entity framework


Error While Udpate Data in entity Framework of MVC

//This Is Get Action Of  Edit

 public ActionResult Edit(int ?id)
        {
            if (!id.HasValue)
                return RedirectToAction("index");

            using (FirstAngularJsWithMVCEntities db = new FirstAngularJsWithMVCEntities())
            {
                var Employee = db.Employees.Find(id);
                return View(Employee);
            }
         

        }
   //This Is Post Action Of  Edit
        [HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult Edit(Employee employee)
        {
            if (!ModelState.IsValid)
                return View(employee);
            using (FirstAngularJsWithMVCEntities db = new FirstAngularJsWithMVCEntities())
            {
                var Emp=db.Employees.Find(employee.id);
                if (Emp != null)
                {
                    //Emp.Fname = employee.Fname;
                    //Emp.address = employee.address;
                    //Emp. Age = employee.Age;
                    //Emp.  phoneno = employee.phoneno;
                    //Emp. UserId = employee.UserId;
                    db.Entry(employee).State = EntityState.Modified;

                    if (db.SaveChanges() > 0)
                    {
                        return View("index");
                    }
                    else
                    {
                        return View(employee);
                    }
                }
                else
                    return View(employee);
            }

        }
//Problem:-
(Now The Problem Is Your entity is not modified so you need to Follow The Solution
System.InvalidOperationException
  HResult=0x80131509
  Message=Attaching an entity of type 'AngularFirstWithMVC.DataEntity.Employee' failed because another entity of the same type already has the same primary key value. This can happen when using the 'Attach' method or setting the state of an entity to 'Unchanged' or 'Modified' if any entities in the graph have conflicting key values. This may be because some entities are new and have not yet received database-generated key values. In this case use the 'Add' method or the 'Added' entity state to track the graph and then set the state of non-new entities to 'Unchanged' or 'Modified' as appropriate.
  Source=EntityFramework
  StackTrace:
   at System.Data.Entity.Core.Objects.ObjectContext.VerifyRootForAdd(Boolean doAttach, String entitySetName, IEntityWrapper wrappedEntity, EntityEntry existingEntry, EntitySet& entitySet, Boolean& isNoOperation)
   at System.Data.Entity.Core.Objects.ObjectContext.AttachTo(String entitySetName, Object entity)
   at System.Data.Entity.Internal.Linq.InternalSet`1.<>c__DisplayClassa.<Attach>b__9()
   at System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(Action action, EntityState newState, Object entity, String methodName)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Attach(Object entity)
   at System.Data.Entity.Internal.InternalEntityEntry.set_State(EntityState value)
   at System.Data.Entity.Infrastructure.DbEntityEntry`1.set_State(EntityState value)
   at AngularFirstWithMVC.Controllers.EmployeeController.Edit(Employee employee) in D:\Angular demos\AngularFirstWithMVC\AngularFirstWithMVC\Controllers\EmployeeController.cs:line 111
   at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
   at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c.<BeginInvokeSynchronousActionMethod>b__9_0(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__11_0()

   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_1.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2()

Soulution:-
Finally The Solution Is Update Code in Post Method of Edit action
like this



        [HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult Edit(Employee employee)
        {
            if (!ModelState.IsValid)
                return View(employee);
            using (FirstAngularJsWithMVCEntities db = new FirstAngularJsWithMVCEntities())
            {
                var Emp=db.Employees.Find(employee.id);
                if (Emp != null)
                {
                    
                    db.Entry(Emp).CurrentValues.SetValues(employee);
                    if (db.SaveChanges() > 0)
                        {
                            return View("index");
                        }
                        else
                        {
                     return View(employee);
                        }
                   
                }
                else
                    return View(employee);
            }

        }



Increase Traffic of Website or Searching of Webpage On Search Egine


Increase the traffic for your website

How to increase the traffic for your website, there are a lot of ways to do this, such as, submit to the B2B marketplace, blogs, forums, Bookmarks, and so on.
Following are the details about where you can submit the website to increase traffic:
1 Submit to search engines
The first step is to submit the website to all search engines, like Google, Bing, Yahoo and so on. For more indexing and exposures in the near future.
2 B2B marketplace
A lot of B2B marketplace allows the users to post their products with pictures. And also they can manage their B2B homepage or the products in there.
3 SEO
If you have a small website, you can do some on-page SEO and off-page SEO.On-page SEO refers to optimize the TDK, external links, original content, updates and conversion etc..
Off-page SEO refers to keywords ranking, traffic, and so on. Select some keywords, and improve the keywords ranking in the Google search engine. If the website can be indexed by the Google or Bing, the more pages indexed, the more exposures it will be.
4 SNS
There are some popular social media websites like Facebook, LinkedIn, Twitter, Google+. Here you can find the potential customers, and also you can interact with the potential customers.
5 Blogs
You can also use some Free blogs, like WordPress, blogger, LiveJournal, Tumblr and so on.
6 Forums
The forum is a place of gathering people together with the relative topic and same interests. You can find the relative forums to interact with them.
7 Bookmarks
Most customers like to read information via bookmarks, such as, Digg, Dig, Diggo, Reddit, StumbleUpon, Folkd and so on. So you can start to share some interesting things for them.


What is blog posting and how can i do it? like this
  • Social media promotion(Facebook, twitter, Google+, Instagram, Tumblr)
  • Blog posting
  • Blog commenting
  • Guest blogging
  • Article submission
  • Question and Answering site
  • Directory Submission one site i have seen for this which will give your website huge amount of traffic visit:- Business Directory Listing IndiaLocal Business Listing
  • Profile creation
  • Social bookmarking
  • Video promotion
  • Press release submission
  • Blog submission. For that you have to submit your blog in blog submission site.

Local Listing Sites :
  1. Yelp
  2. CrunchBase accelerates innovation by bringing together data on companies and the people behind them.
  3. Free online business directory
  4. Yellow Pages, the new yellowpages.com
  5. http://www.manta.com/
  6. Small Business Services and Business Directory
  7. about.me
  8. Marketing and Media in South Africa
  9. Cylex Business Directory USA
  10. CrunchBase accelerates innovation by bringing together data on companies and the people behind them.
  11. http://1millionfreehit.com/
Social Bookmarking Sites :
  1. Delicious
  2. folkd.com - social bookmarking
  3. StumbleUpon
  4. the front page of the internet
  5. Better reading and research with annotation, highlighter, sticky notes, archiving, bookmarking & more.

how to create responsive website using css , html without bootstrap Or Responsive Website Using Media query



HTML CSS MEdia Query 

what is viewPort:
              View Port is a user visible part of any webpage. what ever you see on webpage and view port manage with of content or a page in responsive website

How To Set View Port:
ex:- <meta name="viewport" content="width=device-width, initial-scale=1.0">

What is Responsive Website :
An Responsive Website is a Type of Website which is suitable for all type's of Devices Like mobile Devices,teblat Devices,laptop ,and PC.Any of the devices browse the website that essly manage there all content autometically no need to write deffrent code for each and every device .only one Responsive website

how to create responsive website:
                              There are two ways to developed responsive website
1).built in repository like bootstrap
2).Create Your Own code using html css (usign Media query)

what is media query:
                  It is  usesd the @media rule to include a block of CSS properties only if a certain condition is true.

example:
________________________________________________________________________________

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
    background-color: red;
}
@media only screen and (max-width: 768px) {
    body {
        background-color: silver;
    }
}
@media only screen and (max-width: 600px) {
    body {
        background-color: lightblue;
    }
}
@media only screen and (max-width: 420px) {
    body {
        background-color: green;
    }
}
@media only screen and (max-width: 360px) {
    body {
        background-color: yellow;
    }
}
</style>
</head>
<body>
<ol>
<li>
<p>
Resize the browser window. When the width of this document is greater then 768 pixels or more, the background-color is  "red".</p>
</li>
<li>
<p>
Resize the browser window. When the width of this document is 768 pixels or less, the background-color is silver </p>
</li>

<li>
<p>
Resize the browser window. When the width of this document is 420 pixels or less, the background-color is "green" .</p>
</li>

<li>
<p>
Resize the browser window. When the width of this document is 360 pixels or less, the background-color is yellow </p>
</li>

</ul>
</body>
</html>
_________________________________________________________________________________

Friday, 1 June 2018

Which Basic Tage And Technique of Html help to improve seo

In Seo Of Any Website There Are Several Tages And Attributes (Properties ) Which is Helpfull In
Increase Your WebSite Traffic or Searching Index Ranking In Over Search Engine
Before Start Tage and properties of html i would like to explain 

What is Seo And What's Its Use

S.e.o.  Is abbreviate form of  Search Engine Optimization
which means  Optimise Your website seaching over internet on any search engine like yahoo , google ,bing etc(most popular browsers)

Tages And Propertis Help To Optimise Searching Of Your WebPage

Tages:-

  1. <TITLE> TAG
The most important tag on any web page, the meta <title> tag, similarly to a cover of a book, tells the search engines (and users) what the content of your webpage is all about – which is why it's important to include your targeted keyword phrases in it! It's also an important tag because it shows up at the top of your listing in the search results:

      2. <meta > Tage 

While the Meta Description tag has no impact on how well your website ranks organically, it's still a critically important HTML tag for organic SEO because it can convince users to click through to your webpage:
A Meta Tage Is A Tage Which come with key and paire Where key is Heading of content and value is descrption of content where A Website is to related . Also we user Meta tage in Sense of Responsive Website device Width Declaire
and with in the content or description part of meta tage we include pipe "|" symbols to seprated multiple values in descrptoin
example:
<meta key="Online Shopping site" description="Best Onlines Shopping | Shopping in Ahembdabad | Best Offer in OnlineShopping "/>
Etc

     3.Headings


There are six Heading Tage Define In Html From <h1> To <h6>
and All Heading Tages Are Container Tage . They Have Opening As well As Closing Tages
Heading Are Large in Size and  Bold type The Largest Is <h1> And Smallest Size Heading Is <h6>

The <h1> tag is the first HTML tag that relates directly to on-page content structure. Think of the <h1> tag as the headline of a newspaper or blog article.

The search engines understand the <h1> tag to be the most important content header tag, and by using keywords within your <h1> tag, you give your site a better chance to rank organically for your keyword targets. Best practice tip: Only use one H1 tag per page!


<h2> tags signify breaks or subsections of your web pages that help organize content, assisting both your readers and search engines in determining what sections are important. Using both targeted and long-tail keyword phrases in your <h2> tags are also an SEO keyword-relevancy best practice for organic search.

The third content header tag in line is the <h3> tag, which is given a lower value than the <h1> or <h2> tags by search engines. The H3 tags should be used in cases where you need to further break down your subsections into more specific topics. Optimizing these for longtail keywords is a smart move, but not to the detriment of well-written copy. Though it may be tempting to try to stuff in keywords, this can look spammy and be detrimental to your overall organic SEO success.


    5. Link Tage: 
 
   like <a> tage and <img> also Help full In Improve your page Seo

Properties

There are some Properties of Tage Which Is also Userfull to increase searching of website 

1.REL="CANONICAL" TAG:
The Rel=Canonical tag is an essential guide for search engines to determine find which web pages are the most important and which should be ignored when they crawl your website, particularly in the case where you have duplicate content on your site.
Without use of the Rel=Canonical tag, you basically leave it up to the search engines to determine what pages are the most significant and should be ranked/indexed.


REL="AUTHOR" TAG
Assigning an author to your text moves your site from being an anonymously written website to giving weight to what your text and content is by attaching a specific author and their Google+ account to it.

authorship

While there has been no direct confirmation by Google, on Authorship being a ranking signal, it's been widely speculated that Author Rank will be incorporated in the future. By developing your Authorship, you're building trust with users and with Google and if Google deems you worthy enough, they'll include your head shot next to your listing in the search results.

REL="PUBLISHER"

Where an author tag can give relevance to content through a personal perspective, the publisher tag does something similar for business. This can be used to great effect by any business or brand with a Google+ page. Using this tag ensures that Google establishes a connection between your Google+ page and your actual website, thus impacting overall SEO.

LINK REL="NOFOLLOW"

Though assigning a link as a rel=nofollow may seem slightly mean-spirited in the SEO stakes, it can actually be an important part of preventing your site from looking spammy, and thus deserving of a search engine penalty.

This was first developed as a way for webmasters to prevent blog posts from essentially becoming link farms for unscrupulous “black hat” marketers who were just looking to pass PageRank to websites. With Google's recent penalization of Guest Blogging sites, the rel=nofollow attribute should be used more thoughtfully by bloggers who are blogging on sites that do not belong to them, and by blog owners who allow others to post on their sites.

THE CROSSING YOUR T'S AND DOTTING YOUR I'S HTML TAG ATTRIBUTESLINK TITLE ATTRIBUTE

Though it's not an important aspect of the SEO puzzle, the link title is often confused with or duplicated anchor text. Essentially, the link title acts as a road sign for users and should be as descriptive as possible so they know what to expect should they click on the link.

link title attribute


This is particularly true when it comes to more general anchor text links such as “Click Here” or “More Info.”

IMAGE ALT TEXT ATTRIBUTE

By using your targeted keywords your Image Alt HTML attribute, you can increase the overall keyword value of your web page. Image Alt attributes also promotes higher rankings for your images in Google's blended and image search results.

image-alt-text


It's sometimes so easy to forget that the little details can make a significant impact. So, if you're a DIY SEOer, or someone who is relatively new to the industry, be sure you're taking the time to optimize each of these HTML elements on your web pages. Doing so can keep your organic SEO program moving in the right direction.

Tuesday, 29 May 2018

dynamic query store procedure in sql





Create PROCEDURE [dbo].[Prc_SearchMembers]
(@MemberName varchar(100)=null,@MemberId varchar(20)=null,@IntroId varchar(20)=null,@Mobile Varchar(10)=null,@Email varchar(100)=null,@LevelNo int=null,@Deactive bit=null,@Export bit=null)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
Declare @Query nvarchar(4000),@Condition nvarchar(4000),@Msrno int
DECLARE @ParmDefinition NVARCHAR(500);
--select @Msrno=Msrno from MemberMaster where MemberId=@MemberId
set @Condition='where 1=1 '
if @MemberName is not null
set @Condition=@Condition + ' and MemberName Like @MName'
if @MemberId is not null
set @Condition=@Condition + ' and m.MemberId=@Mid'
if @IntroId is not null
set @Condition=@Condition + ' and IntroId=@Intro'
if @LevelNo is not null
set @Condition=@Condition + ' and LevelNo=@Act'
if @Mobile is not null
set @Condition=@Condition + ' and Mobile=@Mob'
if @Email is not null
set @Condition=@Condition + ' and Email=@Mail'
if @Deactive is not null
set @Condition=@Condition + ' and deactivated is not null '
if @Export=1
  set @Query='Select m.Memberid,MemberName,DOJ,IntroId,(select MemberName from MemberMaster where MemberId=m.IntroId) IntroName,Mobile,Email from MemberMaster m inner join Membertree t on t.msrno=m.msrno '+ @Condition
else
set @Query='Select m.Msrno,m.Memberid,MemberName,DOJ,IntroId,(select MemberName from MemberMaster where MemberId=m.IntroId) IntroName,Mobile,Email from MemberMaster m inner join Membertree t on t.msrno=m.msrno '+ @Condition
SET @ParmDefinition = N'@MName varchar(100),@Mid varchar(20),@Intro varchar(20),@Act int,@Mob varchar(10),@mail varchar(100)';
exec sp_executeSql @Query,@ParmDefinition,@MName=@MemberName,@Mid=@MemberId,@Intro=@IntroId,@Act=@LevelNo,@Mob=@Mobile,@Mail=@Email

END