Looking For View Codding New Futures?
Nov 4, 2010what are the new futures came in asp.net mvc2.. I am looking for View Codding new futures? Controller coding and Seurity?
View 2 Replieswhat are the new futures came in asp.net mvc2.. I am looking for View Codding new futures? Controller coding and Seurity?
View 2 RepliesI've been trying to get the strongly typed version of RedirectToAction from the MVC Futures project to work, but I've been getting no where. Below are the steps I've followed, and the errors I've encountered.
I created a new MVC2 app and changed the About action on the HomeController to redirect to the Index page.
Return RedirectToAction("Index")
However, I wanted to use the strongly typed extensions, so I downloaded the MVC Futures from CodePlex and added a reference to Microsoft.Web.Mvc to my project.
I addded the following "import" statement to the top of HomeContoller.vb
Imports Microsoft.Web.Mvc
I commented out the above RedirectToAction and added the following line:
Return RedirectToAction(Of HomeController)(Function(c) c.Index())
So far, so good. However, I noticed if I uncomment out the first (non Generic) RedirectToAction, it was now causing the following compile error:
Error 1 Overload resolution failed because no accessible 'RedirectToAction' can be called with these arguments:
Extension method 'Public Function RedirectToAction(Of TController)(action As System.Linq.Expressions.Expression(Of System.Action(Of TController))) As System.Web.Mvc.RedirectToRouteResult' defined in 'Microsoft.Web.Mvc.ControllerExtensions': Data type(s) of the type parameter(s) cannot be >inferred from these arguments. Specifying the data type(s) explicitly might correct this error.
Extension method 'Public Function RedirectToAction(action As System.Linq.Expressions.Expression(Of System.Action(Of HomeController))) As System.Web.Mvc.RedirectToRouteResult' defined in 'Microsoft.Web.Mvc.ControllerExtensions': Value of type 'String' cannot be converted to 'System.Linq.Expressions.Expression(Of System.Action(Of mvc2test1.HomeController))'.
Even though intelli-sense was showing 8 overloads (the original 6 non-generic overloads, plus the 2 new generic overloads from the Futures assembly), it seems when trying to complie the code, the compiler would only 'find' the 2 non-gneneric extension methods from the Futures assessmbly.
I thought this might be an issue that I was using conflicting versions of the MVC2 assembly, and the futures assembly, so I added MvcDiaganotics.aspx from the Futures download to my project and everytyhing looked correct:
ASP.NET MVC Assembly Information (System.Web.Mvc.dll)
Assembly version: ASP.NET MVC 2 RTM (2.0.50217.0)
Full name: System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Code base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Web.Mvc/2.0.0.0__31bf3856ad364e35/System.Web.Mvc.dll
Deployment: GAC-deployed
ASP.NET MVC Futures Assembly Information (Microsoft.Web.Mvc.dll)
Assembly version: ASP.NET MVC 2 RTM Futures (2.0.50217.0)
Full name: Microsoft.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null
Code base: file:///xxxx/bin/Microsoft.Web.Mvc.DLL
Deployment: bin-deployed
This is driving me crazy! Becuase I thought this might be some VB issue, I created a new MVC2 project using C# and tried the same as above.
I added the following "using" statement to the top of HomeController.cs
using Microsoft.Web.Mvc;
This time, in the About action method, I could only manage to call the non-generic RedirectToAction by typing the full commmand as follows:
return Microsoft.Web.Mvc.ControllerExtensions.RedirectToAction<HomeController>(this, c => c.Index());
Even though I had a "using" statement at the top of the class, if I tried to call the non-generic RedirectToAction as follows:
return RedirectToAction<HomeController>(c => c.Index());
I would get the following compile error:
Error 1 The non-generic method 'System.Web.Mvc.Controller.RedirectToAction(string)' cannot be used with type arguments
What gives? It's not like I'm trying to do anything out of the ordinary.It's a simple vanilla MVC2 project with only a reference to the Futures assembly.
I'm hoping that I've missed out something obvious, but I've been scratching my head for too long, so I figured I'd seek some assisstance.
If anyone's managed to get this simple scenario working (in VB and/or C#)
I'm learning ASP.NET MVC 2 I want to create a wizard-type application. I was reading you can accomplish this with the help of Html.Serialize method in ASP.NET MVC Futures assembly (To help preserve state as you step through views).
I haven't seen that this is even part of MVC 3.0 as well. how certain this feature will be included for sure in the future? I'm a little wary of relying on it being there.
I´m using mvc futures 2 with WebApiEnabled for XML and JSON support. But due to cross domain issues with jQuery $.ajax I´m lookin in to JSONP. Is there a simple way to extend futures rest function for JSONP or should I do something else.
View 1 RepliesI downloaded MVC2 Futures and referenced it to my current MVC2 Project. However, if I want to call an HtmlHelper from MVC2 Futures I need to <%@ Import Namespace="Microsoft.Web.Mvc" %>
So I decided to add it on my Web.Config:
[code]....
but, this caused me errors. Could this assemblies co-exist? If yes, How?
have a web in which there are different areas i have a 1 admin which manage all things like news, Events, Notices, Logs, Forums, Publications etc.........i want assign user rights that select user view only Noticesselect user view only Logsselect user view only Newsetc....
View 7 RepliesI have looked all over for elegant solutions to this not so age-old question. How can I lock down form elements within an ASP.Net MVC View, without adding if...then logic all over the place? Ideally the BaseController, either from OnAuthorization, or OnResultExecultion, would check the rendering form elements and hide/not render them based on role and scope. Another approach I have considered is writing some sort of custom attributes, so as to stay consistent with how how we lock down ActionResults with [Authorize]. Is this even possible without passing a list of hidden objects to the view and putting if's all over? Other background info: We will have a database that will tell us at execution time (based on user role/scope) what elements will be hidden. We are using MVC3 with Razor Viewengine. We're utilizing a BaseController where any of the Controller methods can be overridden.
View 1 RepliesWhen I am creating Strongly Typed View I get lots of Classes in View Data Drop down. Classes like Automapper, ninject, Interface..., latebound... Due this its very hard to find my project classes. Is there any way to restrict dropdown to only display my project classes?
View 1 Repliesspeed Performane i create a web site but it very slow run i use tree view and grid view but i do it run very fast
View 1 RepliesI'm using Visual Studio 2008, and when I select/highlight something in design view and switch to source view it does not highlight and scroll to the selected item. This makes it really hard to change stuff in source view, and it's very inconvenient at worst
View 2 RepliesWhen using the "add view" dialog in vwd is there a common practice for presenting any primary key fields as readonly to the user in the view?
By default it appears the user could change the key field value (as it is presented in a textbox) and overwrite data for that record for which the key was accidentally changed to.
Do we have to store the original record's key and then make the key presented as a label and then on the update subtitute the original key value back in for the record? Or is there something simpler?
i have the following problem concerning the index::
my source code::
[Code]...
the problem is appeared when i have added the pager to my list view ,,i have out of range for index exception ... how to determine the page iam in and specify the right index either i use list view or grid view or other such controls..
I have an entity object as model input in my view. Not sure if it's the best approach, but I use the object references to get values from a related object.Let's say I've got a car entity and a manufacturer entity.Here's how it would look in my view
[Code]....
I've get a nullreferenceexception where the car entitity does not have a reference towards manufacturer. I'd like to output a " " if no manufacturer exists.
i have gridview , it contains record of productsname field of product table and hyper link, hyperlink named as Detail.
when i click Detail link ,it will show record of that row in another page,means it shows complete fields of table in another page,,
i want to know only that,how detail link will perform,to view only that row record,
Members view (index) that lists members that users can select to show a partial view in the same view with details for the selected memberUses jquery (Ajax.ActionLink) to call a partial view method in the members controller to then load the members detail sectionWorks fine up to here....but I'd like to load the partial view with "member" details for a default or random member on initial load -- ie not through the Actionlink selectionHow do I invoke the partial view method on the initial load?
View 4 RepliesI have a view which takes two objects: booking and list of reasons for canceling that booking.I have two classes: clsBooking, clsBookingCancelationReason I can read both objects in my view - no problems there. After I read the objects, I display the booking details and I generate a list of cancelation reasons in the following way:
[Code]....
The code above generates a list of cancelation reasons.How do I pick up the selected ReasonId from the list?
I need to generate a link that will contain the bookingId and the selected reason for canceling the booking.I can get the bookingId out easily since it's stored in the Model...but how do I go about the selected ReasonId?
Split view and design view doesn't work.I installed and uninstalled Office 2003 and 2007 once but there's no office in my computer now.-I have Microsoft Studio Web Authoring Component installed.(12.0.4518.1066)(Uninstalled and installed it twice)-My computer-properties-Advenced system settings-environment variables-system variables-path is;
[code]...
What is the problem,how can i fix it? I tried everything in other posts.
i'm tring to search my table according to id number or the case number then view it in a gridviewbut it work for the first time then after it stop for error
Dim conn As New SqlConnection
conn.ConnectionString = "Data Source=.SQLEXPRESS;AttachDbFilename=C:Program FilesMicrosoft SQL ServerMSSQL10.SQLEXPRESSMSSQLDATATask.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
[code]...
when I'm building a menu in a view I get following error when code reaches <% Next item%> :
System.InvalidOperationException was unhandled by user code
Message=The value of a property that is part of an object's key does not match the corresponding property value stored in the ObjectContext. This can occur if properties that are part of the key return inconsistent or incorrect values or if DetectChanges
is not called after changes are made to a property that is part of the key.
Source=System.Data.Entity
My view: (its a userview)
[Code]....
My Model
[Code]....
My Datasource
[Code]....
I use this way of looping frequent the only thing is that this is that this entity has a view as source and not a table, so I think it has to be related with that.
Let's say there is a textbox and a dropdownlist in mainview page, these two values are used by three partial views as well. when I use Html.RenderAction to post action to those three partial views, how to pass these two values to those partial views and in those views how to get these two values as a part of a object to send to database.
View 10 Repliesi am trying to but a menu of links in master page
but they does not appearr
here is the code
[Code]....
how to asp.net update panel use in Tree view and grid view
View 2 RepliesI have a field in a details view shown below
<asp:BoundField DataField="DTMON_F" HeaderText="Monday Hours From: " InsertVisible="False"
ReadOnly="True" SortExpression="HOURS" Visible="false" />
<asp:TemplateField HeaderText="Monday Hours From: " SortExpression="HOURS">
<EditItemTemplate>
<uc1:TimePicker ID="tpMondayHours" runat="server"/>
</EditItemTemplate>
<InsertItemTemplate>
<%-- <uc1:TimePicker runat="server" ID="tpMondayHours" />--%>
<asp:TextBox ID="txtMondayHours" runat="server" Text='<%# Bind("DTMON_F") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="lblMondayHours" runat="server" Text='<%# Bind("DTMON_F") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
Before "DTMON_F" is binded to the view I want to cut the string that is returned...Where and how might I do this?
I need to display an error message in the view when there's an error in rendering the partial view in that View.
How can i handle the exception while rendering partial view and display the error message in the view?
've created a Search partial view and it works, except for my view model. What i mean is, the partial view sends a string to my ActionResult Method, but only a string, that is not related to the view model that the partial view is built in. If i tell my ActionResult method to receive the view model in which the partial view is built in, it always tells me that i have null values. Here's my code This is my partial view:
[Code]....
Now here is my Model in my MoviesSearch view model:
[Code]....
Now the actual MoviesSearchViewModel
[Code]....
Inside my Search controller i have this
[Code]....
And then i have this: