Data Driven Web Application Using MVC
Nov 25, 2010Sample web application code where content(like forms) is generated based on user role like admin,priority1 user,priority2 user.
View 1 RepliesSample web application code where content(like forms) is generated based on user role like admin,priority1 user,priority2 user.
View 1 RepliesSo, after all and after all these projects that have been done. What is the best way and I should consider as standard in the furute to start any further ASP.NET Projects that are database driven.
I have done many using
1. Store procedures and classes
2. One class to handle all the add,delete,update ...etc functions
3. ADO.NET
4. Using sql statements directly on the code (I know not recommended, it was my first project) :))
..and so on
What method you recommend in the future that will save me code and errors and optimize my application speed as well.
the best practice for a designing a simple CRUD application with some screens updating various tables (like admin pages to maintain static data for an application). the simplest way would be to drag a data grid/gridview, bind it to a dataset and use a data adapter for CRUD operations. but if this application needs to be scalable, lets say to add any extra UI/business logic in future, then is there any design pattern that can with this? should I be using an object data source control and bind it to business objects instead? or are there any better ways of doing it? should I build a complete layered application or will that be overengineering for this requirement?
View 3 RepliesI am looking for an open source Thermometer that i can connect to a JSON or XML datasource and display this on my website.
The site is an asp.net site so javascript controls are not a problem. My Googling didn't reveal very much at all.
First, I am new to VWD 2010 and attempting to create a data driven website.
I am attempting to return a value from an sql server stored procedure and store that value in a variable. I have searched here and online and tried to follow the examples that I found. However, I have not been successful in making it work.
Here is my stored procedure:
[Code]....
Here is my VB code behind where I am attempting to get the return value:
[Code]....
I know that I have a good connection because I am using the same connection string from my WebConfig file and it is working in other instances.
Below is the error message that is being displayed.
'The formal parameter "@monRegAmt" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output."
I'm used to developing private applications for very small amount of concurrent users (usually no more than 10) on very good servers, so I have never been pressed about stress testing my applications. That being said, this is something I want to have a better grasp on my applications.
FYI, all of my websites are based on ASP.NET 3.5 (WebForms), NHibernate (specially interested in testing it with numerous concurrent sessions) as the ORM of choice and require Active Directory authentication.
How to Access 2007 data driven website SELECT Article, ArticleContent, Category
View 3 RepliesI have a page with 6 large GridViews on it, and I'd like to add tooltips to the headers on each of the GridViews. Now I know how to add the tooltips, I'm planning to simply use a variation of the code at the bottom, but I'm wondering the best way to go about loading the data for the tooltips.
What I have is a table with descriptions of each of the columns, and I want to use those descriptions as the tooltips, but I need to do it in as light an implementation as possible, so hopefully I'm not going to the database too much, certianly I don't want to have to make a trip to the database for each cell, I'd like to load all of the data only once for each page load.
[Code]....
Im trying to incorporate the ajax controll toolkit slider control within an ascx control so that i can then use that within a repeater on an aspx page. Basically i want to have a number of slider controls rendered to a page with default values based on data from a database. i need to put the slider within a data bound repeater as i wont know until runtime how many sliders i will need (maybe there is a better way?). does anyone know of ay examples of how to do this?
The user will then need to be able to move the slider to the value they are after and on the mouse up event ie when they release the slder I will want to be able to update my database with the value they set it to. This bit i think i am ok with but i cant seem to work out how to build a page where by i can render lots of slider controls wth default valuesset from a database.
I didn't really know where and how to put this so here we go:
I'm trying to design a map with co-ordinates that's driven from data in a database. I want it to look something like this:
Also, the selected X/Y co-ordinate must be centered for the user to see. How could I produce something like this?
I have a website using .Net framework 2 on a dedicated server who's display periodically corrupts - typically after heavy traffic numbers to the server. I can correct the problem simply by uploading a batch of user-controls to the server, or recycling the memory pool.
Has anyone else seen this type of effect before, where the display of data-driven elements of a website corrupt?
Corrupt image first.
I have a data driven site that displays a lot of information, particularly images, using listviews contained within UpdatePanels, since this data can change with each post back you often see 'submit query' before the Item image appears. So, is there a way of making the page display only after it has finished loading data? The delay as the page loads is only brief but looks quite ugly when 'Submit query' appears all over the site.
View 2 RepliesDid anybody do Database Driven - Horizontal and Vertical Nav without using XML?is it possible to bind menu control with query or view and pass query string to find particular horizontal nav and vertical nav?Please post working solution, i was trying for days to find a working solution. All the samples i tried is not working or it is too complex.i love to write and manage simple code.
View 1 RepliesThe web app uses XML from a web service, which is then transformed to HTML using XSLT. The app uses a HttpModule to get the XML using AddOnPreRequestHandlerExecuteAsync.
Classes Used:
XmlDocument - stores the xml.
XslCompiledTransform - stores the transform, is cached in Application.
Asynchronous HttpWebRequest using BeginGetResponse/EndGetResponse
HttpModule with hooked AddOnPreRequestHandlerExecuteAsync events.
I do not want to use the XPathDocument unless there are no other possible optimizations. It would take some complicated code to get all the XML together without the ability to write to the XmlDocument. There is additional XML that does not come from the web service that must also be added to the document.
I am in the process of putting a new site together which will make use of AJAX to pull through page content should the user have javascript enabled.
So, I am in the situation whereby every Action Method requires a check to see if the request was through AJAX or not, which is straightforward. If the request was through AJAX then I can return a partialview, if not then a full view can be returned.
With this pattern though, I'll need to create a View and a PartialView for every page on the site. The only real difference between them is going to the inclusion of the masterpage.
Am I missing a trick here is is this doubling up of views the only way to go?
I had a page that could get accessed through /site/test. Somewhere in my JS I would add a hash to the url like so #/site/test. JS would then watch for any hash changes and load the partial views as needed. If JS was not available though, an entire view would need to be returned.
So for each page I would need the view, which would then include a call to RenderPartial which would load up the partial view which would actually contain the page content. So, for every page there are two files. It just seems there should be a cleaner way of doing this.
Assuming my application did not warrant a full blown DDD setup, would Repositories still be useful? I like the way they shield from implementation details (such as use of Entity Framework) underneath. However Repositories tend to be tied to Aggregate Roots (the concept is still a holy grail to me) by definition.
I suppose the question could also be put as such: if I have a typical 3-tier application, with a business layer facade consisting of "logical grouping" classes based on functionality (rather than aggregate roots as in DDD) such as TradingManager and ContactsManager, would it make sense to also create "logical grouping" repositories. Or perhaps a Data Access Object, which I believe is like a Repository without the aggregate root requirement. Of course I will still have a Model (EF POCOs) that will be passed up and down between the layers.
Also, is what I just described would be considered as a Transaction Script approach? It's certainly not DDD, and not Active Record. I'm not even sure if Active Record exists with EF4 like it does with Nhibernate.
I am trying to understand how others structure n-layered applications when they do not follow DDD.
I'm doing some asp.net mvc coding using DDD. I have objects representing the business entities and service repositories that handle fetching and adding them. I'm new to this and as my application grows I begin to see a lot of secondary code that must run as a result of adding, deleting or changing my domain objects/data.
I'd like to make an event driven system where one action triggers other parts of code to run. For instance when I delete a user I want to be able to subscribe a number of other things to this action so they all are run when a delete takes place.
How have you coded your applications to handle these situations? How can I establish a reliable and coherent OO system for my problem? I already know about events and delegates but I'm more interested in coding techniques and nice practices.
I have several tables in a database (6-7 tables and ~200,000 records, MS SQL) that I'd like users to be able to use a web based query form and return information/datagrid/download csv/excel files. I'd like the user to be able to query the table they want and fields they want, time they want (maybe datepicker)or by selecting a field and perform a GT/LT operation on it. Has anyone done this and if so are there any resources/templates for this type of thing?Here is an example:I have a 'weather' table with 20 variables in it. I'd like a user to be able to select the fields they want to export (radio/check box) by using a date picker A user could select the variable "Temperature" and use GT/LT, etc. some value they enter. in a perfect world, the user could select a checkbox to include all other fields in the output.
View 1 RepliesI've got a really good idea for a service I'd like to create for the web, but since I'm new to ASP.NET I'd like to get everything up and running before I go and buy hosting etc.
What I'm curious about is the database side of things.
I don't quite understand how I can create a datebase on my computer for the sake of testing and practicing (Presumably through mssql server) and then just transfer it to a hosting account when I'm ready.
I guess the main part I don't understand is how can I connect to a database on my computer via my application and then change the connection so that it points to the web version when I'm ready.
I know that when you create the database and include it in your project it's not technically inside your project (Right?), but it just seems that the application is very rigid once you've specified the connection.
I am somewhat of a novice at ASP.NET, but have a lot of database experience. I want to build a web query interface to allow users to get data back from a database. The idea would be to choose various fields (I have about 20+ fields and 200,000 records in the database, and use either the checkbox, listpicker, radio, etc. to select the fields they want). Then the person could search by date, or search by greater than/less than statements in a particular field.
For example: the user could select: Temerature as the variable, and then Greater than and then enter a value and hit submit. I'd like the option to be able to include all the other fields from the table as well (maybe with a check box or something).
On my local machine I have created a database driven website. All is working well on my local machine.
Now I want to upload it to my Arvixe Hosting. How do I do that from Visual Studio 2010 Keeping in mind I have a Database too ?
Do I need to manually create a Database on the Server ? Do I then create all the tables Manually ? Do I then populate the tables manually ? Or is it a 1 button click ?
I want to know what is the advantages of using aggregates in c# for design patterns.
suppose i have tree tables
Member(M_Id,M_Info)
Bid(B_Id,B_Info,M_Id,Item_Id)
Item(Item_Id,Item_Info)
"One member can place more than one bid on more than one item."
so there is one to many bidirectional association between Bid and Member table.
And one to many association between bid and item table Now According to defination of aggregates in this case Item table is the root of aggregate item and item has aggregation with bid table.
and bid table holds unidirectional reference to member table and hence only bid table has access over member table.
But ultimately this will also map in database same as without using aggregate then what is use of aggregates?
I amcreateinga dynamic web application and I wand the ablity to to control the bcakround color and backround images to controled by a database entery. does anyone know how to do this I am at a loss and I have been searching on the web all day to do this
View 5 RepliesMy task for today is to fully understand event-driven programming and how it works. Now there are several ways this can be achieved. The first one is to actually program a basic program that covers the key concepts, and the second approach is to watch a video that explains the key concepts in a way I can understand. Which approach do people recommend?
Does anyone have videos/program demos they found useful and could recommend to me? My major experiences are with ASP.NET MVC, so it would be best if the tutorial were with WebForms ASP.NET.
In this article [URL] ....
I am receiving "Object reference not set to an instance of an object" error. It pops up in line :
Menu1.Items.Add(menuItem) in method called "PopulateMenu"