Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

Weird Literal rendering behavior

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Scott L - 19 Mar 2008 19:46 GMT
I have a button and a literal on my page (among other things but *I think*
this functionality is pretty much isolated).

1. In Page_Init I set literal.Text = "PAGEINIT"

2. In the button's click method I set literal.Text = "BUTTONCLICKED"

3. In Page_PreRender I verify that literal.Text == "BUTTONCLICKED" after
clicking the button.

4. As soon as I step out of Page_PreRender the page is rendered with
literal.Text == "PAGEINIT"

If I specifically set literal.Text = "MANUALLYSET" in Page_PreRender, then
literal.Text == "MANUALLYSET" when the page renders.  I'm stumped.  Why is
the Text set in the button's click method carried through to Page_PreRender
but then not rendered in the browser?  Why does manually setting the value in
Page_PreRender work when the value that is in literal.Text at the time of
Page_PreRender is ignored?

Any help is greatly appreciated as I'm about to lose it...
Peter Bromberg [C# MVP] - 20 Mar 2008 02:04 GMT
Scott,
This really belongs in the asp.net newsgroup, not the "C# Language" group.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net

> I have a button and a literal on my page (among other things but *I think*
> this functionality is pretty much isolated).
[quoted text clipped - 17 lines]
>
> Any help is greatly appreciated as I'm about to lose it...
Scott L - 20 Mar 2008 09:06 GMT
You're right, my bad.  If anyone cares, it turns out that implementing a
partial page update in ASP.NET webforms can cause unexpected behavior in
unrelated parts of the page.  Lame.

> Scott,
> This really belongs in the asp.net newsgroup, not the "C# Language" group.
[quoted text clipped - 24 lines]
> >
> > Any help is greatly appreciated as I'm about to lose it...

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.