Hi,
I have implemented nerd dinner method of paging- which works great. But I want to be able to dynamically be able to order by certian fields.
How would I go about implementing this. Here is my code?
Controller:
PaginatedList<Classifieds_Ads> pageOfClassifieds = new PaginatedList<Classifieds_Ads>(classifiedsRepositry.GetClassified...
I have a Product entity that has a foreign key relationship to Manufacturer. I want to make it optional whether user adding a new product wants to set a manufacturer.
In my create view I have,
<%= Html.LabelFor(p => p.Manufacturer.Name) %>
<%= Html.EditorFor(p => p.Manufacturer.Name) %>
In create action,
public ActionResult Create(P...
I have a view model with a collection of other objects in it.
public ParentViewModel
{
public int Id { get; set; }
public string Name { get; set; }
public List<ChildViewModel> Child { get; set; }
}
public ChildViewModel
{
public int Id { get; set; }
public string FirstName { get; set; }
}
In one of my views I pas...
I have an ASP.NET MVC 2 application which in part allows a user to filter data and view that data in a JQGrid.
Currently this consists of a controller which initialises my filter model and configures how I wish my grid to be displayed. This information is used by a view and a partial view to display the filter and the grid shell. I us...
I implemented filter, which should redirect me to one page if some conditions aren't true, But this filter don't work with Ajax Requests, after redirect, javascript capture result and put whole View into html element.
How can i Stop processing ajax request and redirect it to normal http request??
Thx in advance,
...
I am trying to get elmah working on a remote web server and my local iis 7.5 server. The remote server is iis 6. Elmah works the visual studio 2010 development server. When you browse to a aspx page that doesn't exist, it logs it and shows it in the log. When I test the application on iis 6 and iis 7.5 I can get to the elmah log page but...
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%
if (Request.IsAuthenticated) {
%>
Welcome <b><%= Html.Encode(Page.User.Identity.Name) %></b>!
[ <%= Html.ActionLink("Log Off", "LogOff", "Account") %> ]
<br />
<% if(User.IsInRole("Administrator")) { %>
<br />
<%= Html.A...
Hi Users,
I am using jquery to do enable/disable operation.
<script type="text/javascript">
$(document).ready(function() {
$("#ddlUser").change(function() {
var selectedValue = $(this)[0].value;
if (selectedValue == "--Select User--") {
$("#txtUserName").removeAttr...
In Asp.Net 1.0/2.0/3.0 (non-MVC) I used to be able to change HTML markup whilst debugging, hit CTRL-S and then refresh my page to see the difference.
Can I do the same with Asp.Net MVC 2.0 using partial views or do I need to recompile the app each time?
...
Hello,
I try to use ELMAH on my ASP.NET MVC2 application, it works fine on the test server (Casini x86) while using the x86 version, but when I deploy it on the production server with the x86_64 version, I get a 404 error when I try to access "elmah.axd" and no errors are logged on IIS (but they are logged in Casini)
Here is my Web.conf...
This may be more of a best practice question.
I have three views (create/details/edit) that all link to their own results view (createResults/detailsResults/editResults). Each results view shares a partial with a results table on it.
When a user submits one of the three (c/d/e) views, should each results view have its own action, even...
I have to share ObjectContext (from EF4) between many objects, so i'm creating one Context per one HttpRequest (i haven't found better way to do this), but there is little problem...
When i use
using (ObjectContext ctx = new ...) {}
it always disposes context after closing bracket. So how should i dealt with it when my context lives...
I have a newly created asp.net MVC 2.0 application that is in a completely separate solution from an existing asp.net webforms application.
Because I didn't want the user to have to log in again, I deployed the MVC application in the same site as the existing Webforms app - everything works great.
One thing has me completely perplexed ...
I've been asked to start a new web project and I'm a bit scared of what path to take.
I've been help this community and I've learned a lot from you as well in this last year, you are great! and when this question pop up, you are the only friends I can ask for a direct and responsible answer.
The project has to handle more than 20000 on...
I can lunch debug session only once with VS2010 and ASP.NET MVC2. When i end first session and try to lunch another i can see...
"Unable to start debugging" - no other messages, I'm using Visual Studio Development Server instead of IIS, Windows 7 64-bits
I can add that few days ago i was working on Windows XP and everything was fine.
...
Currently, I have URLs that look like this:
http://www.example.com/user/create
http://www.example.com/user/edit/1
But now, I have to support multiple organizations and their users. I need to have something like this:
http://www.example.com/org-name/user/create
http://www.example.com/org-name/user/edit/1
I was having trouble getting...
Hi,
I have a user control which contains the following code:
<form id="CurrencyForm" method="post" runat="server">
Display prices in
<asp:DropDownList ID="currency" runat="server" AutoPostBack="true">
<asp:ListItem Value="GBP">GBP (£)</asp:ListItem>
<asp:ListItem Value="USD">USD ($)</asp:ListItem>
...
Hello,
I have an ASP.NET MVC app with the following deployment requirements:
The URL structure must be something like:
http://server/app/[enterprise]/[communinty]/{controller}/{action}/...
What I think I want to be able to do is intercept the URL before the MVC route handler gets its hands on it, remove the [enterprise]/[community] p...
Do we need to add any references or import any namespace for
Roles.IsUserInRole(username,role) - > is it not giving the right result.
<% if(Model.Count < 1)
{%>
No User's Add Under You!
<% } else {
foreach (var item in Model) { %>
<tr class="tblheader">
<th> User Name </th>
<th> Last Activity...
Following the Saving Snapshots to PNG in Silverlight 4 and the WebCam sample code, I have a silverlight app that I can place on my html form to capture an image from a web cam.
I would now like to include the image in a html form post to my MVC controller/action. At this stange in the project I'm restricted from moving the whole data e...