My ViewModel class has a property that contains a ShareClass object. ShareClass has a property called Id.
I'm currently passing the ShareClass id into the action method as follows:
public ActionResult ListedFactsheet(int shareClassId)
{
}
I'd like to be able to use the ShareClassViewModel though instead of passing in an int, as ...
Does asp.net mvc Url.Content encode the input or should I also use Url.Encode on top of it?
...
I've been struggling for this for an hour and I don't understand why there's a problem.
I have an abstract class
public abstract class IValidated
{
public bool IsValid { get { return (GetRuleViolation() == null); } }
public abstract RuleViolation GetRuleViolation();
}
And a validation class
public class RegisterModel : IVa...
I've got a model:
public class OverdraftForm
{
public string CustomerId { get; set; }
public PaymentType PaymentType { get; set; }
public OverdraftType Type { get; set; }
public decimal PermanentAmount { get; set; }
public int ExpirationPeriod { get; set; }
public decimal OnetimeAmount { get; set; }
public...
I am trying to get used to the syntax in JQuery when using MVC 2.
I want to copy a phone number from 1 field to another. However the syntax of the line below is wrong;
$("#contractAdministratorContact_Phone").val($("#contactClientContact_Phone").val());
The above fields are defined as
<%: Html.EditorFor(model => model.clientContact.P...
I have a master-detail view for adding, deleting and updating customers on an ASP NET 3.5 MVC 1.0 application. The user should be able to, for example, choose a customer from a list to be edited, and a detailed form is shown in the bottom of the page for him/her to edit the customer's data.
When the user accepts the changes, the data is...
I am doing:
convert.toboolean(request.form["mycheckbox"]
but since the value is 'false', it doesn't seem to cast to boolean.
What should I do?
I don't like checking for == "false" and then converting to boolean.
is there a cleaner way?
Update
All I am doing is:
if (Convert.ToBoolean(request.Form["somecheckbox"]))
{
}
...
I am using a HtmlHelper to display an update to a user as follows:
In webpage:
<%=Html.CourseUpdateNotification() %>
In my controller:
public ActionResult UpdateOnceOnlyCourseRecord(some parameters)
{
//validation code etc...
//Save to database etc...
TempData["CourseUpdateNotification"] = "Success";
return Redirect...
I've read that its bad (not advised) to use User Agent Sniffing to send down the correct content for a mobile browser, so I'm wondering what IS the best way to do this?
I'm using ASP.NET MVC, and I've built my site and it works well on desktop browsers, so I'm looking to begin building a mobile version. When a mobile browser comes to m...
I am doing what would take me less that 2hours to do in old ASP.Net Web Forms but has left me stumped in how to implement in ASP.Net MVC.
Problem:
I am trying to put together a really basic admin site about musicians.
a musician has a associated picture of them, then some details like name, age, home town alongside the profile pic.
real...
I have this weird thing happening.
I have a PartialView with 3 fields on it. I do a jQuery ajax post to my action result and if the model passes validation i save the record. I also then set the model to empty and pass it back to the view as a partial view.
public ActionResult jQueryAddComment(Comment comment)
{
if (M...
It seems like no matter what I do, I cannt get my twitter RSS feed to show up on my view. I'm not getting any errors, and the RSS feed loads correctly, I just can't grab the Model's information...
Here's my ViewModel
namespace MvcMusicStore.ViewModels
{
public class HomeRssFeedViewModel
{
public IEnumerable<TwitterPosts...
I need to create a multilang mvc application.
My Database Design tablei is
Table : Group
GrpID : Int PK
IsActive : Bit
Table : GroupDetail
GrpID : Int FK
GrpText : Nvarchar(200)
LangID : Int
Question 1
How can I have this view Result.
Francais English
Auto Car
Chien Dog
Thanks all
...
Reading conflicting opinions on using SQL session state vs custom db table in MVC to store user data across page requests?
What are the advantages and disadvantages to each method? Why should I pick one method over the other.
So far it seems a custom db table is the best solution because it doesn't time out, plus it would be strongly t...
I would appreciate if someone can provide some insight into which one is more beneficial.
RESTful service in WCF can provide the same functionaly as ASP.Net MVC Controller, i.e URLS can be formed appropriately using Controller/Action.
Is there real benefit of using one over the other.
WCF Rest service will provide..
1) Cert Authentica...
When you create a new MVC application, how is it different than a Web Application?
I can put a route handler in global.asax even in a Web Application. But an MVC application has more than that, it even has the context menu to create controllers and views.
I am wondering if it is possible to turn an existing Web Application into an MVC ...
i want to add transactionscope class in vs 2010. where can i find it? in which namespace. according to msdn there is a system.transaction but there is not? is it extenal?
...
Hello,
I'm just starting to use the ASP.NET MVC.
i am thinking of adding an "Add New Row" button to the top to add a new data row to the table/grid in a form.
Initially, I want the grid/table to be empty, with only headers of table to be displayed. however, if there are no data rows, the whole grid doesn't appear.
Is there any why by...
I have a Model that I can bind correctly for display purposes but I can't post an updated version.
I can display a page and its list of contents in a form for updating in a strongly typed view.
But when I post an updated model i.e. if I changed a pagecontents content then the posted model contains the Pages details but loses the relati...
Hi,
I have a textbox in my view that i want to receive the value as a List of strings.
As example, if anybody enters: tag1,tag2,tag3... receive a List with 3 elements.
I did a custom model binder, but im still receiving from the post the string instead the List.
This is the stuff that i did:
This is my Model:
public class BaseItem...