Hi
I am trying to pass a custom response header to notify my javascript the user has timed out. It works good expect when it comes to using it with jquery u.i dialogs.
I have this
$.ajaxSetup
({
complete: function (event, xhr, options)
{
if (event.getResponseHeader('X-LOGON') === 'LogOn')
{
window...
Is there a way for me to manually set the ModelState.isValid = False from the controller?
I have some code like this
Dim _region As Domain.Region = RegionService.GetRegionByNameAndParentID(user.UserRegion, user.ParentRegionID)
If ModelState.IsValid AndAlso Not _region Is Nothing Then
''# ...
Else
Retur...
In MVC.NET, how should I dynamically populate the HTML structure from a database into a Masterpage where the first the template needs to wrap the masterpage contents?
AKA
-- master page header stuff goes here --
...
-- Beginning of client template goes here --
...
-- masterpage contents goes here --
...
-- End of...
After posting a form to database is it possible to call a jquery from asp.net mvc.....
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(FormCollection collection)
{
try
{
//Insert to db
//Call a jquery function
return RedirectToAction("Inde...
For example, I want to show a jQuery dialog after insert or edit a record in Action, in webform I can use the follow way to register js script to the page:
page.RegisterStartupScript(key, "<script language='javascript' defer>" + script + "</script>");
but this doesn't work in MVC, so how can I do this?
thanks!
...
I've been following Steven Sanderson's book called Pro ASP.NET MVC Framework, and I'm running into an exception:
Could not load type 'DomainModel.Abstract.IProductsRepository' from assembly 'DomainModel'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more...
I know I have seen a lot of posts on a Internal server error, but I couldn't find one the answered my question. I created an asp.net MVC application. It works fine when I run locally, but when I deploy it I keep getting an Internal Server error. I called go daddy and they said it must be something in my code. I know I changed the domain ...
I have a directory in my website called /MyFiction. It is an installed version of Wordpress for a particular blog and I would like to keep it to where you can only get to it if you're authenticated. I'm an old hat to ASP.NET but with MVC I'm still a newbie....
...
i have this controller function
Public Function Index(ByVal id As System.Nullable(Of Integer)) As ActionResult
using db = New DbDataContext()
Dim prod As PagedList(Of product) = db.products.ToPagedList(If(id, 1), 20)
Return View(prod)
End Using
End Function
i have to create a view strongly typed with Dim prod As PagedList(Of produ...
I recently published my first MVC 2 project to a commercial web server, running Windows 2008, and which purportedly supports other MVC sites without issue, but have been experiencing some problems. Here is the high-level structure of the project. As you can see, it is very simple:
But, after the site is published, and I navigate to th...
Possible Duplicate:
Can I use ASP.NET MVC together with regular ASP.NET Web forms
Let's say I need to build a shopping cart. Would I be able to get the same user experience with ASP.NET MVC or would I need to "pick the right tool for the job" - use Webforms and MVC where applicable instead of just focusing on either one.
...
I have an external compiled assembly with HtmlHelper extension methods. I need to use it in the project so that there wouldn't be any absolute references to this assembly because the project is shared with Team Foundation Server. What is the usual way to solve the problem?
...
I am using linq to sql as ORM for my asp.net mvc website.
I dont know how will linq to sql behave in the following situation.
Suppose one of the action from a active session, modifies a row of a table
and before saving the changes to the database, I mean before calling _db.SubmitChanges() another action from some other session tries to...
Hello,
I am having a slight problem correctly using the EditorFor of MVC 2, it us setting the name of the form field differently depending on context, which causes some headache when posting to a different URL. Here is what happens:
I have a model for a login form:
public class LoginForm
{
public string Email { get; set; }
pub...
I am developing a web application using asp.net mvc... I am listing out the details of Clients,Staff,Reports via ajax requests using jquery... What i am doing is writing seperate functions(jquery ajax requests) for each actions (ie) view,add,edit,Delete ...
//Clients
function getClients(currentPage) {
$.ajax({
url: "Clients/...
Is there any particular reason to use one over the other or it's all just a personal preference in the end?
...
ASP.NET MVC Controls - Around 9 controls.
ASP.NET AJAX Controls - Around 70+ controls.
I've read somewhere that you cannot use AJAX controls inside ASP.NET MVC web applications. Does that mean ASP.NET MVC is less productive?
...
I have entries for an enumeration stored inside a database table with only the following fields: ID and Name. I want to show the values stored inside this table inside a DropDownList on a form. The user then chooses a value and submits the form.
I found a way to easily create a DropDownList from an enumeration (although it would probabl...
I executing a function like this,
<script type="text/javascript">
$(document).ready(function() {
getEntities("Clients/GetClients", 0, formatClientsResult);
var maxvalues = $("#HfId").val();
$(".pager").pagination(maxvalues, {
callback: getEntities("Clients/GetClients", formatClientsResult),
...
Very often I need to pass "complicated" data to my views: different database objects, classes etc. And I'm tired of creating dozens of classes-helpers like.
class StatsPageViewData
{
public User User { get; set; }
public Something Something { get; set }
// blah blah
}
Of course I can't just use ViewData["something"], it's ...