Search

You searched for the word(s): userid:834045

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)