MVC :: Adding Routes - Best Practices?

Jul 4, 2010

We are working on a project which has lots of routes that can be changed on-the-fly or new routes can be added dynamically. What are the best practices about managing lots of routes and adding routes on-the-fly without recompiling? Reading-Writing from-to database or from Xml Document in Application_Start?

View 4 Replies


Similar Messages:

MVC Routes Adding An Optional Parameter At The Beginning Of A Route

Aug 7, 2010

I have the following routes setup in my route config file. I have a config reader that maps these to MVC-style routes.

[route name="customers" url="customers/{statename}/{marketname}/{pagenumber}"]
[controller name="Customers" action="Display" //route]
[route name="pcustomers" url="{customername}/customers/{statename}/{marketname}/{pagenumber}"]
[code]...

View 2 Replies

JQuery :: Ajax Call Doesn't Work After Adding Routes

Sep 16, 2010

I've added routes to my asp.net 4 website so that, for example the page: "~/Main/About/Careers.aspx" is mapped to the url: [URL] I'm using jquery to make an ajax call and it simply does not work after I've added the routing, I used the following code, and it remains stuck on the spinner image:

[Code]....

View 3 Replies

MVC :: Routes.IgnoreRoute Not Ignoring Routes?

May 25, 2010

I'm trying to prevent direct file requests from being accepted, and have tried this:

[Code]....

None of these worked. I want the rule to exclude any file of any filename in any directory with a matching extension. How can this be done?

View 11 Replies

How To Mix DynamicData Routes With Mvc Routes

Jan 9, 2011

I am trying to create an Area for running DynamicData with scaffolding as an administration part. It's probably working as it should but I can't get the routing to work.

In my global.asax I have the following function to register the routes:

[Code]....

Unfortunately the "best" thing that happened to me so far was that when I check the default tables I get a message about (MetaModel.VisibleTables)

[Code]....

The problem is that I don't know why this is. Is it the routing or something else? Is it perhaps some security thing or can I not put dynamic data inside an area?

The DynamicData folder itself is located in the root of the application since that is the convention it uses and I have no intention to override that.

View 1 Replies

Best Practices For Input Validation?

Jul 3, 2010

What is the common practice of input validation? In other words do you check for input validation on client-side, on server-side or on both sides?

Also, if performance is crucial to me, would just the client-side input validation be sufficient for my website without presenting any security risks?

View 6 Replies

C# - Best Practices To Add Some Data Into Queue?

Nov 24, 2010

I have a web application where users can upload the photo. I do have a windows service running which takes the uploaded photo and crops it to different sizes. This runs in a specified interval. Photo will be visible to the user once after it's cropped. So once user uploads the photo and photo cropper has not yet run, they wont be able to see the photo. Due to this behaviour user thinks that there was some error uploading the photo and they will upload it again and again.

where the photocropper runs immediately when the user uploads the photos which is queued.

I am using asp.net & C#.

View 3 Replies

Best Practices For Using MVC With A Dictionary-like Model?

Feb 11, 2011

I'm about to begin an ASP.NET MVC project and I'm not sure how to approach an aspect of the design. Basically, there is a user site and an admin site. In the admin sites, administartors design a form and send an e-mail link out to a handful of people. When the users click on the link, they are sent to the form.

Essentially what I'm wondering is what are the best practices when the model resembles looks more like a dictionary than a table?

In other words, instead of:

CREATE TABLE FormResponse (ResponseId, FormId, UserId, FirstName, LastName, BirthDay, Comments)

...containing 1 row per complete response

It's more like:

CREATE TABLE FormResponse (ResponseId, FormId, UserId, QuestionId, Value)

...containing 4 rows. 1 for the FirstName, 1 for the LastName, 1 for the BirthDay, and 1 for Comments.

View 2 Replies

MVC :: Best Practices For Outputting HTML?

Jan 29, 2010

I'm very new to MVC (just started 2 days ago), and I would like to know what the best practice is for outputing HTML.

I have a model named Tools.cs which contains the code below. It uses a stored procedure to return a recordset of menu items, and another to return a second level of menus for each first level menu. In another function, I then loop through the recordset and generate the HTML code to display the menu in a string, which is then returned.

I then have a controller MenuController.cs which calls the GetMenu method and puts the returned HTML string in the ViewData["RightMenu"].

I then have a view which displays the result.

My question is: would it be better practice to return my datareader to the controller into ViewData["RightMenu"], and then loop through it and construct my HTML in the View instead?How would I get that to work with that second level of menus?[Code]....

View 2 Replies

Reference Project To WCF Best Practices?

Feb 28, 2011

For WPF, there's the Microsoft Patterns & Practices's Prism project.

Prism provides guidance designed to you more easily design and build rich, flexible, and easy-to-maintain
Windows Presentation Foundation (WPF) desktop applications, Silverlight Rich Internet Applications (RIAs), and Windows Phone 7 applications I was wondering whether a similar project (reference implementation) intended for software developers building WCF applications exists.

In our main internal project (a .Net WinForms rich client app), we don't talk directly with the database but instead fetch and update data with ASP.Net web-services that we also control. Our current setup is giving us some bottlenecks. For a new smallish project, we want to try WCF. Objective question: Where do I find a not-too-basic WCF reference project?

View 2 Replies

.net - LINQ To SQL Web Application Best Practices

May 7, 2010

In my experience building web applications, I've always used a n-tier approach. A DAL that gets data from the db and populates the objects, and BLL that gets objects from the DAL and performs any business logic required on them, and the website that gets it's display data from the BLL.I've recently started learning LINQ, and most of the examples show the queries occurring right from the Web Application code-behinds(it's possible that I've only seen overly simplified examples). In the n-tier architectures, this was always seen as a big no-no.I'm a bit unsure of how to architect a new Web Application.

View 2 Replies

.net - Best Practices For Web Application Workflow?

Jul 18, 2010

All too often I find myself being required to design pages that flow through a series of steps. 1) Select from a set of options. Submit.2) Populate a page with results. Make changes. Submit.3) Do something based on the previous results. Submit.4) Confirm previous actions. Submit.5) Goto 1.An ecommerce site with shopping cart would be a textbook example of this.Now, there are any number of ways to deal with this. My question is, what is the recommended way to do it in asp.net? In PHP or ISAPI I would just use standard html controls, get the post data and do stuff with it, each on a different page

View 3 Replies

ADO.NET :: Best Practices Of Using Data Context?

Feb 7, 2011

Here is the code of my Repository class:You see, I use singleton here. Also you see, there is a data context as class variable of Repository class.The main reason to use singleton here is a wish to avoid using 'using(NorthwindEntities context = new NorthwindEntities())' in every function.

[Code]....

This Repository is used in ASP.NET application. So only instance of NorthwindEntities (context) is used everywhere and that's why I never dispose it.So my question is: Won't this code cause connections to the DB that are not closed?

View 11 Replies

.net - C# And Error Handling Best Practices?

Apr 2, 2011

Possible Duplicate: Best practices for exception management in JAVA or C# I am using class libraries and I try to put maximum code in class libraries so that it can be reused in other projects.Please advice me where I should put try catch blocks in class library functions or in front end forms (aspx pages) ?

View 3 Replies

Best Practices In Using Javascript In A Pre-AJAX And Pre-jQuery Era?

Jan 25, 2010

I would like to know what are the best practices in using Javascript in ASP.NET in a pre-AJAX and pre-jQuery era. What I meant by pre-era is not the time before AJAX/jQuery was created, but rather the time before it is popularized and widely adopted (by a significantly large number of programmers).i.e. Is it good thing to store the script in a string variable and register it on demand (RegisterClientScriptBlock) or on startup (RegisterStartUpScript)?Although in using Javascript in ASP.NET, its usage in PHP and JSP are also welcome.

View 1 Replies

Best Practices To Be Followed In Deployment Web Application & WCF Service In IIS 7?

Aug 17, 2010

best practices to be followed in deployment of asp.net web application & WCF service in IIS 7 regarding the IIS 7 configuration settings , Security setting, application access level settings..

View 2 Replies

Development And Test Environment Practices?

Jul 7, 2010

This question is for ASP.NET and SQL Server developers. What are your best practices with respect to setting up your development and test environment? I'm interesting in the following issues: How many tiers do you recommend and what goes on on each tier? Just dev, test, and production or perhaps dev, test, staging, and production? Which types of applications and/or servers should run on actual physical hardware and which can get away with a VM? What are your strategies for loosely coupling users from web sites, web developers from their web/app/DB servers, and DB developers from their DB servers?

How do developers stay "DRY?" What are the pros and cons to putting web, app, and DB servers on their own machines? Does putting servers on separate machines in order to minimize contention for a machine's resources trump any NIC and network latencies that might be introduced by putting them on different machines? How do you configure your web apps to minimize contention for resources (e.g. virtual directories, separate application pools, etc.) How and how often do you refresh your databases on each tier? Do you just refresh the data or both the data and objects?

View 1 Replies

Architecture :: Practices For Web Development - Get Information?

Sep 30, 2010

We are in the midst of developing WEB application using .NET. so, i would like to know the Best practises for ASP.NET development, SQL server db, IIS security and network security as well. Where to get the information? I googled for it, but i cannot get the complete set and the info was updated 7 years ago. [URL]

View 2 Replies

Architecture :: Developer Tools & Best Practices?

Aug 29, 2010

I use VS 2010 (C#) with SQL server 2008. I prefer to use the entity framework.

I would like to know are there any good developer tools/ways to simplify work?

View 3 Replies

Security :: Best Practices For Handling SecurityException?

Sep 8, 2010

I have locked a set of administration pages on a website using the PrincipalPermission syntax ie:

<PrincipalPermission(SecurityAction.Demand, Role:=RoleBLL.ROLE_NAME_ADMINISTRATOR)>

View 3 Replies

MVC :: 2.0 Messing Up Routes In ARR 2.0

Dec 28, 2010

I have a server that has been using ARR 2.0 on IIS 7. I recently added MVC 2.0 to my ASP.NET site. After adding it the ARR routes return the following error: The virtual path 'null' maps to another application, which is not allowed. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: The virtual path 'null' maps to another application, which is not allowed. Source Error:

[Code]....

Stack Trace:

[Code]....

In my web.config I can remove the modules attribute runAllManagedModulesForAllRequests and the ARR works, but it makes the MVC routes stop working.

View 2 Replies

MVC :: Routes Error In 2 RTM

Apr 3, 2010

I created an MVC 2 RTM Project and created 2 Areas (Admin and Applicants) The code belows was added into the global.asax: AreaRegistration.RegisterAllAreas(); I also ensured that duplicate Controllers were managed as i have a homecontroller in the root and the Admin Area. The code used was; new string [] {"MyAppName.Controllers"} This too went into the global.asax The error i got is below; A route named 'Applicants_default is already in the route collection. Route names must be unique. Parameter name: name how to resolve this?

View 6 Replies

MVC :: ViewBag And Routes (3 - RC2)

Dec 18, 2010

I am having an issue with MVC-3 generating outgoing routes for me. This is the address of the page I am on for both scenarios: [URL] Here are the map routes:

[Code]....

Scenario 1:
From the controller:
[Code]....
From the view:
[Code]....

The resulting link that gets created. [URL] If I change the controller code to read as follows:

[Code]....

I didn't make any changes in the view, only added those two lines to the controller and the following link is created: [URL] What am I missing here? This is consistent behavior, I was able to reproduce this in other areas of my application.

View 4 Replies

.Net Best Practices, Best Frameworks, And Benefits Of The Latest Version?

Mar 8, 2011

1. .NET best practices, 2.best frameworks, and 3. benefits of the latest version?I need urgent help to convince the customer to use .NET, but they want me to list these 3 things. Can you help me list and/or point me to good summarized articles for these?

View 3 Replies

Javascript - Best Practices For Facebook Integration Using The Graph API

Mar 27, 2011

When it comes to integrating your site with facebook, is it recommended to save all the user's info from Facebook to your DB, or is it recommended to query in real time all the info you need based on the user's id?

For example the avatar sizes are different on my site than on my facebook, so I may have no choice but to download the fb avatar, but for other things like name, gender, hometown, I was wondering if I need to save that data. Also, if I decide to change extended permissions at a later time, is that going to be an easy task?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved