HighTechTalks DotNet Forums  

newbie: Page_Load is fired on postback in mvp app

ASP.net ASP.net discussions (microsoft.public.dotnet.framework.aspnet)


Discuss newbie: Page_Load is fired on postback in mvp app in the ASP.net forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Jeff
 
Posts: n/a

Default newbie: Page_Load is fired on postback in mvp app - 07-05-2010 , 01:01 PM






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?

Reply With Quote
  #2  
Old   
Mr. Arnold
 
Posts: n/a

Default Re: newbie: Page_Load is fired on postback in mvp app - 07-05-2010 , 01:35 PM






Jeff wrote:
Quote:
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.

Reply With Quote
  #3  
Old   
Jeff
 
Posts: n/a

Default Re: newbie: Page_Load is fired on postback in mvp app - 07-05-2010 , 02:03 PM



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




"Mr. Arnold" <Arnold (AT) Arnold (DOT) com> wrote

Quote:
Jeff wrote:
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.

Reply With Quote
  #4  
Old   
Mr. Arnold
 
Posts: n/a

Default Re: newbie: Page_Load is fired on postback in mvp app - 07-05-2010 , 02:34 PM



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


Quote:



"Mr. Arnold" <Arnold (AT) Arnold (DOT) com> wrote in message
news:uP3YzDHHLHA.5472 (AT) TK2MSFTNGP04 (DOT) phx.gbl...
Jeff wrote:
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.


Reply With Quote
  #5  
Old   
Mr. Arnold
 
Posts: n/a

Default Re: newbie: Page_Load is fired on postback in mvp app - 07-06-2010 , 04:06 AM



"Jeff" <it_consultant1 (AT) hotmail (DOT) com.NOSPAM> wrote

Quote:
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

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.