It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
HI,
I want to create an application which requires SQL reports. By SQL Reports I mean using report viewer to show sql reports. I am new to MVC and my idea about MVC is that, dont use Server controls. Should I opt for ASP.Net MVC for this application?
If you mean report viewer, Crystal Reports or Reporting Services - you can use ASP.NET MVC and run reports on ASP.NET page. They can live side by side. In my current project I do just that - all of the application is MVC except for the reports viewer page. This is inside single IIS application - I use local web.config for few tweaks. But you can also dedicate a separate IIS app solely for ASP.NET reporting if you can't/don't want to run ASP.NET reports inside ASP.NET MVC applications.
I also found that sometimes generating reports in ASP.NET MVC as PDF documents and dynamically showing them inside iframe may be a better solution (cleaner and more printer-friendly for users).
From the top of my head. Yes ;)
Although "requires SQL reports" is not a very detailed requirement to go on, can you elaborate what you wish to acheive?
I'm guessing by "requires SQL reports" you suggesting it is very data intensive and you are thinking ORM (e.g. EF) is out of the question.
Weel, you can still use MVC with standard ADO.NET with stored procedures for your data layer. You can even use entity framework with stored procedures if need be.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I have been working as WinForm (C#) Developer since Aug 2010. Now, I am planning to migrate into Asp.net MVC (C#). I have been learning MVC with http://www.asp.net/mvc for last 10 days. But I found that it only emphasizes on razor technology over ASPX. I just want to clear doubt that Do you use Razor technology in your MVC Project over ASPX. Please also mention other stuff I should learn (or from where) to be an Asp.net MVC Developer (Good & Employed).
Thank you,
Aman
Welcome to StackOverflow (SO)
Razor is simply a template engine, meaning that you write a string and put placeholders in it to be filled by some data. Razor is really easy to use, thus:
hello #name
in Razor would be:
hello <%= name %>
in ASP default inline statements. Thus yeah, many developers recently prefer Razor.
If you want to become a good ASP.NET MVC developer, I suggest to follow these topics as starting point:
Filters
HTML Helpers
Razor Syntax
ViewBag, ViewData, and TempData
Routes
of course, these suggestions need you to know ASP.NET, and MVC, and many more stuff as prerequisites.
Using Razor is indeed a more effective approach then to use ASPX-page markup.
Razor is simpler and cleaner. With "cleanness" comes a better code-walk capabilities. In aspx we had a lot of syntactical junk on the way, and a developer's intention to alter or get to know the code were "wearing off" more quicky.
With Razor, you see a much broader picture of a page's view at a glance.
Razor is not the core of being a good ASP.NET developer though.
The following may be a subjective optinon, but as soon as you realize how web server (ports, urls, routing), Controllers, Views and JSON data fromat tick together, as soon as you are able to quickly parse server-generated JSON model on the client with KnockoutJS or other MVVM framework, making your pages go "alive", you are becoming a developer who can create a web site on his own. You should specialize in something, no doubt, but to be a good developer, you need fully understand how Microsoft Stack of web technologies ticks.
Aman As far as Razor over ASPX concerns, I say yes Razor is widely used in industry and as you are beginner in ASP.NET MVC, I suggest to learn MVC 4. You can get more info on MVC 4 from http://www.asp.net/mvc/mvc4 and here is article series covering new feature in MVC 4 http://www.dotnetexpertguide.com/2011/09/aspnet-mvc-4-article-series.html
I have read 3 books on ASP.NET MVC and 2 books on the Entity Framework. I have been developing in MVC 3 since it was released. Absolutely the best resource I have found is Scott Allen's training courses on ASP.NET MVC 3 on http://pluralsight.com/training/Courses/TableOfContents/aspdotnet-mvc3-intro Scott really knows his stuff.
This isnt just your typical canned developer training that is read from a script by a voice actor. Scott really knows web development and he shares some great inside tips on programming MVC 3. His C# stuff on http://pluralsight.com/training/Courses/TableOfContents/csharp-fundamentals is also very good. No, I do not work for pluralsight, I am just a happy pluralsight.com subscriber.
You must know HTML, CSS, jQuery and JavaScript in order to be an effective and productive MVC 3 developer. Go to http://www.w3schools.com/ and do all of the tutorials on those subjects.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Still i am not familiar with asp.net mvc. Now asp.net mvc is very popular. Before learning it I like to know few things like:
If there is no concept of viewstate then, how control state is maintain during postback? If discuss it in details and if possible give me sample code for persisting control state in mvc.
In webform we often use update panel and other controls of ajax control toolkit. So tell me how people embed ajax functionality in mvc? One option is jquery, but is there any other option too? Is there anything like update panel or ajax enabled controls?
You said it is possible to work with asp.net webform and mvc in same project. So tell me, how data can be pass to webform or aspx file?
How very easily we can migrate any asp.net webform project to mvc?
Is there any easy small project based on mvc, which beginner can dowload and go through the code, to understand flow of mvc project? Just like any shopping cart.
What is strongly type & partial view in mvc?
I have no idea about mvc project type. That is why many question is coming to my mind. Please do not feel irritate to answer all this. I apologize for all the above basic question.
This is borderline subjective and might be closed but I will give it a go at my responses to your questions.
The web, by nature, is stateless. ViewState and Postback are .NET concepts that are not natural to the HTTP protocol. If you absolutely must keep persistence, you will need to look at cookies/session.
You can use a framework (jquery and jquery UI, YUI, etc) or roll your own javascript functions. The concept of web controls (though they 'could' be used in MVC) is gone. You will use standard input, select, button HTML controls.
I have not done this, I cannot provide much help here
Depends on the project and how it was written/coded. There is no straightforward 'conversion' that one can do. MVC vs WebForms are two different paradigms.
MVC Music Store and MVC NerdDinner
Strongly typed views are views that are passed a class (model) that has a specific set of properties defined. Using this model, you can pass only the data you need for that view, do type checking when posting back a form, etc. A partial view is simply a view that does not contain all of the layout (master page) stuff. It is to be used to simply display a subsection of a web page (think of a panel)
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
am a newbie, but I am given this project where I have to make an address book using MVC. The problem is I have no clue how to use MVC I am familiar with asp.net though. I have no clue how to get started. I AM NOT ASKING ANYONE TO DEVELOP ENTIRE PROJECT FOR ME i am just unclear where to start and What WCF mean, where do i have to use it in this project? HOW LONG WOULD IT TAKE ME TO LEARN MVC from scratch and complete this project? Assuming i am at beginner level in c sharp and asp.net The following are details:
Functional Requirements:
Information of Individual people will be stored in the Address Book.
Each Individual can have multiple phone numbers, email addresses and instant messenger contacts.
Show a List of All the Contacts.
Allow Adding new Contacts
Allow Viewing / Editing / Deleting of Contacts
Viewing of Contacts shows the detailed Contact Information and linked Phone Numbers, EmailAddresses and Instant Messenger Contacts.
You can Add / Edit / Remove Phone Numbers, Email Addresses and Instant Messenger Contacts.
Technical Details:
Contact will have the following information:
Title
First Name
Last Name
Middle Name
Age (Numeric Field)
Date of Birth (Date Field)
Sex : (Male or Female) -
Radio Box Category : Options are Business, Family, Other (Drop-down box) - This should be a Enum in your Data Structure
Phone Numbers will have following information:
Phone Number Type : Home, Work, Mobile, Other (Enum)
Phone Number:
Email Address will have following information:
Email Type: Primary, Secondary, Work, Home, Other (Enum)
Email Address:
Instant Messenger Contact will have following Information
IM type: AIM, MSN, Yahoo, Jabber, GTalk, Other (Enum)
IM Address:
The application should be a N Tier Architecture, using objects and WCF services. The Website should be done using MVC .
Your web application should not have any hard coded styles and should use CSS for all styling. Also your web application should have a Master Page / Layout [ look how you can deal with master page concept in MVC ] to allow easy updating of all pages at a later date.
All the input fields need to be validated.
Incase of any errors on the page, the error message should be shown on the top of the page (Default error page should never be shown) and the error message should be logged in a logging file (use Log4Net for logging).
Steps:
Create your Class Structures
Create your Database Structure. Make sure that you have your SQL file different so that the application can be easily ported to a different machine.
Create your WCF Service with necessary methods.
Write NUnit tests for your WCF Service Methods.
Create an HTML Prototype on how your pages will look and get that approved before you start actual implementation.
Create your Web Application.
Create an msbuild script to build your code.
Good ASP.NET MVC Tutorial: http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/cs/intro-to-aspnet-mvc-3
WCF means: http://msdn.microsoft.com/en-us/netframework/aa663324.aspx
Information on using ASP.NET MVC and WCF together: http://weblogs.asp.net/cibrax/archive/2010/10/08/asp-net-mvc-wcf-rest-and-data-services-when-to-use-what-for-restful-services.aspx
WCF is Windows Communication Foundation. It's the technology you use to create the web service that the MVC web-site will communicate with to retrieve and update data in the backend database.
Basic idea is the user interface is a web-site served by ASP.Net MVC. The MVC application operates as a client to the WCF web service. The WCF service is the front-end to the business logic layer which process and stores/retrieves the information to/from the database.
Not sure about WCF resources but for learning MVC you can do a lot worse than looking at the Nerd Dinner ( http://nerddinnerbook.s3.amazonaws.com/Intro.htm ) and MVC Music Store ( http://www.asp.net/mvc/tutorials/mvc-music-store ) tutorials. They don't deal with MVC communicating with a WCF back-end, but should give you a good handle on MVC.
This is my favorite for learning any new technology.
http://www.asp.net/mvc/pluralsight
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
With the release of ASP.NET MVC 3, I am wondering what are the major reasons (killer features) we should upgrade our app to MVC3.
Our app is currently in MVC2 using:
Ninject & Ninject.Web for IoC,
Linq to Sql
jQuery (no ASP.NET Ajax)
flot charts.
MVC Contrib
Custom REST (through dynamic WCF no XML config files)
We do not use ASP.NET charts or EF etc.
Is there any real compelling reason we should upgrade to ASP.NET MVC 3?
Here's a few additional features in ASP.NET MVC 3
Razor view engine (Widely seen as a vast improvement on the previous ASPX view engine)
Improved model validation with unobtrusive JavaScript and jQuery support. Including new remote validation amoungst others
Partial page output caching.
Dependency Injection Improvements, new IDependencyResolver`
More imporvements and details can be found at ASP.NET MVC site along with Scott Guthrie's anouncment
But only you can evaluate whether you should upgrade or not for your specific project.
It should be noted (as Robert Koritnik commented) that MVC 3 requires .NET 4.
No more custom controller factory! This will apply to you. They wrote a new IDependencyResolver that you implement and DependencyResolver.SetResolver(...). Your IoC will go through out the application.
http://weblogs.asp.net/shijuvarghese/archive/2011/01/21/dependency-injection-in-asp-net-mvc-3-using-dependencyresolver-and-controlleractivator.aspx
The main two reasons we're about to upgrade are:
1) The ability to control HTML validation on a per textbox basis rather than on a whole page- this means we can allow the users to enter HTML into some textboxes on a page, rather than having to control it at the page level.
2) Remote validation - much less ajax for us to write!
1 Razor
2 Razor Intellisense within Visual Studio
3 Partial Page Output Caching
4 Validation and JavaScript/AJAX improvements
The Razor View Engine will make your view code nicer.
More details here
Apart from all the answers there are few other reason for adopting MVC 3
Unobtrusive Javascript
Global Action Filters
Custom Validation attributes and Self validation
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
after Redirection , the Session data is lost???
thanks your reply. and i found i write somes file to the webapp ,so the session is lost
Your asp.net application is restarting. You are probably writing to a location in the asp.net folder that is causing a recompile of the app / not just a sub folder. One special location is the bin folder, drop the smallest of files in there are you get a recycle (shouldn't have a file in there).
The above can be avoiding by writing to a location outside the asp.net folder. Alternative you can write to a different subfolder at the top level and you shouldn't get a recycle.
Another option is to move the session out of process, by using a different SessionStoreProvider. When using the memory based one, your code shouldn't rely on the session from not being lost, since there are other reasons why an asp.net recycle can occur.
You really need to post more information, the information is Not lost in asp.net MVC2 under normal conditions.
If you are referring to TempData only during for 1 request, it is by design. Its only meant for the very next request.
If its regular session, maybe you have only cookie based session configured in the .config and the browser has blocked the cookie.
Also maybe you are redirecting by using a full url (with http://mydomain) and you are using cookieless (or the browser blocked the cookie and it reverted to cookieless), the use of http://mydomain makes asp.net not to consider it as a request inside the app and doesn't add the session id to the url.