In the authentication control I have the following line to mark a user as authenticated in the system (after checking out the password):
FormsAuth.SignIn(userName, rememberMe);
and if I redirect, which is the standard behvaior, everything is ok. But if I show a view right away, the usual ways to check whether a user is authenticated:
...
Hey guys, I'm a bit frustrated here. I'm not quite sure what's going on. I started with the default MVC Project Template and proceeded to add a Controller ...
public class TestTemplatesController : EVController<EvTestTemplate>
{
//
// GET: /Tests/
[Authorize]
public ActionResult Index()
{
ViewData.Model = E...
How do I support ETags in ASP.NET MVC?
...
What is the correct way to reference Javascript in ASP.NET MVC? Using something like ../../Scripts/Myscript.js seems to work fine for routes that are the traditional {controller}/{action}/{id}, but are more fragile for anything more or less complex than that. Of greater concern is that the rational absolute reference (/Scripts/Myscript.j...
Hello,
I have written a plugin solution for ASP MVC applications based on the advice found on this site, however, I have reached a roadblock and would appreciate some help. Without going too deep into how the plug-in system works, it does successfully load the controller and finds its appropriate view - the problem is that the view does...
I have a detail page that gets called from various places and has a nice readable url like
"www.mypage.com/product/best-product-ever".
The calling pages (list of products) have a more complex url like:
"www.mypage.com/offers/category/electronic/page/1/filter/manufacturer/sony/sort/price" and
"www.mypage.com/bestseller/this-week".
H...
In my views I verry often have to write
<%=Model.T9n.TranslateById("someId");%>
Is there some way to make this more compact/readable. A custom tag maybe?
<asp:T9n>someId</asp:T9n>
or better
<t9n: someId />
Note
There are several (business) reasons why I can't use the default T9n tools in visual studio so that's why I've rolled ...
Hi guys
nowadays i m making one mvc project and i use master page i wanna make menu with items have active preferences i used
$(document).ready(function() { //document
$('#tabMenu > li').click(function() { //clik
if (!$(this).hasClass('active')) { //if
$('#tabMenu > li').removeClass...
I am writing an account management controller and have to process deleting of own user's account separately:
[Authorize]
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Delete(string userName, string confirmButton)
{
MembershipService.DeleteUser(userName);
if (User.Identity.Name.Equals(userName,
StringComparison.Invar...
Hi
How do I (in my controller) send a pdf that opens in the browser. I have tried this but it only downloads the file (both ie and firefox) without asking.
public ActionResult GetIt()
{
var filename = @"C:\path\to\pdf\test.pdf";
// Edit start
ControllerContext.HttpContext.Response.AddHeader("Content-Disposition", String.For...
Hi guys,
I was wondering if someone could provide me with some answers. I've been asking to swap our internal apps to an MVC architecture for quite a while now. Rails was absolutely shot-down as a toy, Struts is just too huge for the apps we do, Django's name makes these old folks nervous (oil & gas industry) but finally, finally Micr...
Hi Folks,
I'm using OpenId in my ASP.NET MVC application. Works great :) Once i have the user's OpenId Identifier (once they have authenticated and returned to my site), i load up the users data (to get display name, etc).
From here, i also know their roles.
I'm not sure how to assign the role to the current Forms.Identity.
here's my...
I would Like to Know How I could Fill A DropDownList from 2 Tables.
I have Tables:
Categories
Subcategories
I should look like this:
-- Vehichles -- //From Categories
Cars //From SubCategories
Bikes
-- Houses --
Vila
Aparatment
This tables are conected to eachother with foregin keys. and I use Linq to SQL.
Any Good So...
I have an ASP.NET MVC web role running on Windows Azure and have setup ELMAH properly in the web.config. I also have my global.asax ignore *.axd routes. Locally, I am able to load /elmah.axd, however when I deploy to Azure, I get a 404 on that page. Has anyone gotten ELMAH working on Azure?
...
I am reviewing some ASP.NET MVC code developed by a third party and have encountered the following markup in a View:
<div class="panel_body">
<% Html.RenderAction(((string[])Model)[0], "Customer"); %>
</div>
<!-- Some HTML omitted -->
<div class="wizard_body">
<% Html.RenderAction(((string[])Model)[0], "Journey"); %>
</div>
...
Hi
I'm fooling around with the NerdDinner tutorial Dinner Edit control.
I get a FormCollection as one of the arguments, can I trim the data in it before I use UpdateModel().
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit(int id, FormCollection formValues)
{
Dinner dinner = dinnerRepository.GetDinner(id);
...
I am writing a backend/admin area for a website. The users want the ability to modify their menu's on the website.
These menus can be heirachical no more than 3 levels deep.
Do you allow users to do this?
How do you store the heirarchy?
How do you programmatically display the menu?
How do you make it easy for users to create heirar...
Hi,
By default Html.ValidationSummary() produces HTML like this:
<span class="validation-summary-errors">There were some errors...</span>
<ul class="validation-summary-errors">
<li>First Name too long</li>
<li>Invalid Email Address</li>
</ul>
I'd like to select the entire validation summary and add a bounding box around it via ...
I am developing an application in ASP.NET MVC, using SQL Server Express as the backend and Cassini as the development web server (the one that comes with Visual Studio 2008).
The application performance is blazingly fast (nearly instantaneous page switches). However, spinning up the debugger is painfully slow; it takes about 30 seconds...
My team is currently in the process of building an ASP.NET MVC application, and we're trying to decide which of these frameworks to implement to deal with error handling and logging.
What are the reasons for choosing one of these over the other?
...