I have found ASP.Net PageMethods very handy and easy to use, but I have just started developing using MVC and am not sure how to use them?
What is the equivalent of PageMethods.MyFunction() in MVC where MyFunction is a Controller action?
I know I can use the Json function to return a value, but how do I call the action from the client...
I've seen a few examples of RSS Feeds in ASP.NET MVC, like this, and some samples in projects (like Oxite), but none of them are complete.
Eg. None of them check for the header
If-Modified-Since
in the request, to save bandwidth.
I do not want to reinvent the wheel, so I stop here asking for some directions.
...
I'm using ASP.NET MVC and I have a partial control that needs a particular CSS & JS file included. Is there a way to make the parent page render the script and link tags in the 'head' section of the page, rather than just rendering them inline in the partial contol?
To clarify the control that I want to include the files from is being ...
Is it possible to inherit from both ViewPage and ViewPage<T>?? Or do I have to implement both. Currently this is what I have for ViewPage. Do i need to repeat myself and do the same for ViewPage<T>??
public class BaseViewPage : ViewPage
{
public bool LoggedIn
{
get
{
if (Vi...
I'm guessing the StackOverflow code has something along the lines of a UsersController that defines a function like this:
public ActionResult Profile(string id, string username, string sort)
{
}
From what I can tell, there's two ways to go about implementing the Profile function. One is to use a switch statement on the sort param...
I'm using ADO.NET EF in an MVC application. I'm considering putting the ObjectContext inside HttpContext.Current so that all logic in the same request can access to it without having to open/destroy each time. However, I'm really sure if it's a good way to manage ObjectContext instances. I have 2 questions regarding this need:
As Ht...
My master page has a contentplaceholder in the head tag.
Because I want my page's title to represent the function of the current page and because I want the title to be translated in the user's language I have added a title tag in the page's head's contentplaceholder. All jolly and good except that now there appears a second, empty titl...
I like the Validation Application Block from the Enterprise Library :-)
Now i would like to use the DataAnnotations in Winforms, as we use asp.net Dynamic Data as well. So that we have common technologies over the whole company.
And also the Data Annotations should be easier to use.
How can I do something similiar in Winforms like Steph...
I understand that you can use forms authentication to grant/deny access to certain pages based on the criteria of your choosing.
However I wish to go in a little more specific than that and say, have different buttons appear for users based on thier permissions.
I know I could do something like
if(((User)ViewData["CurrentUser"]).IsEmp...
Hey all,
Having an odd problems with ASP MVC deployed on IIS6 (Windows 2003). I've simplified the controller code to the below;
<AcceptVerbs(HttpVerbs.Get)> _
Public Function CloseBatches() As ActionResult
ViewData("Title") = "Close Batches"
ViewData("Message") = Session("Message")
Return View()
End Function
<AcceptVerbs(H...
I am trying to get simple jQuery to execute on my Content page with no luck below is what I am trying to do:
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<script src="../../Scripts/jquery-1.2.6.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(...
I will begin this question by admitting I am very new to MVC. The design pattern makes sense to me at a high level, but now that I'm exploring ASP.NET MVC, some of the architectural pieces are challenging my preconceived notions. Learning is a good thing.
I've been working with Oxite lately as a learning tool written by people at the co...
I have two routes I want mapped in my ASP.NET MVC application
/User/Login
/User/{userid}/{username}/{action} (e.g. /User/1/blah/profile)
Here are the routes I've defined:
routes.MapRoute(
"Profile",
"Users/{userID}/{username}/{action}",
new { controller = "Users", action = "Profile" }
);
r...
I want to go beyond the default error handling given in ASP mvc. I have an errors controller, so I can hopefully give different error messages according to whats happened: i.e Invalid arguments, Permission denied, OMG DATABASE DEAD, etc.
But I cant seem to work out how to do this, this is what I have tried:
[HandleError(View="/Errors/...
I am looking for any kind of information (prefer Moq) on how to unit test the Application_Start method in Global.asax. I am using ASP.NET MVC and trying to get to that elusive 100% code coverage!
The fact that I'm using MVC is not the point. And saying that not testing Start is not necessary isn't really the answer either. What if I ...
I'm just starting my first project in ASP.NET MVC. In my webforms experience, I would usually have a separate project dedicated to my domain layer. In here, I would have my Domain specific objects along with my NHibernate mapping files and some business logic. Most of the examples I am seeing online are putting these classes along with b...
Can anyone explaine me, what is MVC, why we use it and how we can use it. Benefits of using this? and can we use ASP.NET MVC in ASP.NET 2.0 (VS 2005)
...
If I'm rendering a regular view in asp.net mvc the only domain object properties that show up in my page the ones I specifically write out. For example:
<div><%= Customer.FirstName %></div>
However, if I serialize a domain object for json it will include every property. Example:
public JsonResult Customer (int? id)
{
Customer cus...
Hi,
does anyone know is there a way to implement Windows Live ID authentication into your ASP.NET MVC site. There is some info about OpenID implementations and it uses some libraries.
So is there a way to implement Live ID or it is not yet supported.
Thank you
...
The code
<%=Html.CheckBox("SendEmail") %>
evaluates to two HTML elements when it's rendered
<input id="SendEmail" name="SendEmail" type="checkbox" value="true" />
<input name="SendEmail" type="hidden" value="false" />
Is this by a bug? Or by design? If it's by design, why?
...