Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Page inherting from .master - unexpected results

Reply
Thread Tools

Page inherting from .master - unexpected results

 
 
=?Utf-8?B?QXJ0?=
Guest
Posts: n/a
 
      05-26-2006
This simple code works as expected in a regular asp.net page but doesn't when
the same content is run from a page which inherited from a .master template.
I literally copied the Button and the two Label server controls (along w/ the
code) from one page to another.

In the first case Label1.Text is set in the LOAD event and stays that way
throughout subsequest postbacks BUT goes back to its defalut value (just
"Label", which was set in a designer) when executed from a page inheriting
from .master.
Can anyone point me in the right direction?

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Label1.Text = DateTime.Now.ToString();
}

}
protected void Button1_Click(object sender, EventArgs e)
{
Label2.Text = "Test";
}
 
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
Inherting classes ThatsIT.net.au ASP .Net 4 09-09-2009 12:22 AM
GridView Inherting Chuck P ASP .Net Building Controls 6 07-12-2007 09:45 AM
Inherting from object. Or not. Frans Englich Python 7 01-28-2005 11:21 AM
Unexpected performance results Dave C++ 1 04-08-2004 07:06 PM
Re: unexpected results Scott Lander Perl 0 07-07-2003 02:28 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57