asp.net-mvc

Actionlinks add wrong parameter when custom routes is used

I am using this custom route to enable paging in my index method in Home controller: routes.MapRoute( _ "HomePage", _ "Home/Index/{page_num}", _ New With {.controller = "Home", .action = "Index", .page_num = ""} _ ) But when I navigate to any page for example page 2, actionlinks append the page number to the url: ...

What's a feasible method of implementing a "tasks" application that runs alongside an ASP.NET MVC site in Medium Trust?

I'm writing an ASP.NET MVC site where I need to have a "Tasks" application that runs alongside the website. Such a "Tasks" application would collect data at set intervals and insert it into the database. Of course, I could write a simple Console Application and use the Windows Task Scheduler to run it, but my site is being hosted by GoD...

ASP.NET MVC VS2010 Crystal Reports Beta 2 Can't Print, Export, Zoom, or Change Pages

I just upgraded to the beta 2 of Crystal Reports for Visual Studio 2010 and I'm not able to print, export, zoom, or change pages while using the web control in an ASP.NET MVC application. I can get the report to run and display just fine on the webpage. All of the buttons have images, and the report data looks exactly as it should on t...

Edit View posts wrong object

I have a Edit View generated by VS 2010 (code below). I don't want the user to see the ListID, so i commented it out. What happens is that if I comment the <%: Html.TextBoxFor(model => model.ListID) %> line, when I hit submit, the Controller instead of receiving something like a DSList with name="x" and listID=10, always gets the listID...

Selecting Instances of an Interface Based On Specific Value

I'll start here with a little bit of background. We have an ASP.Net MVC web application that sits upon a structure roughly based upon the Onion Architecture concept. Therefore, we have the following (simplified) vertical structure: ASP.Net MVC controller layer Application service layer Business Service layer NOTE: The above is simpli...

Cannot Get RazorView from Windsor Container using MVC 3 Beta

Hi, This is how my Application_Start looks: protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); _container.Register(Component.For<IWindsorContainer>() .Instance(_container), ...

RouteLink with dynamic parameters

Hello I'm trying to store routes in database, and list those based on parameters. Kinda like: Route = "NewsDetail" ParamKey 1 = "NewsID" ParamVal 1 = "4" .... 2..3 And I would like to know how I create those routeparameters for the link... <%= Html.RouteLink("Somename", "NewsDetali", new { newsID = Model.News.NewsID, headline...

ASP.NET MVC RSS feed datetime format

How can I get this datetime format for an RSS feed? Mon, 06 Sep 2009 16:45:00 +0000 ...

Button click in jQueryUI tab problem

I used jQueryUI tabs widget as fallow: <div id="tabs"> <ul> <li><a href="<%:Url.Action("List", new { statusId = 0, typeId = Model.TypeId }) %>"> <span>X</span></a> </li> <li><a href="<%:Url.Action("List", new { statusId = 1, typeId = Model.TypeId }) %>"> <span>Y</span></a> </li> </ul> </di...

Best way of passing session between 2 sub-domains with MVC

During the buy process of my ecommerce site that I'm developing in MVC I need to pass the "cart" session to a different subdomain (e.g. http : //www.abc.com to https : //secure.abc.com). I guess I have to perform the same trick as with webforms where I save all the variables associated with the session to a database, then pass the ID of...

Return url by routename and routevalues

Hello I'm trying to programatically generate a link by routename and routevalues. I store the routes and values in the database. How can I adjust this helper in order to make it work? public static string GenerateLink(this HtmlHelper helper, string routeName, Dictionary<string, string> parameters) { // ?? RouteValueDictiona...

How to run a leightweight ASP.NET MVC application that would be accessible only locally (not on IIS)?

We have a desktop client application and recent customer requests indicate that they would like to have some dynamic HTML content served and displayed by the application. We are considering hosting a simple ASP.NET application in a local process, accessible only from the local machine (similar to the ASP.NET development web server used ...

Switching from ASP.NET MVC to Java

Last 8 months I have been working in ASP.NET MVC framework but now I have to switch to Java. So, I wonder what is Java's framework that is the most similar to ASP.NET MVC. I would like to stick to MVC pattern but most of my colleagues work in JSF, which doesn't seem like (real) MVC. Which one would you suggest? ...

Linq2sql count grouping vote entity query problems, can't get properties once grouped?

I'm building a music voting application, similar to stack overflow almost. I have 3 tables, Charts, ChartItems, Votes. I'm trying to bring back a list of chartitems, which link to a single chart, with the number of votes for each chart item counted. This is what I am trying currently var firstList = from chartItem in db.ChartItems ...

Redirect with file upload MVC, ASP.NET?

I have a controller that needs to redirect after receiving a file. I have saved the file successfully on the server side. Now, the only things that is bogging me down is how do I redirect to another site while sending the uploaded file that was saved on the server? Any tips? I am desparate. OK so here it is, first I save the file on ser...

How can I use and populate a base view model in a master page?

I have an asp.net masterpage, and All my controllers inherit from a controller base. All my view models inherit from ViewBase. How can I have a base set of data in the master page that is populated from the base controller into the viewbase, then into the masterpage? ...

How do I need to show the Selected Account in the Dropdownlist box using Asp.net mvc

Hello Friends, I have this code in my View.. <tr><td>Account:</td><td><%=Html.DropDownList("drdAccounts",Model.AccountsListHeader),Model.selectedAccount,"Select Account", new { onchange = "JavaScript:AccountChanged()" })%><span class="requiredAsterisk">*</span></td></tr> But I am getting Error Description: An error occurred during t...

Visual Studio 2010 doesn't set .CSHTML (Razor View Engine) as Content

Hi! I've been trying to deploy my ASP.NET MVC 3 Beta Application to my hosting. It supports all the necessary technologies and through trail and error I set the needed references' Copy Local to True. Then I got the error that my app cannot find the view. It listed .cshtml files it tried. I had those files in my project but they weren't ...

JQGrid, change row background color based on condition.

I have the following jqgrid that uses the jquery ui theme imported to my master page. $("#shippingscheduletable").jqGrid({ url: $("#shippingscheduleurl").attr('href'), datatype: 'json', mtype: 'GET', altRows: true, colNames: ['Dealer', 'Model', 'Invoice', 'Date', 'PO', 'Seria...

ASP.NET MVC MembershipProvider with repository and ninject

How do I communicate with the UserService through an overidden MembershipProvider class? I have no idea how to pass the connection string to the user repository inside the service. This is how my app is structured: Repository (constructor in the implementation takes a connection string) public interface IUserRepository { IQueryabl...