Questions tagged [webformsmvp]

WebFormsMvp is an open-source framework which supports the Model-View-Presenter (MVP) pattern on traditional WebForm-based ASP.NET Web applications.

The primary web site for this framework is at http://webformsmvp.com/. Downloads and documentation can be found there.

Many web sites and third party controls exist which support and use traditional WebForm-base ASP.NET applications. Meanwhile, the Model-View-Controller (MVC) pattern and the ASP.NET MVC framework has been preferred by many web developers for its support of separation of concerns and testability. Rather than compel developers to abandon one for the other, the WebFormsMvp framework seeks to merge the two. The Model-View-Presenter (MVP) pattern has similar characteristics to the MVC pattern.

40 questions
6
votes
1 answer

Pass runtime value to constructor using Simple Injector abd WebFormsMVP

I'm trying to combine SimpleInjector with WebFormsMvp. To facilitate DI WebFormsMvp provides the IPresenterFactory interface. It contains the Create method which provides the presenter type to resolve and the view instance. I need to inject the view…
David
  • 3,736
  • 8
  • 33
  • 52
4
votes
1 answer

How should I unit test my WebFormMVP Presenters with Moq'd Views when using the Supervising Controller Pattern

I'm trying to test a Presenter created using ASP.NET WebFormsMVP. I'm building it using a "Supervising Controller" pattern so the View is responsible for updating itself from the Model. I've simplified down the following example of a page with a…
Eoin Campbell
  • 43,500
  • 17
  • 101
  • 157
4
votes
4 answers

How do I handle postback in usercontrol from button click on MasterPage

I have usercontrol inside a webform with a MasterPage. The MasterPage has a logout button: protected void lbtnLogout_Click(object sender, EventArgs e) { FormsAuthentication.SignOut(); Roles.DeleteCookie(); …
Rich
  • 1,895
  • 3
  • 26
  • 35
4
votes
1 answer

Does anyone have an insight into ASP.NET WebFormsMVP?

Recently I ran into this open source project ASP.NET WebformsMVP. It seems like an alternative to asp.net mvc and also a quick way to introduce testability into an existing webforms applications. (without having to go through the pain of rewriting a…
Diego C.
  • 2,271
  • 2
  • 20
  • 21
4
votes
1 answer

Can I create View and Presenter in different Project in MVP Pattern

I am learning MVP pattern for my current project(Windows Application). I have good work experience in MVVM using it in Silverlight and WPF. In MVVM my view and ViewModel use to be in separate project and using the strong binding of WPF they use to…
3
votes
3 answers

MVP pattern - design question

We are trying to use the MVP pattern in our current project (asp.net app) and have run into some issues. The page has multiple sections and we are using user controls for these independant sections. Now each user control has its own view and…
jbagavathi
  • 297
  • 2
  • 6
  • 16
3
votes
1 answer

Managing ViewState in WebFormsMVP

yesterday i read a very good article about ViewState in ASP.NET. Currently we are using WebFormsMVP to allow better testability in our project. The framework does presenter binding in OnInitComplete and relies heavily on DataBind expressions e.g.…
Cubicle
  • 182
  • 1
  • 9
2
votes
1 answer

How can i do Error Handling in a MVC/MVVM Windows Form app

i'm building an application using a pattern similar to the MVC. The situation is the next: in the context of the model making changes to the associated repository. If the change throw an exception what is the correct way to present the information…
mjsr
  • 7,410
  • 18
  • 57
  • 83
1
vote
1 answer

shared presenter not working on the same page where is other control with default presenter

I have on master page four user controls which are binded to shared presenter. Now I want to add dome other user control with default presenter and I have an exception. This problem can be seen in the default sample app available in the download…
lkurylo
  • 1,621
  • 33
  • 59
1
vote
2 answers

this code takes a 2hrs to compare and sort 20,000 items each, is there a better way to write this c# code

I am trying to sort all the updated item in DataTableA, by coloring the item that has not been completely updated, and removing the item that has been updated completely from the DataTable. both The item that has been updated completely and the…
1
vote
0 answers

The MVP Pattern with presentation model

I have some questions about the MVC pattern and i am looking for feedback for what i have made. After watching a course about the MVP pattern i started to rebuild an excercise program to this pattern. I came across some problems and question while i…
Axel
  • 81
  • 2
  • 9
1
vote
0 answers

Page Url by page type

Is there any way to get the Page Url by its page type ? I'm trying to create an extension method that allows to redirect to pages using the page type instead of the URL For a page called Index.asxp I need to get "Index.aspx" by using Index class…
Massimiliano Peluso
  • 26,379
  • 6
  • 61
  • 70
1
vote
1 answer

ASP.NET : How to accept Monthly, Quarterly, Semi-Annual, Anually of Period of time using Dropdown using visual basic

Scenario. I have a dropdown list of Month(1-12) and Year (MMYYYY) format. Start Date : Month(1-12) and Year (MMYYYY) format End Date : Month(1-12) and Year (MMYYYY) format If I would select the START DATE : 10/2018 (then the start date is valid)…
Mikelemuel
  • 378
  • 1
  • 3
  • 15
1
vote
2 answers

Where to put View logic in MVP?

So I am implementing MVP in ASP.NET webforms. I need to be able to change the color of a label based on the status of some data. My first attempt: class Presenter { ... _view.IsStatusTrue = true; } class View { bool IsStatusTrue { …
drizzie
  • 3,351
  • 2
  • 27
  • 32
1
vote
2 answers

In the MVP pattern, is the presenter responsible for formatting numbers to percent?

So the presenter calls the model to get some data. That data is returned as a DTO with no formatting. Let's say the data is simply a decimal .12 Does the presenter then format the number to a percent? view.Amount = Math.Round(dto.Amount * 100, 2) +…
drizzie
  • 3,351
  • 2
  • 27
  • 32
1
2 3