newbie: Page_Load is fired on postback in mvp app

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?
 
M

Mr. Arnold

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.
 
J

Jeff

with string property on the view interface I assume you mean something like:
public QueryString{ get; set;} right?
 
M

Mr. Arnold

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top