how to select a radio button by default - asp.net mvc strongly typed html helpers
I have a radio button list like this <%=Html.RadioButtonFor(m => m.Gender,"Male")%> I should make this button selected by default. Any inputs ?? ...
I have a radio button list like this <%=Html.RadioButtonFor(m => m.Gender,"Male")%> I should make this button selected by default. Any inputs ?? ...
I have an ObjectContext and a Repository that gets passed the ObjectContext. I then use the repository to make calls. I want to use dependency injection to not always have to instantiate the ObjectContext and Repository. What "object" would I group the context / repository into? using (MOSContext db = new MOSContext()) { IUserReposi...
I use this in my Index.aspx: <%= Html.StandardOverlayCreateButton() %> <div class="apple_overlay" id="overlay"> <div class="contentWrap"> </div> </div> Which is translating into this: <a href="Employee/Create" rel="#overlay"><button type="button">Create</button></a> <div class="apple_overlay" id="overlay"> <div class="con...
I am creating a .NET MVC (1.0) facebook application using FBML. Everything is working like expected. However, if I simply change the project to reference the System.Web.Mvc 2.0 assembly, the application stops working. No exceptions are thrown (it makes it through the controller class fine) but nothing is rendered on the page? Any ide...
How do I make my application route to mydomainname/username/controller. I am working on asp.net mvc web application that enables a user to belong to multiple account. ie. In the application every account has its own users, and each user in one account can also be a user in another account. What i need is when a user wants to login, the...
Hello SO Community, I've been using Html.Action("ActionName", "ControllerName") to invoke child actions across controllers without needing to have the view in Views\Shared. This has been working great for displaying things like session or cookie information. Instead of just accessing cookies, I would like to pass additional parameters ...
I'm working on a site that is partially static content and partially MVC. The root of the site is index.html and I have all of the controllers explicitly routed and all html files ignored. However, when you hit the root of the website, it tries to route it. How can I tell the route engine to ignore the root of the site? www.mysite.com...
i having error throw on View page and i think i am passing wrong type, can anybody please correct me - thanks. The model item passed into the dictionary is of type 'System.Collections.Generic.List1[App.Domain.Model.Interface.IPerson]' but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable1[App.Domain.S...
Hi I have the following code: foreach (SelectListItem item in selectListItems) { string tex = item.Text; string val = item.Value; string sel = item.Selected.ToString(); } SelectList selectList = new SelectList(selectListItems); foreach (SelectListItem ...
Using asp.net mvc2 on vs2008 on local machine and hosting on a shared server at discountasp.net Problem started when I could not make the .UTCNow deliver the correct "Office is open/closed" string as follows: In the view user control: <div><%=OfficeTimes.LondonOpenOfficeMessage() %></div> And in the helper file: public static class...
Hi, I have an action method that returns a FileStreamResult, the download works fine, the problem is that although I set the FileDownloadName property of the result object, some of the files are downloaded with another name (specifically the last part of the address of the page I'm working on. e.g. in the page "http://localhost:5479/Ite...
We have a small Asp.Net MVC project which displays a report of several tens or hundreds of rows of data. Each row is represented by an object on the view models. Currently we are showing the rows like this: <table> <tr style="text-align:center"> <th>Name</th> <th>Item count</th> <th>Stat 1</th> <th>St...
ViewData.Model.ExecuteResult does not exist in ASP.NET MVC2, but in MVC1. What is the alternative in ASP.NET MVC2? What I want to do, is to update a table after an ajax request. So I put the table in an extra View. How can I update this partial view without loading the whole page again? ...
I've been pulling my hair out this morning trying to figure this out. I have a simple jquery json request to a jsonresult action on my controller. When I run this on my local machine (IIS7), it works fine. When I deploy to a dev machine running IIS6, I get a 404 error. script: $(function() { $('#search').click(function() {...
Hi friends! In my web application (asp.net mvc) I have an restrict area. In my model, I have an entity called "User" represents a user can do login/logout in web app. I've used Forms Authentication to login/out my users and everything works fine but, I'd like to know, if is there any way to save an entity (of the user logged) during the...
Hi What are the advantages of passing a blank object eg Client from the controller? public ActionResult Create() { Client client = new Client(); return View(client); } // // POST: /Client/Create [HttpPost] public ActionResult Create(Client clientToAdd) { ...
We have asp.net mvc application in which we have avoided using addons but now i would like to see which can really add value and use them, please suggest which addons are winning the race in each area IOC/DI ninject structuredmap View Engine Spark T4MVC Above are some that i tried little bit as we have some requirements which c...
Hi All, I am having ASP.NET MVC application in which i am using HTTP handler ashx file to get the image on the page . This image is uploaded by user by scanning the document. Now my problem is for every user its displaying except one , User is reporting he is not able to see the image even though it was loaded sucessfully , when i ch...
I've got a list of products in an admin section of my website. I have the product title and then an icon for delete and an icon for set visible/set invisible. I have both icons wrapped in their own form elements so they fire seperate Actions. I now one to add some checkboxes to each line so I can do a bulk delete. Following this: http:/...
I need some help figuring out whether it'd be a good idea to use a CMS or portal solution for my latest project, which is (currently) an ASP.NET MVC application that must serve multiple customers (being a company or some other entity with a list of users) from a single installation (i.e. a SaaS solution). In addition to the core functio...