asp.net-mvc

Invalid length for a Base-64 char array

I use asp.net + MVC1.0 and in a webpage I have several forms, within each forms I have called the following function AntiForgeryToken() to generate a hidden value, and in Controller function I have a validate attribute. When I use JMeter and capture the token using regular expression then post the token with my form to server, I found ...

jquery selection problem

On some View page I have two partial views (their html is the same). With first one work this script but with second not work . <script type="text/javascript"> $(document).ready(function() { $('input:radio').click(function() { var location = $("input:checked").val(); var article_number = $("input[id=MArticleNu...

ASPX / c# vs J2EE

hi everyone, I am supposed to create a intranet web application and the question is what technology I will use? is that the ASPX with C # or the Java EE. in any case I want to know the great advantages that I will receive. Thanks ...

ASP.net MVC - Stop page rendering until JQuery finished

I am looking at an issue whereby our ASP.Net MVC page content jumps into position. If I put a debug point in one of our .js files I can see that the page has already rendered into its initial positions and then the .js files do its stuff and the page redraws into the correct state. This happens pretty quickly but slow enough that a jum...

Sign in as a different user using MVC.NET and Windows Authentication?

How can I accomplish this using MVC.NET? I've found resources on the Internet about how to do it in ASP.NET, but I haven't found a way to do it in MVC.NET (I'm an MVC.NET newbie, though). I can generate a 401 response using [Authorize] attributes but I don't have any idea about what to do after that. [EDIT] After some playing around, ...

Bypass Data Annotations validation on ASP.NET MVC 2

I would like to know if it's possible to bypass the validation of one property which is using Data Annotations. Since I use the model across multiple pages, there's a check I need in some, but not in others, so I would like it to be ignored. Thaks! ...

Unique constriaint with data annotation

Hi, I'm using the System.ComponentModel.DataAnnotations namespace to validate my domain classes. How can I create a custom attribute to validate the uniqueness of a property regardless of the database(through some interface for example)? ...

jquery ckeditor language dir

how can i define the language dir in this code $(document).ready(function () { $('#Header1').ckeditor(); }); ...

How can I set the <body> class based on the view in Asp.Net MVC?

I'm looking to set the <body> class as well based on the view. I've read a few posts about strongly typing the master page but none seem to exactly fit, or at least I don't know how to code it. I have noticed that Stack Overflwow does it, so it must be possible. Updated: Getting error: Description: An error occurred during the comp...

MVC2 - Design pages at runtime

We are in the process of implementing an MVC 2 web application, and the requirement is the ability for an administrator of the site to "design" screens. The idea is the admin user would select from a list of predefined fields and manipulate their selection's display order (top to bottom on the page). Once the page is designed and saved, ...

How to display a number (generated dynamically) into a square using CSS

Hi I'm new to CSS. I need to display a number (generated dynamically through ASP.NET MVC action method) on to a Square (normal image , whose face needs to be replaced with the dynamic number ). Can someone assist me in doing this . I am sure it will just take a minute for some one who knows CSS. Thanks, Vijay ...

ASP.NET MVC - NHibernate - DropDownLists

Hi, i am just getting started with ASP.NET MVC and i'm using NHibernate for my data context. I have kept the foreign key fields in my entity classes so that it could hopefully making working with drop down lists easier but this is not the case. Here is my post back action: var user = userRepository.GetById(id); if (!TryUpdateModel(us...

Call a web service from inside or outside the model?

I'm looking for a bit of guidance on the architecture of an application I'm creating. Here is the situation: Our company gives out reward cards to salesmen which are then handed out to customers (used like a debit card). For tracking purposes, the salesman must request activation from our system before the card can be used (providing in...

How to redirect to another page when selected dropdown item is changed?

I have 2 dropdown lists that I'm putting on to the page as follows. I can't get either to work: <%=Html.DropDownList("CategoryId", Model.CategoryList, "Select a category to view")%> and <%=Html.DropDownList() For(m => m.SearchExpression) %> What I need is to be able to redirect to a page when one of the items is selected and I clic...

Select top 5 from a merged list (MVC)

I have two lists that have been merged. After a order by linq statement, I would like to select the top 5 from that complete list. I was thinking about using the linq statement to pick the top 5 from the list. var ListSort = from list in NewList orderby list.EntryDate select list;//Tried to select the top 5 from here Any other sug...

Tricking ASP.NET into Thinking Request is Ajax Request for jQuery File Upload

I am using a rescue derived from MvcContrib: public class RescueAttribute : MvcContrib.Filters.RescueAttribute { public RescueAttribute(string view) : base(view) { IgnoreAjax = false; } public RescueAttribute(string view, params Type[] exceptionTypes) : base(view, exceptionTypes) { IgnoreAjax = false...

How to get the Model.Value in my View. using asp.net mvc

can I do something like this to get the Mode.check value in my view.. <script type="text/javascript"> var check = <%(Model.Check); %>; $(document).ready(function () { if(check == "Save") { $("#ObnRemove").show(); $("#ObnAdd").val('Save'); } else { $("#ObnRemove").hide(); ...

Using HtmlTextWriter in ASP.NET MVC

I am migrating some old code where HtmlTextWriter is used extensively to render UI elements. I am migrating the code to use ASP.NET MVC 1.0. As far as I am aware, I am not using any of the HtmlTextWriter specific function (such as indentation). Currently, I am using a wrapper method to return string generated by the HtmlTextWriter as f...

What do we call 'traditional' ASP.NET when trying to reference with respect to ASP.NET MVC?

It cannot be called classic, because that would get confused with classic ASP. I don't like calling it traditional because of the connotation that word has. Do we called it: Normal ASP.NET Mainstream ASP.NET ASP.NET MVP What else? ...

RESTful Application Structure

I am new to RESTful architecture or at least new to using it properly I have only had true experience with SOAP. I am having a problem wrapping my head around some things. I know there are other questions that are similar but none, that I have found, answer my question satisfactorily. I am just starting this app so I want to get it st...