This is blog by the developer and for the developer.I am creating this blog for help the people to learn from basic to advance level concepts in technology world.
Test Post from Sagar Jaybhay
Get link
Facebook
X
Pinterest
Email
Other Apps
Test Post from Sagar Jaybhay https://sagarjaybhay.net
In this article we will understand How to delete data using Post request in Asp.Net MVC? and How to add Confirmation alert box on button click in Asp.Net MVC by Sagar Jaybhay . Always remember if you want to delete data from the database use Post request. Never use Get request for deleting resources on a database. Because if you have to get a call to delete data from the database and any hacker or some malicious user got your Get URL then he can delete your data. Also, google try to index your page as an SEO point view so if you issue get request then it’s not good practice to delete data using Get so always use Post request to delete data. In our application see below image we use action link to delete Employee from a database but this will issue a get request to avoid this we need to use the button for post-call and this we need to use Form control in our application so we rap our application inside form and issues a Post call for delete. To create button control here code is ...
In this article, we will learn about How Angular 9 knows which module is the startup module and which is not ? Also, we will understand Which conventions Angular team Uses by Sagar Jaybhay . Which One is the startup Module? This is mentioned in the main.ts file and below is coed for this file. import enableProdMode from '@angular/core'; import platformBrowserDynamic from '@angular/platform-browser-dynamic'; import AppModule from './app/app.module'; import environment from './environments/environment'; if (environment.production) enableProdMode(); platformBrowserDynamic().bootstrapModule(AppModule) .catch(err => console.error(err)); platformBrowserDynamic is used to a bootstrap module. This used to set the first module. But another question is ..... How main.ts file is invoked in an angular application? The main.ts file is invoked by index.html file. But if you see the index.html file code we didn’t find any kind of script invocation code because t...
In this article we will understand model binding updateModel tryupdateModel -mvc ASP.NET MVC By Sagar Jaybhay . But for this you need to read previous article where we start CRUD Operation in MVC . Model Binding [HttpPost] public ActionResult Create(string EmpName, string EmpSalary, string gender, string EmpEmail, string EmpCity, int departmentid ) var employee = new Employee() EmpName= EmpName, EmpSalary=Convert.ToDouble(EmpSalary), EmpCity= EmpCity, EmpEmail= EmpEmail, EmpGender=gender, DepartmentID=departmentid ; new BusinessLogic.Business().CreateEmployee(employee); return RedirectToAction("DisplayCompleteEmployee"); In this above method, we use the method parameter and when we click on Create button this method is called. Also, we can use FormCollection in this which required the key to access data and we get this key from formcollectionobject.allkeys get all keys. But how the form textboxes are bind correct data to parameters in that method is by using...
Comments
Post a Comment