Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > newbie: Page_Load is fired on postback in mvp app

Reply
Thread Tools

newbie: Page_Load is fired on postback in mvp app

 
 
Jeff
Guest
Posts: n/a
 
      07-05-2010
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
 
 
 
 
Mr. Arnold
Guest
Posts: n/a
 
      07-05-2010
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
 
 
 
 
Jeff
Guest
Posts: n/a
 
      07-05-2010
with string property on the view interface I assume you mean something like:
public QueryString{ get; set;} right?




"Mr. Arnold" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
 
Mr. Arnold
Guest
Posts: n/a
 
      07-05-2010
Jeff wrote:
> with string property on the view interface I assume you mean something like:
> public QueryString{ get; set;} right?


yes


>
>
>
>
> "Mr. Arnold" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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
 
Mr. Arnold
Guest
Posts: n/a
 
      07-06-2010

"Jeff" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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/...-postback.aspx

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Materpage page_load event fired after content page_load? rockdale ASP .Net 1 11-16-2006 06:59 PM
Why Repeater.ItemCreated is fired before Page_Load on postback Philippe Camus ASP .Net 2 03-30-2006 12:57 PM
Warning: MVP.org is not a Microsoft MVP site Larry Samuels Microsoft Certification 21 02-01-2004 09:28 PM
Re: Warning: MVP.org is not a Microsoft MVP site =?Windows-1252?Q?Frisbee=AE_MCNGP?= MCSD 5 02-01-2004 09:28 PM
Re: Warning: MVP.org is not a Microsoft MVP site =?Windows-1252?Q?Frisbee=AE_MCNGP?= MCSD 6 01-20-2004 01:02 AM



Advertisments