While ASP.NET MVC seems to be a viable technology praised by a lot of developers, I can't seem to find enough reasons to devote my energy and time for it. The main reason is that I don't find enough .NET jobs asking for it. Companies still use WebForms and it works just fine for them. I am not self employed where I get to choose the tech...
to custom validate an input i wrote a script:
function cardNumberCheck(value, element) {
var res = false;
$.get("/CaseHistories/ValidateCardNumber",
{ caseHistoryId: $('#CaseHistory_Id').val(), cardNumber: $('#CaseHistory_CardNumber').val() },
function(data) { res = data });
//alert(res) => works fine return t...
<script type="text/javascript">
$(function () {
$("select#oblast").change(function () {
var oblast_id = $("#oblast > option:selected").attr("value");
$("#Rayondiv").hide();
$.ajax({
type: "GET",
contentType: "application/json",
...
How can I change my map route so I can have another dir, and not just the controllers and actions.
What I want is to have another directory before the controller so that way I can separate controller per "module"
routes.MapRoute(
"Default", // Route name
"{module}/{c...
I have a master page with that code:
public string CallbackMethod;
protected void Page_Load(object sender, EventArgs e)
{
CallbackMethod = Page.ClientScript.GetCallbackEventReference(this, "message",
"Dodanie", "context", true);
}
/other code here/
then, in the View (which is bas...
I'm maintaining a CMS where I have this feeling it was made in the age of dinosaurs (Asp.net 1.0?) and decided to upgrade it with Asp.Net MVC and jQuery. But I have some problems regarding the design/specifications of the CMS which I cannot change.
The CMS
The CMS uses JavaScript. Alot. As in "I don't load pages, I request new pages u...
Is this possible?
What I want to do is pass a list of objects as a paramter in an actionlink
At the moment when I try to do this the list is always empty by the time it reaches the controller!
In the view
<%= Url.Action("ActionName", new { list = Model.ListOfObjects}) %>
In the controller
public ActionResult ActionName(List<Object>...
Can PHP array passed POST method to catch in ASP.NET MVC?
Query string: WebAccess/ArrayTest?val[]=1&val[]=2&val[]=3
I write: ActionResult ArrayTest (String[] val)
But this only works if the query string to remove the "[]"
...
Hi,
I am currently using MVC 1.0 and .NET 3.5. I am using DataAnnotations to validate my model. I'm trying to add use the RegularExpression to validate a Postcode. I have stored my Regex in the resource file as many models will use it, when I try the following:
[RegularExpression(Resources.RegexPostcode, ErrorMessage="Postcode form...
Hi,
I have a little problem with a Jquery dialog for an action that requires a role.
In my example, the user can click on a delete button and must confirm the action.
In my controller, the Delete action requires a role, if the user is in the required role, the object is deleted.
The problem: How to alert the user if
* the element was d...
Hi folks,
i'm trying to goto the following url :-
http://user1:pass1@localhost:1234/api/users?format=xml
nothing to complex. Notice how i've got the username/password in the url? this, i believe, is for basic authentication.
When I do that, the Request Headers are MISSING the 'Authorize' header. Er... that's not right :(
I have ...
Hi,
ASP.NET MVC web app that exposes "friendly" URLs:
http://somesite.com/friendlyurl
...which are rewritten (not redirected) to ASP.NET MVC-style URLs under the hood:
http://somesite.com/Controller/Action
The user never actually sees any ASP.NET MVC style URLS. If he requests one, we hard 404 it. ASP.NET MVC is (in this app) an i...
Im trying to create an ajax (post) event that will populate a table in a div on button click.
I have a list of groups, when you click on a group, I would like the table to "disappear" and the members that belong to that group to "appear".
My problem comes up when using jQuery's .ajax...
When I click on the button, it is looking for a...
While creating JavaScript with ASP.NET MVC I noticed several scope warnings and realized that I am missing something with understanding the variable scope inside the switch / case statement.
Warning: 'i' is already defined referring to case b and case c
My code looks similar to this:
switch(element) {
case 'a':
for(var i=0; i < c...
I have a drop down list hardcoded in a MVC View User Control page and would like to populate this from a database table. The MVC View page Inherits data coming in from my controller. This drop down list would contain something like a list of states for the user to choose to set an item for my main object. This list would not fit into th...
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Upload(Photo photo)
{
foreach (string file in Request.Files)
{
var path = "~/Uploads/Photos/";
HttpPostedFileBase posted = (HttpPostedFileBase)Request.Files[file];
if (posted.ContentLength > 0)
{
photo.Date = DateTime.Now;
...
I have the following Repository:
Public Class PageRepository
Private Shared _pages As BLL.PageCollection
Shared Function AllPages() As BLL.PageCollection
If _pages Is Nothing Then _pages = new BLL.PageCollection(LOADALL)
Return _pages
End Function
End Class
I do all selects using LINQ on the PageRepository...
Ok...
I've downloaded and implemented this Recaptcha implementation for MVC which uses the ModelState to confirm the validity of the captcha control.
It works brilliantly... except when I start to use it in an AJAX Form.
In a nutshell, when a div is re-rendered with AJAX, the ReCaptcha that it should contain does not appear, even tho...
I am having the hardest time wrapping my head around this. I recently asked this question Create/Edit/Save data in a jQuery pop-up for ASP.NET-MVC and Linq2Sql I'm sure that the response is the right way to go, but I just can't figure out how to write the back-end code to make it work. I originally made my site by following the nerddi...
Hello,
I made some changes to my ajax test website and now my Ajax.ActionLinks don't work anymore!
The ActionLinks in question are made like this:
<%=Ajax.ActionLink("Language Select", "LanguageScreen", "Home", from("LanguageScreen", "Functions"), meep("LanguageScreen", "Functions"))%>`
The "from" and "meep" functions are only one li...