I am trying to create divs dynamically in a view page of an asp.net mvc project. This is the pseudo code:
<%
foreach (element in Model)
{
create the html div element with Div.id = Model.id
}
%>
I looked in the system.web.mvc.htmlhelper object. It provides support for a lot of html elements but n...
Very simple question but I am unable to find an answer, I have a MVC 2 app in C#
I have a ActionResult the accept's HTTP POST's
How do I find out the URl of any posts to my ActionResult.
Thanks,
...
Hi,
I'm working on an ASP.Net MVC2 application and use the jsTree-Komponent for jQuery to render a tree with checkboxes.
To select specific nodes in a convenient way my JSON has to offer a "class" attribute.
Here's an example how jsTree wants to consume the JSON result:
[{"data":"Root1","attr":{"id":"10","class" : "jstree-checked"} .....
I'm making use of a captcha generator. http://xcaptcha.codeplex.com/. In the example it shows using Session.Add for comparing captcha generated vs answer. I wanted to make this a part of my model's rule violation checker but I can't seem to find/work with the correct parts of session there. Am I missing the way to navigate to session fro...
I have a web site in ASP.NET MVC 2. I deployed it in the server. But when I browse the site, the image position behaves differently with ip address and host name on the URL.
http://mysite/applicationsite
http://192.28.252.13/applicationsite
I couldn't figure out why its behaving differently. The image is more to the left when used ip ...
I'd like to develope simple set of controls to display many sort of data and be useful in normal silverlight application and can be used in ASP.NET MVC2 application. Right now i have no idea how to link those tehnologies, but this isn't my concern right now - i just heard it is possible and i'll find out how to do that...
Right now i'd ...
Hi,
what i am trying is the following:
I got an MVC app. running DIRECTLY in "Default Web Site"...
I got another app. ( ProductionService ) which is anotehr standalone app..
Looks like this in IIS-Manager:
My problem is, that a requets to "ProductionService" is not routed to the app., but instead is handled by the MVC-app. runnin...
I have an entity generated from my database that contains one table. When i make changes in the DB i obviously would like these changes to reflected in my model.
My current approach is to delete the item from the designer and then right-click - update model from database. This works for me at the moment. Is there a different approach t...
I am calling a controller method SendMe(formCollection myForm){}.
But I don't know how to pass Form that contains some information. I know how to read it, and also, how to call SendMe() on given controller, but I don't know how to pass it. Though, for the reference I am calling SendMe as:
<div id="menucontainer">
<ul id="me...
I have been browsing the web and stackoverflow trying to figure out how to handle this error.
A potentially dangerous Request.Form
value was detected from the client
The error occurs when a user enters in html or xml tags( < p> or < HeyImXML>) and tries to submit a form. The input is not suppose to contain any sort of markup at ...
In my HTTP POST controller method for add/editing data, I'm receiving an entity from my EF data model. Some of the fields in that entity are of type double. Everything works fine unless the user types in a comma for a thousands separator, which then causes a model binding validation error.
Has anyone run into this before? Is replacin...
Hi.
On one of my models I have a property annotated with:
[StringLength(60, ErrorMessage="Title must be between 60 and 10 characters", MinimumLength=10)]
When the form posts to the server, if it's under 10 characters, then validation fails as it should do. However, on the client-side, it only checks that it's under 60 characters -- n...
I have MVC application (applies to non MVC as well) where a user is posting in data. I need to take this data, send it off to two seperate end points (one using a WebRequest form POST and one using a Web Service), parse the result, and send the result back to the original user.
The issue at hand is that both end points take about 20-30...
I'm an absolute beginner with ASP.NET MVC and I'm trying to build a pretty simple application, but I'm having a hard time getting out of the webforms thinking.
I need to register users so they can download my application. I need to capture their information in three screens. Rather than write the database from each view, I want to aggre...
I have an editor template for a custom object. Pretty basic - just has a bunch of strings and dates:
<%:Html.LabelFor(model => model.AString)%>
<%:Html.TextBoxFor(model => model.AString)%>
<%:Html.LabelFor(model => model.ADate)%>
<%:Html.EditorFor(model => model.ADate)%>
<%:Html.LabelFor(model => model.AnotherDate)%>
<%:String.Format...
My code is working fine in all the browser except mozilla firefox
$(document).ready(function () {
var id1 = '<%=ViewData["UserName"]%>';
var id2 = '<%=ViewData["UsrProfile"]%>';
var msg = $('#addFrnd').attr('value');
$.ajax(
{
type: "POST",
...
Hello everyone,
i need urls like /controller/verb/noun/id and my action methods would be verb+noun. for example i want /home/edit/team/3 to hit the action method
public ActionResult editteam(int id){}
i have following route in my global.asax file.
routes.MapRoute(
"test",
"{controller}.mvc/{verb}/{noun}/...
My environment consists of Visual Studio 2010 and Windows 7 a few months ago I developed an MVC2 application with no problems however after trying to create a new project recently I received the error below.
I did find the link http://support.microsoft.com/kb/894670 but this is not relevant because I am not using IIS for testing, just F...
Using Entity Framework with MVC2, I have a series of date textboxes, that I want to display data from the model in a short date format, but I have to use Html.TextBoxFor in order for the update code to work (Having tried using HTML.Textbox the data never gets saved to the model).
<%: Html.TextBoxFor(model => model.Item.Date, String.For...
The current code of one of the views in my project is a large, monolithic one and I just want to organize it. Is it just fine to place methods inside my ASP.NET MVC view?
...