Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 04, 2008 01:03 AM by papillonhn
0 Points
6 Posts
Jan 03, 2008 08:39 AM|LINK
It's really difficult for me to know why. Please help me.
I have a custom web control. In it's CreateChildControls(), I create a Webcontrols.Image img1 and a HtmlGenericControl("div") div1.
Problem is that:
if I add img1 into div1, when I run "start debugging" the page will automatically refresh one more time.
But If I add another div or span into div1, it won't automatically refresh one more time.
Here is code:
public class CustomeUI : WebControl,INamingContainer, ICallbackEventHandler {
protected override void CreateChildControls() {
System.Web.UI.WebControls.Image img1 = new System.Web.UI.WebControls.Image();
div1 = new HtmlGenericControl("div");
div1.Controls.Add(img1); // This is the problem. It will automatically refresh one more time when start debuging.
this.Controls.Add(div1);
}
Thanks in advance.
Jan 04, 2008 01:03 AM|LINK
Solved.
I found it. Just assign ImageUrl properties to something.
papillonhn
0 Points
6 Posts
Auto refresh page because of web custom control.
Jan 03, 2008 08:39 AM|LINK
It's really difficult for me to know why. Please help me.
I have a custom web control. In it's CreateChildControls(), I create a Webcontrols.Image img1 and a HtmlGenericControl("div") div1.
Problem is that:
if I add img1 into div1, when I run "start debugging" the page will automatically refresh one more time.
But If I add another div or span into div1, it won't automatically refresh one more time.
Here is code:
public class CustomeUI : WebControl,INamingContainer, ICallbackEventHandler
{
protected override void CreateChildControls()
{
System.Web.UI.WebControls.Image img1 = new System.Web.UI.WebControls.Image();
div1 = new HtmlGenericControl("div");
div1.Controls.Add(img1); // This is the problem. It will automatically refresh one more time when start debuging.
this.Controls.Add(div1);
}
}
Thanks in advance.
papillonhn
0 Points
6 Posts
Re: Auto refresh page because of web custom control.
Jan 04, 2008 01:03 AM|LINK
Solved.
I found it. Just assign ImageUrl properties to something.