-->

ABOUT US

Our development agency is committed to providing you the best service.

OUR TEAM

The awesome people behind our brand ... and their life motto.

  • Kumar Atul Jaiswal

    Ethical Hacker

    Hacking is a Speed of Innovation And Technology with Romance.

  • Kumar Atul Jaiswal

    CEO Of Hacking Truth

    Loopholes are every major Security,Just need to Understand it well.

  • Kumar Atul Jaiswal

    Web Developer

    Techonology is the best way to Change Everything, like Mindset Goal.

OUR SKILLS

We pride ourselves with strong, flexible and top notch skills.

Marketing

Development 90%
Design 80%
Marketing 70%

Websites

Development 90%
Design 80%
Marketing 70%

PR

Development 90%
Design 80%
Marketing 70%

ACHIEVEMENTS

We help our clients integrate, analyze, and use their data to improve their business.

150

GREAT PROJECTS

300

HAPPY CLIENTS

650

COFFEES DRUNK

1568

FACEBOOK LIKES

STRATEGY & CREATIVITY

Phasellus iaculis dolor nec urna nullam. Vivamus mattis blandit porttitor nullam.

PORTFOLIO

We pride ourselves on bringing a fresh perspective and effective marketing to each project.

Showing posts with label MVC. Show all posts
Showing posts with label MVC. Show all posts
  • CRUD in asp.net

     



     

    What is CRUD?



    CRUD is stands for "Create, Read, Update, and Delete".

    These are the four basic operation for managing data in an application.

    In HTTP we find four main methods that can perform processing on data that are defined in the REST architecture. This correspondence can also be done with CRUD.


    GET     ->  Retrieve
    POST    ->  Create
    PUT     ->  Update
    Delete  ->  Delete



    CRUD Operation


    To Insert



    Public class HomeController: Controller 
    
    [HTTPPOST]
    
    //controller is a class
    
    public ActionResult InsertData(Students s)
     {
       ApplicationDb db = new ApplicationDb();
       
       db.Students.Add(s);
       db.SaveChanges();
       
       return view();
       
      }
      
    




    To read


    ApplicationDb db = new ApplicationDb();
    
    var lst = db.Students.ToList();
    
    List<Students> list = db.students.ToList();
    
    foreach(var obj in list)
    {
    console.writeline (obj.StudentsId);
    console.writeline (obj.StudentsName);
    }
    





    To Update


    ApplicationDb db = new ApplicationDb();
    
    Students s = db.Students.Where(x => x.StudentsId == items.StudentsId).SingleOrDefault();
    
    //items is a model name
    
    s.StudentsName = new StudentsName;
    
    db.SaveChanges();
     
    



    To Edit Single Update


    Public Class HomeController: Controller
    
    {
    
    ApplicationDb db = new ApplicationDb();
    
    Students s = db.Students.Where(x => x.StudentsId == StudentsId).SingleOrDefault();
    
    return view(s);
    
    }
    
    
    



    To Delete


    List <Students> s = db.studentsToList()
    
    
    if(s!=null)
    {
      foreach(var t in s)
       {  
         db.students.remove(t);
       }
      
      db.savechanges();
     
    } 
    
    




    Disclaimer

     

     

    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.




  • About LINQ

     





    LINQ expression


    The Linq important part of Linq is about getting sequences from data sources. By default, the data sources that can be requested by Linq are:

    Object (Linq to Objetcs)
    XML fragments or docs (Linq to XML)
    ADO.Net DataSet (Linq to DataSet)
    SQL Server (Linq to SQL)
    Entity Framework (Linq to Entities



    LINQ is a unified programming model for any kind of data.



    var result = from s in stringList
                 where s.Contains("Tutorials")
                 select s;
                 


    result = result variable
    s = Now property of stringList  transfer in s (range variable)
    strList = Sequence | Queryable collection
    Contains = Conditional Expression
    Where and Select = Standard Query Operators             


    • From s in student select  s.studentid, s.studentname;


    • From s in student select  s.studentid == 10;



    Q) Display all the students whose roll no is 15


    In SQL - Select * From Where

    In LINQ - From s in student select Rollno = 15;




    Simple Where clause


    var query_where1 = from a in AccountSet
            where a.Name.Contains("Atul")
            select a;




    Multiple Select and where operator


    Example: Multiple Select and where Operator

    var studentNames = studentList.Where(s => s.Age > 18)
                                  .Select(s => s)
                                  .Where(st => st.StandardID > 0)
                                  .Select(s => s.StudentName);





    Example: LINQ Query returns Collection of Anonymous Objects


    var teenStudentsName = from s in studentList
                           where s.age > 12 && s.age < 20
                           select new { StudentName = s.StudentName };
                           
                           
                           

     

                           

    Q) List out the three main components of LINQ? Explain what is the extension of the file, when LINQ to SQL is used?

    Three main components of LINQ are

        Standard Query Operators
        Language Extensions
        LINQ Providers

    The extension of the file used is .dbml




    Q) What are the types of LINQ?

        LINQ to Objects
        LINQ to XML
        LINQ to Dataset
        LINQ to SQL
        LINQ to Entities
        
        

    Q) What are Anonymous Types?


    Anonymous types are types that are generated by compiler at run time. When we create a anonymous type we do not specify a name. We just write properties names and their values. Compiler at runtime create these properties and assign values to them.



    var k = new { FirstProperty = "value1", SecondProperty = "value2" };
    Console.WriteLine(k.FirstProperty);



    Q) What is Anonymous function?

    An Anonymous function is a special function which does not have any name. We just define their parameters and define the code into the curly braces.




    Q) Define what is let clause?

    In a query expression, it is sometimes useful to store the result of a sub-expression in order to use it in subsequent clauses. You can do this with the let keyword, which creates a new range variable and initializes it with the result of the expression you supply.





    LinQ Operators


    Filtering Operators - Where
                     - OfType


    Filtering is an operation to restrict the result set such that it has only selected elements satisfying a particular condition.



    Disclaimer

     
     
    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     


  • HTML Helpers in MVC

     

    HTML Helpers in MVC

     

     

    HTML Helper 



    HTML Helper is just a method that returns a HTML string. The string can represent any type of content that you want.

    For example, you can use HTML Helpers to render standard HTML tags like HTML <input>, <button> and <img> tags etc.
    You can also create your own HTML Helpers to render more complex content such as a menu strip or an HTML table for displaying database data.





    Example:


    HtmlHelper.ActionLink @Html.ActionLink(“Create New”, ”Create”, ”Home”)

    In the above example, @Html is an object of HtmlHelper class & ActionLink() is the extension method


    Html is a property of type HtmlHelper included in base class of razor view WebViewPage


    HtmlHelper class generates html elements For example, 

    @Html.ActionList("Create New", "Create“, “Home”) would generate anchor tag <a href="/Home/Create">Create New</a>




    HTML Element



    TextBox @Html.TextBox("Textbox1", "val")

    Output: <input id="Textbox1" name="Textbox1" type="text" value="val" />



    TextArea @Html.TextArea("Textarea1", "val", 5, 15, null)

    Output: <textarea cols="15" id="Textarea1" name="Textarea1" rows="5">val</textarea>









    Password @Html.Password("Password1", "val")

    Output: <input id="Password1" name="Password1" type="password" value="val" />


    Hidden Field @Html.Hidden("Hidden1", "val")


    Output: <input id="Hidden1" name="Hidden1" type="hidden" value="val" />


    CheckBox @Html.CheckBox("Checkbox1", false)

    Output: <input id="Checkbox1" name="Checkbox1" type="checkbox" value="true" /> <input name="myCheckbox" type="hidden" value="false" />


    RadioButton @Html.RadioButton("Radiobutton1", "val", true)

    Output: <input checked="checked" id="Radiobutton1" name="Radiobutton1" type="radio" value="val" />


    Drop-down list @Html.DropDownList (“DropDownList1”, new SelectList(new [] {"Male", "Female"}))

    Output: <select id="DropDownList1" name="DropDownList1"> <option>M</option> <option>F</option> </select>



    Multiple-select Html.ListBox(“ListBox1”, new MultiSelectList(new [] {"Cricket", "Chess"}))

    Output: <select id="ListBox1" multiple="multiple" name="ListBox1"> <option>Cricket</option> <option>Chess</option>



    @Html.ActionLink("HomePage", Index.new{style='color:red');

    Output: <a href="Index" style="color:red">HomePage</a>


    @Html.DisplayName("Enter your username");

    @HTMLDisplayNameFor(model => model.studentName);



    The following table lists HtmlHelper methods and html control:


    HtmlHelper - Html.ActionLink
    Html Control - Anchor link


    HtmlHelper - Html.ActionLinkFor
    Html Control - Anchor link




    HtmlHelper - Html.TextBox
    Strogly Typed HtmlHelpers - Html.TextBoxFor
    Html Control - Textbox



    HtmlHelper - Html.TextArea
    Strogly Typed HtmlHelpers - Html.TextAreaFor
    Html Control - TextArea



    HtmlHelper - Html.CheckBox
    Strogly Typed HtmlHelpers - Html.CheckBoxFor
    Html Control - Checkbox




    HtmlHelper - Html.RadioButton
    Strogly Typed HtmlHelpers - Html.RadioButtonFor
    Html Control - Radio button




    HtmlHelper - Html.DropDownList
    Strogly Typed HtmlHelpers - Html.DropDownListFor
    Html Control - Dropdown, combobox




    HtmlHelper - Html.ListBox
    Strogly Typed HtmlHelpers - Html.ListBoxFor
    Html Control - Multi-select list box




    HtmlHelper - Html.Hidden
    Strogly Typed HtmlHelpers - Html.HiddenFor
    Html Control - Hidden Field




    HtmlHelper - Password
    Strogly Typed HtmlHelpers - Html.PasswordFor
    Html Control - Password textbox





    HtmlHelper - Html.Display
    Strogly Typed HtmlHelpers - Hmlt.DisplayFor
    Html Control - Html text



    HtmlHelper
    - Html.Label
    Strogly Typed HtmlHelpers - Html.LabelFor
    Html Control - Label



    HtmlHelper
    - Html.DisplayName
    Strogly Typed HtmlHelpers - Html.DisplayNameFor
    Html Control - Display





    HtmlHelper - Html.editory
    Strogly Typed HtmlHelpers - Html.EditorFor
    Html Control - Generates html controls based on data type of specified model property eg. textbox for string property numeric field for int, double or other numeric type.


     

    Disclaimer

     
     
    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     
  • WHAT WE DO

    We've been developing corporate tailored services for clients for 30 years.

    CONTACT US

    For enquiries you can contact us in several different ways. Contact details are below.

    Hacking Truth.in

    • Street :Road Street 00
    • Person :Person
    • Phone :+045 123 755 755
    • Country :POLAND
    • Email :contact@heaven.com

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.