asp.net-mvc

problem to find out the string is null or not

in mysql default null value is (NULL) when i try to use it in c# that code not work because it is a string who have a value "(NULL)" how i can check that string is null or not. if i check by string.insnullorempty or ==null it's not worked how can i check this row is null or not in c# ...

how to append " in string in c#

for writing images on a html page i want to write only " after closing are anyone tell me about this then how i can write this means to say that <img src = " <% code is here %> " /> ...

When is ReleaseController method called?

I'm implementing a custom ASP.NET MVC controller factory. I wonder when the ReleaseController method is called? Is it the same time as EndRequest? ...

ASP.NET MVC - Organizing Site / URLs

My question is around the best practice for dividing up an asp.net mvc web app. I am building a fairly simple application which has two main sections, public and private. Basically I am running up against the issue of collisions between controllers. What I want is to have urls like /public/portfolio, but also have /private/portfolio. Lo...

ASP.NET MVC: What's the difference in concept between Service and Repository

Hello, The question I'm asking is kind of subjective. I've seen twice, while exercising with real projects such as StoreFront, both Repository and Services. Sometimes they can just be folders or projects attached to the solution. But they contain classes and interfaces. So, I'd like to know what goes to the repository and what goes to ...

Add jquery autocomplete on ready to multiple text inputs

Hi, I have problem in adding autocomplete plugin to multiple text inputs in loop (no errors are returned). // get text inputs to attach autocomplete var locinputs = $('#localizations').find('input:text'); // iterate over elements and add autocomplete plugin for (var i = 0; i < locinputs.length; i++) { // asp.mvc...

Using view in several pages

Hi, everybody! I have a view (let's say x) that I want to use at some parts of several pages (let's say y, z, t). The action (let's say a) that called from view (x) calls a web service that returns me an id (let's say i) and returns the same view (x) again. And in the pages (y, z and t) I want to do different things using this id (i). H...

Can i add MVC project in normal asp.net c# project?

Hello, can anybody tell me that if i made a normal asp.net c# project and in that solution i want to add mvc project. so is it possible to call mvc view from normal page which is in first project? if yes then how can i call view page from normal page of asp.net c# project. on live server how can i call mvc page? Thanks Samir ...

how to pass querystring in friendly url in asp.net mvc

I have the following action. I can hit this with /basket/address?addressId=123 However i wonder how i can hit it with /basket/address/123 public ActionResult Address(int addressId) { return RedirectToAction("Index"); } my routes routes.MapRoute( "Default", ...

Could not load type 'System.Web.Mvc.ViewUserControl<SOMETYPE>'.

I'm trying to deploy ASP.NET MVC 2 project (VS2010) to Win Server 2008 R2 It works perfectly on dev machine. But strange error occurs at Server 2008 R2: When .ascx file has header that uses generic type: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MyProj.Web.Models.RangeViewModel>" %> Server reports Could not ...

WCF publish/subscribe service, and ASP.NET MVC client

I managed to develop a custom WCF service, using the publish / subscribe model, and hosted inside a managed windows service. Everything's working. I developed an interface as the service contract implementing a method definition marked as a non-one way operation contract (OperationContract(IsOneWay = false)]. This, to make possible retu...

MVC JsonResult Method not accepting parameter

I have an MVC JsonResult Method that accepts one string parameter: public JsonResult GetDestinations(string countryId) { List<Destination> destinations = new List<Destination>(); string destinationsXml = SharedMethods.GetDestinations(); XDocument xmlDoc = XDocument.Parse(destinationsXml); var d =...

Is there a free chart report tool on ASP.NET MVC?

Good morning anyone recommend a free tool for generating Charts compatible with ASP.NET MVC? thank you ...

MVC route doesn't work

Hi All, I have a bunch of Views in a default folder that represent single "static" pages. Everything works as advertised except i tried adding a new page yesterday.. using the exact same routing syntax and cannot for the life of me get it to work. here's is an example of a working route: routes.MapRoute( "OurProgram", ...

Crystal Reports - export to pdf in MVC

Hi folks, I have integrated the below code in my application to generate a 'pdf' file using crystal reports in MVC project. However, after the request is processed, i get to see only 2 pages in the pdf file while my 'data' returns more than 2 records. Also, the pdf isn't rendered as soon as the page is processed but instead i have to r...

ASP.NET MVC : Good Replacement for User Control?

I found user controls to be incredibly useful when working with ASP.NET webforms. By encapsulating the code required for displaying a control with the markup, creation of reusable components was very straightforward and very, very useful. While MVC provides convenient separation of concerns, this seems to break encapsulation (ie, you ca...

Get all roles - ASP .Net Membership

I have an ASP .net MVC 2.0 web site and I am using the membership provider to store users and groups. How do I get a list of all the roles? ...

Bitfield With 3 States...?

I'm trying to create an authorization scheme for my ASP.NET MVC application where an Enum is used to set permissions. For example: [Flags] enum Permissions { ReadAppointments = 1, WriteAppointments = 2 | ReadAppointments, ReadPatients = 4, WritePatients = 8 | ReadPatients, ReadInvoices = 16, WriteInvoices = 32 | ...

How do I generate an encryption hash in ASP.NET MVC?

I am looking into creating a custom members login system (for learning) and I haven't been able to figure out the C# command to generate an encrypted hash. Is there a certain namespace I need to import or anything like that? Thanks for any help. ...

403 - Forbidden: Access is denied. ASP.Net MVC

hi guys i published my application on server when i enter my domin i got this error 403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied. what's happend? ...