newbie: Page_Load is fired on postback in mvp app

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

Hi

asp.net 4.0
vs2010

I'm developing an asp.net model -view-presenter, and to my surprise i see
that when I click on the linkbutton in the window the Page_Load event is
fired again. Is that normal? I'm used to webforms where we could just do a
if (!Page.IsPostBack) if statement in the Page_Load. I did that but then no
action happend when I clicked the linkbuttons in the window.

any suggestions?
 
Jeff said:
Hi

asp.net 4.0
vs2010

I'm developing an asp.net model -view-presenter, and to my surprise i see
that when I click on the linkbutton in the window the Page_Load event is
fired again. Is that normal? I'm used to webforms where we could just do a
if (!Page.IsPostBack) if statement in the Page_Load. I did that but then no
action happend when I clicked the linkbuttons in the window.

any suggestions?

I see you're using MVP based on this post. And how you would get a
string value from a Querystring to the MVP is you would have a string
property on the View Interface.

On a page event such as Page_Load, you would set the string property on
the View Interface with the Querystring value.

Then when the application access a method in the MVP, then you can get
the value for the string property on the View Interface.
 
with string property on the view interface I assume you mean something like:
public QueryString{ get; set;} right?
 
Jeff said:
Hi

asp.net 4.0
vs2010

I'm developing an asp.net model -view-presenter, and to my surprise i see
that when I click on the linkbutton in the window the Page_Load event is
fired again. Is that normal? I'm used to webforms where we could just do a
if (!Page.IsPostBack) if statement in the Page_Load. I did that but then
no action happend when I clicked the linkbuttons in the window.

http://www.eggheadcafe.com/software/aspnet/32180550/linkbutton--postback.aspx
 
Back
Top