I'd like to be able to map a domain model to a view model by newing up a view model and passing in the contributing domain model as a parameter (like the code below). My motivation is to keep from re-using mapping code AND to provide a simple way to map (not using automapper yet). A friend says the view model should not know anything abo...
I am trying to add a simple comments/message box to a web page. When the user enters the comment and hits submit, I would like to save this message to the database and add the comment to the list displayed on the page, without refreshing the entire page.
However, I am not sure of the best way to do that these days. I am using ASP.NET...
Hi I have a question about model binding. Imagine you have an existing database entity displayed in a form and you'd like to edit some details, some properties eg createddate etc are not bound to the form, during model binding, these properties are not assigned to the model as they are not on the http post data or querystrong etc, hence ...
I'm working on the MVC app where I've to generate the report in the form of HTML page. If the user click the print icon, I've to show the HTML page to user. If the user click on email icon, I've to send email with same HTML page attachment. I'm trying to find a way where I can use the same code to generate the HTML in both cases of ema...
Hi
I was looking at the 14 days of jquery
http://jquery14.com/day-01/jquery-14
and I saw this and it got me to wondering is there a point to use getJson anymore?
JSON and script types auto-detected by
content-type (jQuery.ajax
Documentation, Commit 1, Commit 2)
If the response to an Ajax request is
returned with a JSON...
Hi,
In my ASP.NET MVC app I am rendering out a checkbox using the following code:
<%= Html.CheckBoxFor(i=>i.ReceiveRSVPNotifications) %>
Now I see that this renders both the checkbox input tag and a hidden input tag. The problem that I am having is when I try retrieve the value from the checkbox using the FormCollection:
FormValues["...
For anything but trival view models, I use a view model builder that handles the responsibility of generating the view model object. Right now, I use constructor injection of the builders into my controllers but this smells a little since the builder is really dependent upon which action method is being executed. I have two ideas in mind...
I am using asp.net mvc to do model binding. When I pass a model to a view I am able to see the model data displayed in the form inside a label
<%= Html.Label(Model.title) %>
<%= Html.Label(Model.description) %>
However I am not able to do the same using
<%= Html.TextArea(Model.description)%>
Is there a syntax difference betwe...
Hi everybody!
In a ASP.MVC (1.0) project i managed to get weather info from a RSS feed and to show it up. The problem i have is performance:
i have put a RenderAction() Method in the Site.Master file (which works perfectly) but i 'm worried about how it will behave if a user clicks on menu point 1, after some seconds on menu point 2, a...
Hi Guys,
I have a MVC project and trying to host my web site using IIS 7.0 on my local desktop.
My desktop has Vista x64 bit machine.
I m getting 403.14 error.
I have already tried the microsoft suggeston, but that doesn't help me.
Does anyone know any other solution?
Thnx
...
How would you go about redirecting in ASP.NET MVC to take into account some external URL rewriting rules.
For example:
What the user enters: http://www.example.com/app/route
What ASP.NET MVC sees: /route
What I want to redirect to: http://www.example.com/app/other_route
What actually happens when I do a simple RedirectToAction: http:/...
I am doing a return RedirectToAction("Index", "Clients"); from my home controller.... It is fine but my url looks like http://localhost:1115/Clients/Index... How to remove index from url in asp.net mvc? Any suggestion....
My routes,
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resourc...
I am trying to upload images via a form which sits in partial view using MVC.
View Code:
<form action="/Item/ImageUpload" method="post" enctype="multipart/form-data">
<%= Html.TextBox("ItemId",Model.ItemId) %>
<input type="file" name="file" id="file" />
<input type="submit" value="Add" />
</form>
Action Code:
public void I...
i used basic date picker in asp.net mvc and it works fine but now i converted my views in partial views at this time date is not working at all means nothing is displyed when i clicked in text box of date picker. the code that i have used is
<script src="../Scripts/jquery-1.3.2.js" type="text/javascript"></script>
<script src="../Scri...
I stored salt and hash values of password during user registration... But during their login i then salt and hash the password given by the user, what happens is a new salt and a new hash is generated....
string password = collection["Password"];
reg.PasswordSalt = CreateSalt(6);
reg.PasswordHash = CreatePasswordHash(password, reg.Pass...
Hi,
I am using asp.net mvc. I have used two list box in one of my views.
I transfer desired items from left-hand-side list box to right-side list box.
On a button click, i want to get the list box contents from right side list box.
I don;t get in form collection. Can anyone please suggest how can I get it?
thanks,
kapil
...
Can I have a submit in <% using (Ajax.BeginForm("ChangePassword", new AjaxOptions { OnComplete = "ChangePasswordComplete" })) without having a submit button on the form?
I yes, how? Let`s say I want to submit the above when a user click on an input of type button simply?
...
When we set the CurrentCulture and/or CurrentUICulture we do this on the current thread like this:
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-GB");
Doest this mean we could affect the culture settings of multiple users of our web application as t...
I have 4-5 partial view files (.ascx) like
abc.ascx, cde.ascx, fgh.ascx.
I want to return different partial views based on the name of the view passed to url parameter like this
/someservice/abc will go to action someservice and will return abc.ascx partial view.
/someservice/cde will go to action someservice and will return cde.ascx ...
<%using (Html.BeginForm("OrderDevice", "ImportXML", FormMethod.Post))
{ %>
<table id="OrderDevices" class="data-table">
<tr>
<th>
DeviceId
</th>
<th>
Id
</th>
<th>
OrderId
</th>
</tr>
<% foreach (var item in Model) { %>
<tr>
<td>
...