Sunday, August 2, 2009

Dynamically Loaded Controls Disappear ASP.Net C#

I have been working with dynamically loaded Web User Controls.

However,I just found that they disappear after a postback... The basic solution is to reload them after postback.

Oh well...

Related articles (with info/tips/code):

[Telerik has good tips on using viewstate to help]

http://www.telerik.com/help/aspnet/ajax/ajxloadusercontrols.html


http://aspnet.4guysfromrolla.com/articles/092904-1.aspx

http://weblogs.asp.net/infinitiesloop/archive/2008/04/23/truly-understanding-dynamic-controls-by-example.aspx

Javascript Cross Browser Back Method

I have been working on a quick CROSS browser "back" method in JavaScript. It is really simple...

The history.go(-1) only worked well in IE. This double method worked well in IE, Firefox and Chrome. It checks if it knows how to do the "referrer" method. If not... it uses the history.go


[a href="#" onclick="if(document.referrer) {window.open(document.referrer,'_self');} else {history.go(-1);} return false;"]continue shopping[a]

Of course, you should use a "<" instead of "[" ... Blogger had issues when I posted the full link.