How to: CRUD Using AngularJS and MVC Web API [closed] - c#

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I would like to use AngularJS and MVC Web API to create a form and its CRUD operations (see image below)
The form is constituted of three tables: Page, Preamble, Sections. It also has 3 drop down lists that will need to be populated from the database.
This is my first attempt to create a project like this one, and I am finding lots of examples and most of them use only one table.
Do anybody has an tutorial/ example in which more than one table is used?

There are lots of Angular tutorials at the end of a Google search, but can I suggest that you not think of your page controls/layout as being sourced from tables in a database but more as results returned from an API call (actually you shouldn't even be thinking about it like that, but it will start you on the right road) - ultimately these values may well be formed as a result of some database query but from the UI perspective that's implementation detail that it shouldn't be privy to.
Rather than:
Title, SEO Title, Percent Page = "Page Table"
Consider:
Title, SEO Title, Percent Page = api/pages/{page}
Then the implementation behind api/pages/{page} is hidden from the UI and so not tightly coupled to the database schema.

Related

A scenario in ASP.MVC Application [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
We are creating an ASP.MVC Application. We are following a MVC pattern.
In a page, we need to show a chart. Now, my senior suggests me a way which doesn’t follow MVC pattern.
My Way(follow MVC pattern) – On the button click, handle an input request by controller. Controller handles the model and view. View renders the chart on the browser which is simple MVC pattern.
Senior suggestion – Don’t waste your time on Model, controller.(as per him, this process will take extra time.) Direct call to a JS function on the button click. JS function using Ajax call, get the data from the DB and provide the data to chart. Chart will render on the browser.
In above scenario, which way should I follow?
Please suggest.
Since the js function is calling a method of one of your controllers, the MVC pattern is not violated. Just a call to the controller without loading the whole page. Trust your Senior ;-)

Understanding how content is served from the database to frontend web pages [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to understand on a conceptual level how information travels from the Database(Microsoft SQL) to the Frontend with C# & ASP.Net . I have not had much luck finding examples or diagrams which address this concept in a clear way. One example could be sending the string "Hello I am a string stored in the database & now I appear on this front end web page", It does not have to be specific to these languages, although if it is that would be great. Ultimately, I want to understand what are the components involved and how do they communicate information back and forth.Any articles,videos or diagrams that you feel of importance are also highly valued, thank you for your time.
Here's a diagram. I hope it helps.
An overview could be like:
User sends request to web server through client i.e. browser
Web server queries database
Get query results
Generates HTML (if results found)
Send back to the browser
Browser displays on the screen
Every step has details but it is an overview, hope makes some sense.

ASP.net suggestions as you type [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have an asp.net website with some tables (Radgrids) connected to a MSSQL. The users enter data in few tables and then they assemble other tables using drop down lists with the values entered earlier.
I am experiencing some double entry in few data tables and I am considering to implement a suggestion as they type to show similar entries already existing in that column of the database. Something like SO Questions that may already have your answer. A sort of popup showing entries already saved in that column with similar words.
A reference to something similar or to a type of controls used for these kind features will be appreciated. Not being a professional in coding I am looking for a starting point.
Thanks
You could use the AjaxControlToolKit
It has a decent (if not good) Auto Complete extender control that can be used to display values from a database.
Simply download the .dll and add it to your websites bin folder and you should be good to go.
You simply create a quick Page Method or web service that has a method which matches the required signature :
public string[] GetCompletionList(string prefixText, int count) { ... }
and you can return an array of the matched values of "Prefix Text", to do this you will need to use either ADO.NET code or some other way of finding the matched values.
You can also customize the look of the dropdown box and the number of items to display in the box should you wish.

How do I design a notification system to be used across multiple websites? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Some background: We have 3 websites that are all part of a standard workflow. Each website handles a different part of the workflow.
Website 1 is for sales (pricing, sales, etc)
Website 2 is for engineers (implementation, coding, testing)
Website 3 is for reporting (used by all but primarily for administration and management)
We're gearing up to add notifications in a way that's a lot like how StackOverflow does notifications. I actually posted this on Meta Stackoverflow because that seemed like the best route, but the question didn't get very far. The notifications in our context would be things like "John Smith's timesheet is late" or "You have been assigned to a project"
Now I'm curious as to how other developers have set this up. I'm primarily worried about code repetition and maintenance at this stage.
Specifically, should each website be responsible for implementing its own notification client? That seems like it'd be really easy for code bases to get out of sync. But at the same time, even if you build a library you still need to handle the HTML templates somehow. How much duplication of functionality is acceptable? I'm at a loss here.
As you can tell, I'm not really sure where to start. If this were for a single website it'd be a different story, but implementing it across multiple websites at the same time has be puzzled.
Some miscellaneous facts about our stack:
Server side: ASP.NET MVC 4 (C#)
Cliebnt side: jQuery + Knockout
Database side: SQL Server w/ LINQ to SQL
IE not supported.
You can also do something like google +1 button. Link to a javascript common to everybody and have a custom html tag that will indicate where to put the data with configuration if needed.
Since you own all the websites, you can put everything in it's own .dll and add it to the solution of each solution.
Are you need something like Redis.io? There is Publish-subscribe in Redis.io.

AngularJS form validation with MVC 4 [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm building a single page web application. This has many different forms on it that will require validation. I'm not using any of the Razor form validation, or views. Instead everything is held in Angular templates.
I get my data from the server using Web Api calls, including lists of form elements as many of the forms are dynamic.
I would prefer that my models hold all of the validation. I know I could duplicate this validation onto my angular templates for forms that aren't dynamic but this means that the validation has to be maintained in two places - I would rather keep it in one place, on my model, so that client and server validation are inline with each other.
What would be the best way to extract the validation on my model and use it on the front end?

Categories

Resources