mvc

Handling events from shared control in MVC

In an application I'm working on I've implemented a MVC pattern to use different views for displaying parts of a UI. In an overall UI there's an entry box, in which the user can give commands or queries. The idea is that this entry box generates a few basic events, like "ValidEntry", "InvalidEntry" and "EmptyEntry". Each one of the contr...

C#, Winforms & LINQ to SQL.. Datacontext lifecycle?

We use an enterprise framework that we wrote to facilitate all sorts of company specific stuff that we do. Within the framework, we provide a LINQ to SQL ORM to use when appropriate. All of this is based on the Microsoft MVC framework. On the MVC side, we new up a datacontext in our base controller. This allows us a full datacontext lif...

Is it possible to use SimpleModal with ASP.NET MVC

Hi everyone, Is it possible to use SimpleModal (jquery plugin) with ASP.NET MVC. Since it has postback stuff init. thanx Owais ...

Ajax actionlink

I had user control in MVC asp.net which list the comments for particular image. I had given delete link with every comment. Now i want to delete that comment using ajax link. Please tell me how can i use ajax This is my user controll and i am calling controller action on delete link <%@ Control Language="C#" AutoEventWireup="true" CodeB...

How to access static members in a Velocity template?

I'm not sure if there is a way to do this in Velocity or not: I have a User POJO which a property named Status, which looks like an enum (but it is not, since I am stuck on Java 1.4), the definition looks something like this: public class User { // default status to User private Status status = Status.USER; public void s...

ASP.NET MVC & JQuery Dynamic Form Content

I would like to dynamically add fields to an ASP.NET MVC form with JQuery. Example: <script language="javascript" type="text/javascript"> var widgets; $(document).ready(function() { widgets = 0; AddWidget(); }); function AddWidget() { $('#widgets').append("<li><input type='text' name='widget" +...

ASP.NET MVC ViewData Null

Hi, I am currently creating an e-commerce site using C# ASP.NET MVC and have just come across a problem. On pages such as product pages and search results pages, I have to pass Lists of data from my controller to the ViewPage and that works just fine. However, a null reference exception occurs if the Viewdata equals null. It happens ins...

Ajax in ASP.NET MVC Framework

I want a nice "on mouse over"-effect on a word. I want my system to show a 2*1 (inches) rectangle with some information in it. Please guide me to an url or show an example ...

Passing arguments to views in ASP.NET MVC?

Hi, I've been experimenting with ASP.NET MVC and following this tutorial to create the basic task list application. I've gotten it running fine, everything is working although the video is in VB and I had some trouble getting it "converted" to C# but muddled through thanks to the codesample. Now, to further my knowledge I've decided to...

Ajax ModalPopupExtender with an edit form in ASP.NET MVC

hi Everyone, I have an events calendar and on each event in the calendar there is an edit link which open up ajax ModalPopupExtender for editing the event information. The issue that I am facing right now is that the edit has to be in a form so it can update the information on the server.. how do i deal with this??? And what would be...

Fat models, skinny controllers and the MVC design pattern

I just read a [blog post][1] that explains MVC with a banking analogy. I have a few months of experience with web application development with an MVC framework (CakePHP), so I get the basics, but I began to see a theme that made me think I'm taking a flawed approach to where I put my logic: Fat models, skinny controllers Keep as much b...

Creating Snippets of ViewPage ServerSide Code

Hi again, I am working on an ASP.NET MVC Project and I have a number of node snippets that I need to insert into multiple pages. I would very much like to know whether or not it is possible to have a snippet of code that can be placed in an external file and called from within a ViewPage. In a way this would be similar to calling a class...

How do access the contents html.textbox while on the page in asp.net MVC

Hi everyone, i am trying to access the contents on my textbox while on the page. is there anyway of doing that ? Thanx Owais ...

Organising a GUI application

This is going to be a generic question. I am struggling in designing a GUI application, esp. with dealing with interactions between different parts. I don't know how I should deal with shared state. On one hand, shared state is bad, and things should be as explicit as possible. On the other hand, not having shared state introduces unwa...

Asp.Net MVC Route Table and Controller Actions

I am creating a directory of sorts with members and their profiles. I'm using the MVC framework in .net. I have a view that allows you to find members based on some criteria so my controller has a Find() action result, then another that accepts the post verb. So, somesite.com/members/find displays the search tools, then once the form...

Two controllers for one shared view in Ruby on Rails

I have two controllers for two respective models, by example, photos and categories. index and show methods are very similar in each controller, and the views are identical. What is the best method for share the view by the two models? I've though two options: Use a helper. In the helper will put the code for the view, and will call t...

What reference do I need to call UpdateModel?

Hi everyone, I am trying to use UpdateModel in a class other than my controller and it doesn't work. When I call UpdateModel in my controller class it works perfectly. The references are the same in both classes. Would someone please help me out on this? Thanks! ...

Should MVC Controller be in separate DLL?

I've created a .NET winforms MVC. The Controller and View are in the same EXE. Model is in a set of DLLs that get used by several groups. The MVC is very explicit. Model knows nothing of Controller and Controller knows nothing of View. I'm thinking to put the Controller in its own DLL so that it can be unit tested. Highly unlike so...

Html.ActionLink in asp.net MVC object value in wrong format

I have a html.actionlink that i wish to display a link to a members profile page like this: http://somesite.com/members/{username} When use the following markup <%= Html.ActionLink(r.MemberName, "profile", new { MemberName = r.MemberName } )%> I get a link that looks like this: http://somesite.com/members?MemberName={username} What ...

URLs like ASP.NET MVC offers

Is there any way to implement a URL mechanisim in asp.net like it has in asp.net mvc e.g. mydomain.com/user/myusername but without using the MVC if so, how? ...