asp.net-mvc

How can I insert mulitple rows in table at once in MVC asp .net ?

I am new at MVC asp .net. I have a grid in which I am adding rows. Now I want to perform mulitple rows insertion in a table at once. How can I do that. SO multiple rows will be added in MVC. Any help would be appericiated. ...

asp.net mvc c# - Is it possible to access value of textbox in View from Model in CodeBehind ?

Hello, I have a problem to get a value of textbox which is in view into the controller. In WebForms it was quite easy, it needed just to call textbox in codebehind trouhg Id, but in MVC it seems not possible this way, or? Help me please! Take care, Ragims ...

ASP.Net MVC ModelBindingContext class-- how are its model values populated?

I'm scratching my head a bit at how model binders do their work in ASP.Net MVC. To be specific, the BindModel() method has a ModelBindingContext parameter that holds the model name and type, but I don't understand how the ModelBindingContext receives these values. An MVC model has to be populated from posted form values or query st...

Using SWF Address deep linking while adding dynamic meta content

I have a flash site which reads deep links from the URL, then using c# asp.net we read the url and write the appropriate meta tags for the page being requested. e.g. GET www.domain.com/en-gb/scene4/subscene2 and outputs appropriate meta tags to page Then we redirect to the swfaddress friendly page containing the '#' www.doma...

ASP.NET MVC - Combine controllers?

Hey there, I'm at the moment trying to make a product management application. The way it works is that you add/edit/delete a Product Category for example "Ventrilo" and then you can add/edit/delete products in that category. Now is my question do I need a controller for both the Category part and the Product part? Like: /products/catego...

Do I need a view for every action?

I have been developing in ASP.NET MVC for a short while. Up to this point, the controller actions have been fairly simple. Each action returns its corresponding view. However, I recently created an action that I don't necessarily need a page for (the purpose of the action is to work with the database). My question is - what is the prop...

MVC, change the style of action link

I have an action link like this: <%=Html.ActionLink(Name + " (" + Count+ ")", "ActonName", "Controller", new { ID= itemID}, null)%> it shows football (5) I want it displays like this: football (5) I have try to change the actionlink like this: <%=Html.ActionLink(Name + " <b>(" + Count+ ")</b>", "ActonName", "Controller...

How can I intercept or override HtmlHelper link generation in ASP.NET MVC?

We began a project using WebForms, and developed a somewhat complex portal system to accommodate breadcrumbs, navigation, and so forth. We keep an extra navigation context ID parameter on the URL at all times, so that we can track the user's breadcrumb history robustly even if they are using multiple tabs or using the navigation buttons ...

Determine which portal to route to in a multi-tenant MVC website

Hello, I am working on a simple MVC2 multi-tenant application. My question is how do I determine which tenant portal has been asked for in the url by the user? What I need to have happen is this: A request to http://localhost should go to the standard Home controller’s index page A request to http://localhost/client1 should go to the ...

Repository pattern: One repository class for each entity?

Say you have the following entities defined in a LINQ class: Product Customer Category Should I have one repository class for all: StoreRepository ... or should I have: ProductRepository CustomerRepository CategoryRepository What are the pro & cons of each? In my case, I have several "applications" within my solution... the Stor...

How do I run a GET/POST and JSON RESULT on a page?

I have a page that does a JSON result, get and post method in the controller with two submit buttons. One button goes to the Post method only for a redirect, and the other button goes to the JsonResult method(named AddTableData). How do I set this up in my JQuery code? $('#firstSubmit').click(function() { $(document).submit(functi...

Rendering a View in MVC then immediately redirecting

Hi- What I am trying to do is render a View in an MVC site informing the user to not refresh their browser while server side processing is taking place. This could be a long running task, and if they hit refresh it will send the request again, thus sending them to the error screen when the process was actually successful. I was going t...

Can automapper map a foreign key to an object using a repository?

I'm trying out Entity Framework Code first CTP4. Suppose I have: public class Parent { public int Id { get; set; } public string Name { get; set; } } public class Child { public int Id { get; set; } public string Name { get; set; } public Parent Mother { get; set; } } public class TestContext : DbContext { pub...

MVC2 Partial View throws/catches exceptions while resolving the path to the view

While debugging my Visual Studio 2010 MVC2 solution, I noticed something that I didn't necessarily expect and that struck me as inefficient. When I was viewing the Home page, the IntelliTrace showed that many exceptions were getting thrown and caught while resolving a partial view. I have code that calls the partial view like this: <%...

ASP.NET MVC nested master pages, inherit content

I have a series of nested master pages, like so: site.master: <asp:ContentPlaceHolder ID="SearchFormContent" runat="server"> <%Html.RenderPartial("SearchFormControl"); %> </asp:ContentPlaceHolder> in the nested (child) master page, area.master <asp:Content ContentPlaceHolderID="SearchFormContent" ID="SearchFormContentContainer" runa...

Html.ValidationMessageFor on Mono has strange results

Hi, I'm a beginner at ASP.NET and I was learning how to use it through this tutorial. I use Linux, so I'm using Mono 2.6.7. I've had to stray off the path of the tutorial several times to get things to work under Mono (including using a patched version of MVC 2 that I would link to, but I am unable to as new users can only post one hyper...

json output of an MVC Action

Hello, How can i preview the JSON output of an MVC Action that uses Jsonresult? ...

How can I display a message in a master page with ViewData?

How can I display a message on the master page. The message is sent by the action. public ActionResult DisplayMessage() { ViewData["hello"] = "Hello!"; return View(); } ...

how to get the string from dropdown list ..

Hello friends, I have this code in my controller for Index view.. public ActionResult Index(int? id) { _viewModel.ServiceTypeListAll = new SelectList(_bvRepository.GetAllServiceTypes().ToList().OrderBy(n => n.ServiceTypeName).ToList(), "ServiceTypeId", "ServiceTypeName"); return View(_viewModel); ...

How to show dropdownlist value on edit

Hello Friends, this is my Question extension to this Question.. Here I am able to add the Dropdown list value to the Grid.. perfectly.. Ex: in my Dropdownlist box I have A B C D items.. When I add any Item I am displaying the grid and I am reloading my page. My grid have two columns one is added Dropdownlist value.. other is some ...