I'm creating a controller that will serve the combined/minified versions of my JavaScript and CSS. I need to somewhere along the line define which scripts/styles to be loaded.
When a request is made, for example for style.css?VersionNumberHere, it will check if the combined/minified data is already in the HttpContext.Cache, if so spit i...
I am building an MVC 2 web app, where I want to display information about something (the parent) as well as child details which are displayed as rows (children have a many to one relationship to the parent).
I have implemented AJAX in MVC before using Ajax.BeginForm and partial views
Using this method - with minor changes for MVC 2 rel...
I would like to replace validation message for all model properties that have [Required] attribute from the default "The XY field is required." to "*". I want to do that site wide in one place without having to add a custom message to Required attributes or passing additional parameter to ValidationMessageFor() Html helper.
Any ideas?
...
I'm using Application[""] to store a few lists of very small size. I would ideally set it at only place.. Application_Start... but is there a chance the data might get lost in middle and I might have to store these lists back in Application inside places other than Application_Start? If yes, should I be prepared for any kind of race cond...
Merging the web.config files of a legacy ASP.NET App and a new MVC app has pretty much defeated me.
Is there a way I can build my solutions with projects sectioned off into subfolders?
EG (each project to have its own web.config):
~/PlainVanilla/ /* original asp.net app - still some life in old dogs */
~/PlainVanilla/StrawberryMV...
Hello,
I would like to edit the rows of my jqGrid in a new page. I have setup a custom function for the edit button with the use of the parameter "editfunc".
How can I redirect the user to that page within the javascript function?
I am using asp.net MVC 2.
...
I have 3 many-many tables: Users -< UserRoles >- Roles. I set up my model like this:
public class User
{
public int UserId {get; set;};
public IEnumerable<Role> Roles {get; set;};
}
public class Role
{
public int RoleId {get; set;};
public string RoleName {get; set};
}
public class UserDisplayModel
{
public User Us...
I have a partial control formy.ascx that I am using on a lot of pages that contains a form.
When I click submit on the partial control, following function handles the form submission.
[ActionName("FormyTemp"), AcceptVerbs(HttpVerbs.Post)]
public ActionResult FormyTemp(FormCollection result)
Now, I need to know what page i.e. action...
I am using ASP.Net4 MVC2 for my application. The first person using the application usually experiences a long wait before the application responds. After that the application is pretty responsive. If the application is idle for 15 minutes, the same person or the next person using the application will experience long wait again. It l...
My problem today is rather simple, but its driving me nuts!
I just downloaded and installed the ASP.NET MVC 3 Beta and created a new project using VS 2010. But when I check the scripts folder, there are none of the following files there! (from what I understood, they should be there):
· /Scripts/jquery.unobtrusive-ajax.js
· /Scripts/jq...
How can I edit a xml file using JQGrid? I am using ASP.Net MVC 3.5 with C#. Is it possible to return a JSon object from controller method for this purpose?
...
We got a lot of intranet websites that share the same design. Therefore we've put the master pages, stylesheet, images and javascripts in a shared assembly.
The content is loaded by using:
HostingEnvironment.RegisterVirtualPathProvider(new VirtualFilesProvider());
ViewEngines.Engines.Clear();
ViewEngines.Engines.Add(new WebFormViewEng...
I am working in asp.net mvc & want to create a restful web service.
Can you please let me know how can i create a restful web service in MVC & how can i use it ?
My requirement is :
i have an application server which send some parameters to web service & the web service should connect to remote server & return image on path (whose path w...
I'm quite new to both ASP.Net and MVC.
I got the following code in my master page:
<div id="main-menu" class="menu">
<%
var items = (IList<CompanyName.Framework.Web.MenuItem>)ViewData["MainMenu"];
if (items.Count > 0)
{
%><ul><%
foreach (var item in items)
{
if (!string.IsNullOrEmpty(item.RequiredRole) && ...
hi...
I am using solr for search in mvc.net application,and its working very well. but now i want to search on solr by date, so when i add a new node for date in my xml and try it to post on solr thn it gives some error like (unknown field 'date')....
thn i add new field in solr schema nemed ('date'), so plz tell me what type i define ...
I'm trying to design a solution in MVC in which a string representation of a class is passed to the controller which should then build a grid with all the data belonging to that class in the DB. (I'm using an ORM to map classes to tables).
//A method in the Model that populates the Item Property
foreach (MethodInfo method in...
I need to write a menu in Site.Master where certain menu items have to be visible or not depending on current user role. How can I check that from the page?
Usually would just write the logic in a controller, but the Site.Master doesn't have one (in my project at least!). I'd appreciate any pointers.
...
Hi,
i m using asp.net mvc2 and i want to drop some json objects from my controller similar to validation metadata. when we call Html.ClientValidation() before our form it drops some javascript on the page like
<javascript type="text/javascript">
<!--CDATA[validation metadata]-->
</javascript>
i want to have some json objects dropp...
public ActionResult DoSomething(string[] arr, bool someBool, int someInt) { }
trying to call the above method from jQuery:
var test = [];
test.push('dog');
test.push('cat');
$container.load('MyController/DoSomething',
{ 'arr[]': test, 'someBool': true, 'someInt': 1 },
function(response, status, xhr) {
...
So as the name suggest I have a treeview in an mvc view that persists by its location but sometimes you travel off the route of the tree, for example:
Main page
----Child Page
Say i went to an edit page for the details on the child page, I would still technically be in the child page node but the url for the page is different.
If I ...