displaying a listbox using Html.List, and I have a List<User> collection
Is a List enumerable? Html.List("mylistbox", Model.UserList); doesnt' seem to be working, where UserList is a List collection. ...
Is a List enumerable? Html.List("mylistbox", Model.UserList); doesnt' seem to be working, where UserList is a List collection. ...
I have a view where I want to perform different actions on the items in each row in a table, similar to this (in, say, ~/Views/Thing/Manage.aspx): <table> <% foreach (thing in Model) { %> <tr> <td><%: thing.x %></td> <td> <% using (Html.BeginForm("SetEnabled", "Thing")) { %> <%: Html.Hidden("x", thin...
I have a requirement to track what authenticated users change with regards to the data when logged in. I don't need to track what pages they look at although that could be very useful in future. I have thought about saving the User Guid but that seems very clunky. I do need to do simple stuff like old value and new value. I am using the...
Hello -- I've a site that I'd like to publish to a co-located live server. I'm finding this simple task quite hard. My problems begin with the Web Deploy tool (1.1) giving me a 401 Unauthorized as the adminstrator because port :8172 comes up in the errors and this port is blocked - but the documentation says "The default ListenURL is h...
I've developed my own custom users and roles objects using ActiveRecord that do NOT extend the default Asp.Net providers and therefore I can't get the user from the HttpContext. I can create a custom htmlhelper to render menus but should my views render the menu or the master page? If it's the master page how can I pass to the custom h...
Hi, I have got an app I'm going to write in ASP.NET MVC and I want to create a DatabaseFactory object something like this:- public class DatabaseFactory { private string dbConn get { return <gets from config file>; } public IDatabaseTableObject GetDatabaseTable() { IDatabaseTableObject databaseTableObject = new SQLDatab...
I'm working on a plugin-type of system for ASP.NET MVC that loads views from an embedded assembly. I have created a VirtualPathProvider that does the work of retrieving out of the assembly. Everything is working fine except for strongly-typed views. Whenever I try to load one of those, I get an exception of: Could not load type 'System.W...
what is <%: %> do in asp.net mvc? ...
i need to post url to be /controller/action/someID not sure how to get someID in using the BeginForm helper. html.beginform("controller", "action", formmethod.post) ...
In the research that I have done there is an oAuth library out there, but I guess this isn't in System.Web or System.Web.MVC etc. If using the nonce value is the correct way to prevent relay attacks and the preferred method to prevent duplicate form submissions it would seem like there would be an out of box solution to get at this value...
This is a very strange one. I have an asp.net MVC 1 app. Under IIS6, with no anon access - only integrated windows auth - every thing works fine. I have the following on most of my Foo pages: <% using (Html.BeginForm()) { %> Show All: <%= Html.CheckBox("showAll", new { onClick = "$(this).parent('form:first').submit();" })%...
So we have a route setup that has a wildcard at the end to capture a file path, the route might look like: /{browserName}/{browserVersion}/{locale}/{*packageName} The problem comes in when we try a path like: /FF/3/en-US/scripts/packages/6/super.js What ends up getting passed to the controller as packageName is: /scripts/packages/su...
I know there are a lot of tools out there on the client that let you know how long a page takes to load but what could I do on the server to see how long it takes an ASP.net MVC page to render? I don't need to know how long it took all of the images to load and the javascript to start running, I'd just like to know how long all of the se...
in my class i have this property public decimal Percentage.. { get; set; } this value is comming like decimal somethign like this.. -0.0214444 I need to show them somethign like -2.1444 can I change to this formate in my property.. thanks ...
<%= Ajax.ActionLink("Delete", "Delete", new { id = item.int_GroupId }, new AjaxOptions {HttpMethod="Delete", Confirm="Delete Group with Group ID:" + item.int_GroupId + " Group Name:" + item.vcr_GroupName})%>| [HttpDelete] public ActionResult Delete(int id, FormCollection collection) { try { Gro...
I defined a few display templates for classes and they work well when I put them in views/shared/DisplayTemplates. However after I move them into an area, looks like ASP.NET MVC won't look inside Area to find the templates. How to reference the DisplayTemplates defined in an Area from main project? Is that a good practise? ...
In my controller I create a list of SelectListItems and store this in the ViewData. When I read the ViewData in my View it gives me an error about incorrect types. If I manually cast the types it works but seems like this should happen automatically. Can someone explain? Controller: enum TitleEnum { Mr, Ms, Mrs, Dr }; var titles = n...
Hey all, I'm trying to add a file upload control to my ASP.NET MVC 2 form but after I select a jpg and click Save, it gives the following error: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or a non-white space character among the padding characters. Here's the view:...
My ASP.NET MVC web app has a weird issue. In VS debugging mode it works as expected, but when I publish it to dedicated web server (windows 2003, IIS6) a sql query returns previous data even though underlying data was already updated through the same connection. It looks like as if a query returns cached data. What might be the problem? ...
Is there any way to stop VS (specifically 2008) automatically inserting WebForms Ids in <asp: elements when pasting code into a view? E.g. by default pasting this into a view: <asp:Content ContentPlaceHolderID="TitleContent" runat="server"/> </asp:Content> Results, annoyingly, in this: <asp:Content ID="Content1" ContentPlaceHolderID...