asp.net-mvc

Getting session data in MVC actions with AuthorizeAttribute

When I use the [Authorize] attribute I can't get session data that I stored before. For example: public ViewResult Index() { // do some stuff Session["Test"] = "Hi StackOverflow!"; } And then I try to get it in another action, but with the [Authorize] attibute: [Authorize] public ViewResult Test() { // do some stuff if(Se...

Render a Form from an XSLT file

I've generated the following XSLT file, and have created a Form that will post to an ASP.Net MVC action called Home/ProcessRequest: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" > <xsl:outp...

Creating a standalone ASP.NET MVC application for Windows XP

Is there a way to create an installable (ideally XCopy installable) version of an ASP.NET MVC application that will run in a standalone fashion on a Windows XP machine? I don't mind installing SQL Server Express for this purpose, so I guess the question boils down to this: Can the Cassini web server that comes with Visual Studio 2008 be...

connecting to oracle database from c# asp.net mvc website

I am trying to connect to oracle database. I am able to connect to it through a local SQL Developer tool by sticking something in the oranames.tns file. My question is that i will be deploying this website to a number of places. A few questions: What is the simplest way i can use to connect to this database and do very basic queries...

High Availability ASP.NET MVC

When building an ASP.NET MVC application with a goal of high availability, is it a good practice to keep the session state on the SQL Server, if there is no state server available? ...

automatic formatting in web page content

i have content stored as raw text in a database that i show in a HTML table on a web site. In the content people refer to numbers and i want to have those numbers automatically become links For example, in a field i might have This description is for driving a car. The manual refers to ABC:25920 and is very durable. In this case ab...

Asp.Net MVC2 TekPub Starter Site methodology question

Ok I've just ran into this and I was only supposed to be checking my emails however I've ended up watching this (and not far off subscribing to TekPub). http://tekpub.com/production/starter Now this app is a great starting point, but it raises one issue for me and the development process I've been shown to follow (rightly or wrongly). ...

IoC: advantages of using a child container in web based app

I'm interested in knowing if there are any advantages to creating a child container for each request in a web based application? The tech stack I'm using includes StructureMap & ASP.NET MVC, which is not particularly relevant but included as background info. ...

Data-annotation getting errormessage out database

Hello, With asp.net mvc you can use the annotation [Required (errormessage="This is required")] How can I create something like this: [Required (errormessage="ERRORXX")] So I can look up in a database what this ERRORXX is and display it on my form. Now my form displays ERRORXX. How can I create something that solves my problem? Th...

Creating a skin engine in MVC

Does anyone have any experience creating a skin engine for asp.net MVC? I know the suggested approach is to use flexible markup with CSS, but I would like the ability for a new view to be dropped in, and the application use that one instead of the default one. Basically, I want to know how to tell the framework (at run time) to look in...

how to get the checked id's and unchekced ids using jquery

Hello friends using this code I am to get only checked id the beginForm I am perfectly getting all my chekced id's to the controler but I need to get both checked as well as uncheked ids' using above code? thanks ...

passing filterContext.ActionParameters to next attribute is null

I am using a recaptcha attribute that sets the actionparameter to true or false. I have an additional attribute that needs to check this value, but it is always null for the captcha parameter. How can i pull the first parameter for use in second attribute? ...

runtime loading of ValidateAntiForgeryToken Salt value

Consider an ASP.NET MVC application using the Salt parameter in the [ValidateAntiForgeryToken] directive. The scenario is such that the app will be used by many customers. It's not terribly desirable to have the Salt known at compile time. The current strategy is to locate the Salt value in the web.config. [ValidateAntiForgeryToken(S...

How can I use a RESTful JSONResult from my controller to populate Bing Maps Geocoding?

I know there are a few topics on this, but I seem to be fumbling my way through with no results. I'm trying to use a controller to return JSON results to my Bing Maps functions. Here's what I have for my controller (yes it is properly returning JSON data. Function Regions() As JsonResult Dim rj As New List(Of RtnJson)() rj.Add...

How can I highlight empty fields in ASP.NET MVC 2 before model binding has occurred?

I'm trying to highlight certain form fields (let's call them important fields) when they're empty. In essence, they should behave a bit like required fields, but they should be highlighted if they are empty when the user first GETs the form, before POST & model validation has occurred. The user can also ignore the warnings and submit the...

Why is ExecuteFunction method only available through base.ExecuteFunction in a child class of ObjectContext?

I'm trying to call ObjectContext.ExecuteFunction from my objectcontext object in the repository of my site. The repository is generic, so all I have is an ObjectContext object, rather than one that actually represents my specific one from the Entity Framework. Here's an example of code that was generated that uses the ExecuteFunction m...

For use WCF and create .svc is necessary a web application or in simple ASP.NET website run the .svc

Because in website i retrieve from .svc The type 'TaskService', provided as the Service attribute value in the ServiceHost directive could not be found. and not in web application [ServiceContract(Namespace = "")] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class TaskServ...

Why jquery ajax calls fails after session timeout in asp.net mvc?

when there is a value in my session variable my ajax calls work properly... But when a session is timedout it doesn't seem to work returning empty json result.... public JsonResult GetClients(int currentPage, int pageSize) { if (Session["userId"]!=null) { var clients = clirep.FindAllClien...

Problem Creating dynamic Id for textbox in asp.net mvc

I have 3 textboxes in three different tab control and i want to generate textbox id like textbox plus concatenate the tab number for(int i=0;i<3;i++) { <%: Html.TextBoxFor(e=>e.vcr_LinkName + i)%> } its not working but when i change it to for(int i=0;i<3;i++) { <%: Html.TextBox("vcr_LinkName" + i)%> } it works...

500 Internal Server Error in asp.net mvc

i am working in asp.net mvc . i am using partial views but when i clicked on particular link i got the following error 500 Internal Server Error any one know the reson thanks ...