Home
Get Started
Learn
Downloads
AJAX
MVC
Community
Wiki
Forums
Sign in
|
Join
Home
›
ASP.NET Forums
›
Search
Search
You searched for the word(s): userid:834045
More Search Options
RSS Available
Matching Posts
Re: Close browser after an alert
Thanks, I just looking for it
Posted to
Web Forms
(Forum)
by
cheng_jiawei
on 10/29/2008
Re: Problem with UserControl
It's LoadControl Source Code: 1 private Control LoadControl(IWebObjectFactory objectFactory, VirtualPath virtualPath, Type t, object [] parameters) 2 { 3 BuildResultCompiledType type = null ; 4 BuildResultNoCompileUserControl control = null ; 5 PartialCachingAttribute cachingAttribute; 6 if (objectFactory != null ) 7 { 8 type = objectFactory as BuildResultCompiledType; 9 if (type != null ) 10 { 11 t = type.ResultType; 12 Util.CheckAssignableType( typeof (UserControl), t); 13 } 14 else 15 { 16
Posted to
Web Forms
(Forum)
by
cheng_jiawei
on 10/26/2008
Re: Problem with UserControl
I Googled.... When you load a control, you do more than instantiate it.. new RegInfo();, as you know, creates a new instance of a class. Page.LoadControl also creates a new instance, but also does a lot more...such as bringing the control up to the same event life cycle. AS you can imagine, if new did this, it would be inconsitent with how new works for normal classes (simply calling the constructor...). Cheers, Karl
Posted to
Web Forms
(Forum)
by
cheng_jiawei
on 10/25/2008
Re: Problem with UserControl
:) I build a demo,and find out your problem! See my demo: You shold create usercontrol like this: Page.LoadControl() 1 protected void Page_Load( object sender, EventArgs e) 2 { 3 for ( int i = 0; i < 10; i++) 4 { 5 UserControl usercontrol = (UserControl)Page.LoadControl( "~/UserControl.ascx" ); 6 usercontrol.Name = i.ToString(); 7 this .pnlControl.Controls.Add(usercontrol); 8 } 9 } 10 1 public partial class UserControl : System.Web.UI.UserControl 2 { 3 4 private string _name; 5 6 public
Posted to
Web Forms
(Forum)
by
cheng_jiawei
on 10/25/2008
Re: Problem with UserControl
I think you'd better Add your UserControls in Panel Control(Server),just try. I think your coding is ok, but if you want to click the link button in your controls ,it will be post back. :)
Posted to
Web Forms
(Forum)
by
cheng_jiawei
on 10/25/2008
Re: Problem with UserControl
I think the problem is that :where and when you created your UserControls? Just as you see, everytime you postback your page,the UserControls that your added are completed lost(So is null). Yet,I got that problems before. I think it's better to create Client Controls instead of UserControl in the server. Or you have to create the UserControls everytime In the Page_Load event :) Hope that help~
Posted to
Web Forms
(Forum)
by
cheng_jiawei
on 10/24/2008
Page 1 of 1 (6 items)
Channel 9:
Ping 42: Is Microsoft cool? Photo DNA, Win7 tool, 10k MIX contest
Channel 9:
Jafar Husain: Silverlight Toolkit and Rx, Part 1
Channel 9:
Francesco Logozzo - Static Checking with Code Contracts for .NET
Channel 9:
Channel 9 Live at PDC09: Doug McCuistion, NASA
TechNet Edge:
System Center Operations Manager 2007 R2 – Service Level Dashboard part 3: Configuration
Channel 9:
Reading Debate with Bill Buxton
Channel 10:
Reading Debate with Bill Buxton
WindowsClient:
Build WPF Data Controls for Outlook Addins Easily with VS2010
Channel 9:
Channel 9 Live at PDC09: .Net Rocks Part 2
Channel 9:
Channel 9 Live at PDC09: .Net Rocks Part 1
Channel 9:
Channel 9 Live at PDC09: Wei Zhu (Facebook)
WindowsClient:
WPF Manipulation Basics
ASP.NET:
High CPU in .NET app using a static Generic.Dictionary
TechNet Edge:
Deploying Silverlight - Why and How
WindowsClient:
Windows Client Developer Roundup for 12/21/2009
IIS.NET:
SiteShell
Silverlight:
4 Calendars & Plans for 2010 / 5770
ASP.NET:
ASP.NET MVC 2 and Visual Studio 2010
ASP.NET:
Moving your ASP.NET Application to Windows Azure – Part II
Silverlight:
HVP – Core Scaffolding and Updated News
Microsoft Communities
ASP.NET
Channel 8
Channel 9
Channel 10
IIS.NET
Silverlight
TechNet Edge
WindowsClient
Mix Online