473,569 Members | 2,536 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to embed one control within another?

Sky
What I have currently:
I have a user control called mod_container.a spx that is basically two
divs -- the top a toolbar, that expands/collapse the second div which can
contain other modules/controls (eg a newsfeed, quick phonelist, login, etc.)

But the controls end up too 'deep': it appears that it would be
lighter/better if I could just enherit the uc_login.aspx directly off of the
uc_container.as px so that all modules have the same look/feel in terms of
perimeter...

But -- and my question -- if you enherit one user control from another the
first uc_controls html is never used -- it just reads the second/descendants
html...and therefore, no container wrapper html appears...

How would I do this?

One direction I've looked is to somehow take the uc_login.aspx's html, and
before rendering it, somehow inject above it the html of the container (the
two divs...) and then moveNode(deep) the whole original structure into
it....
Sounds heavy and not clean so am suspicious of it... Secondly -- I only
found a way to get a handle on sub-controls...not plain old html elements.
Any ideas?

Nov 18 '05 #1
7 2324
Hi,

you are trying to implement visual inheritance which isn't support by
ASP.NET. but, you still can create your own base class that inherit from
UserControl, override the render method and add HTML. every usercontrol
that will inherit from your UserControl will embed the base usercontrol
class HTML.

public class MyUserControl : System.Web.UI.U serControl
{
public MyUserControl() : base()
{
//
// TODO: Add constructor logic here
//
}
protected override void Render(System.W eb.UI.HtmlTextW riter writer)
{
writer.Write("< b> Base Class Text </b>");
base.Render (writer);
}

}

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2
Sky
Dear Natty:
Thanks for the answer -- I think I see what you are getting at -- but for
verification -- at what point does the Render() function draw it's sub
Controls, and can this be controlled?

In other words how do I ensure this behaviour:
protected override void Render(System.W eb.UI.HtmlTextW riter writer)
{
writer.Write("< div id=OuterDiv>");
writer.Write("< div id=Header>My Container Header</div>");
writer.Write("< div id=Stuff>");
//-------------------------------------------------
//Now render all sub controls within this second div...
//Does one loop through it's children like this:
//[bad proxycode but I hope you see what I mean]
while (i=0;i<this.Con trols.length;i+ +){this.Control s[i].Render();}
//-------------------------------------------------
writer.Write("</div>");
writer.Write("</div>");
base.Render (writer);
}
An important point: this manual manipulation of controls -- does it wig out
the Control tree so that click events stop working, and viewstate gives up?
I've seen that
happen in my forays -- can't remember what caused it -- but it seems that
sometimes if you manipulate the Control tree too hard, MS can't figure out
what control is what
and stops tracking it -- or gives errors.
Oh! Did you see my previous question in this thread just before this one?
I've tried to make enherited controls -- I've made one user control called
'base' and then
a second one that enherits from it in the *.cs file -- and it holds together
at run time. But ever time I try to open and close the second usercontrol is
states that it can't find
all the pieces... ever seen such behaviour and know the cause/solution?

"Natty Gur" <na***@dao2com. com> wrote in message
news:ub******** ******@TK2MSFTN GP09.phx.gbl...
Hi,

you are trying to implement visual inheritance which isn't support by
ASP.NET. but, you still can create your own base class that inherit from
UserControl, override the render method and add HTML. every usercontrol
that will inherit from your UserControl will embed the base usercontrol
class HTML.

public class MyUserControl : System.Web.UI.U serControl
{
public MyUserControl() : base()
{
//
// TODO: Add constructor logic here
//
}
protected override void Render(System.W eb.UI.HtmlTextW riter writer)
{
writer.Write("< b> Base Class Text </b>");
base.Render (writer);
}

}

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #3
Hi again,

Yes you can achieve it. but you need to use Controls Addat method to
place your code in front of the derived control code :

protected override void Render(System.W eb.UI.HtmlTextW riter writer)
{
System.Web.UI.H tmlControls.Htm lGenericControl oGen = new
System.Web.UI.H tmlControls.Htm lGenericControl ();
oGen.InnerHtml = "Start <br/>";
this.Controls.A ddAt(0,oGen);

// the control data will render here

base.Render (writer);
writer.Write("< br/><b> End Base Class Text </b>");

}
2) I don't see any reason for server side events to stop working.

3) I try it out on my machine (VS 2003) and it working.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #4
Sky
Dear Natty:
Uh...still missing that "little something before it goes Click! in the
brain....(I might need to change my coffee brand!)

a) I have an *.cs base class that is called uc_mod_containe r.cs The ascx
part of the file is never going to be used so any html I put here with the
IDE will be never seen. That I get. So we will be doing the HTML stuff in
it's Render() event. Get that, I think.

b) I have a *.cs enherited class that is called uc_mod_phonelis t.aspx that
we want to be a standalone app that can be wrapped by different wrappers
(therefore enherit from different uc_mod_containe r.cs depending on
project)...

d) Because uc_mod_phonelis t.aspx does not have an explicit Render() command
it reverts to base.Render() (the uc_mod_containe r.cs) which starts drawing
divs everywhere -- and then injects the controls into it.

In other words:
uc_mod_phonelis t.aspx would have already content that looks (proxy) like:

<div><hr/><br/><datagrid runat=server/><etc.><other simple html tags that
are not controls....></div>

and we have to wrap it all up so that the final output looks like

<div id=outer><div id=header>Click here to expand/collapse second
div</div><div>{all the html and controls shown above}</div></div>
BUT (and my question):
The code you demonstrated would inject any SubControls we may have injected
into uc_phonelist (as I see it only the datagrid qualifies as a
control)...this doesn't address the HTML that's already there and that we
already put into the uc_phonelist.as px via the IDE. Or does it? These html
elements are not Controls, but are just [what?]. Plus they already there, so
AddAt would duplicate them if we doing something like that, right?

Second nagging question: If uc2 is enherited from uc1 -- so they are the
SAME control, no? SubControl of uc1 is NOT uc2? Correct?
Sorry for being such a gormless twit/slowwwww at understanding this
morning...
but don't give up on me: your help is really invaluable, and I'm pretty sure
we are nearly there...

Best,
Sky


"Natty Gur" <na***@dao2com. com> wrote in message
news:eQ******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi again,

Yes you can achieve it. but you need to use Controls Addat method to
place your code in front of the derived control code :

protected override void Render(System.W eb.UI.HtmlTextW riter writer)
{
System.Web.UI.H tmlControls.Htm lGenericControl oGen = new
System.Web.UI.H tmlControls.Htm lGenericControl ();
oGen.InnerHtml = "Start <br/>";
this.Controls.A ddAt(0,oGen);

// the control data will render here

base.Render (writer);
writer.Write("< br/><b> End Base Class Text </b>");

}
2) I don't see any reason for server side events to stop working.

3) I try it out on my machine (VS 2003) and it working.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #5
Sky
To expand on the last entry -- what I was saying is that (after I type it
all up, I get the following...and it "don't look right..."):

Trying to make the code as clear as possible here:

protected override void Render(System.W eb.UI.HtmlTextW riter writer)
{

//Preamble:

//We are inside of uc_mod_base.cs here...

//at the top of the page there are the following protected vars:

//protected System.Web.UI.W ebControls.Imag eButton ID_ExpandBtn;

//protected System.Web.UI.W ebControls.Imag eButton ID_EditBtn;

//Declare local vars:

System.Web.UI.H tmlControls.Htm lGenericControl oDivOuter;

System.Web.UI.H tmlControls.Htm lGenericControl oDivUpper;

System.Web.UI.H tmlControls.Htm lGenericControl oDivLower;

System.Web.UI.H tmlControls.Htm lTable oTable;

System.Web.UI.H tmlControls.Htm lTableRow oRow;

System.Web.UI.H tmlControls.Htm lTableCell oCell;

System.Web.UI.W ebControls.Imag eButton oImg;

//Create the Outer div, that will contain two inner divs:

oDivOuter = new System.Web.UI.H tmlControls.Htm lGenericControl ();

oDivOuter.TagNa me = "div";

this.Controls.A dd(oDivOuter);

//Create the Upper-Inner div that will contain a table

//to hold icons, and container "Toolbar/Title"

oDivUpper = new System.Web.UI.H tmlControls.Htm lGenericControl ();

oDivUpper.TagNa me = "div";

oDivUpper.ID = "ID_Header" ;

oDivUpper.Attri butes.Add("clas s","HEADER GRADIENT");

oDivOuter.Contr ols.Add(oDivUpp er);
oTable=new System.Web.UI.H tmlControls.Htm lTable();

oTable.ID="ID_S ubjectRow";

oDivUpper.Contr ols.Add(oRow);

oRow = new System.Web.UI.H tmlControls.Htm lTableRow();

oTable.Rows.Add (oRow);

oCell = new System.Web.UI.H tmlControls.Htm lTableCell();

oCell.Attribute s("style","marg in:0;padding:0; width:1;");

oRow.Cells.Add( oCell);

//Put the Expand/Collapse Icon in cell 1:

oImg = ID_ExpandBtn = new System.Web.UI.W ebControls.Imag eButton();

oImg.ID = "ID_ExpandB tn";

oImg.Click += OnClick_ExpandM e;

//How do I do this? oImg.AutoPostBa ck = ???

oImg.Attributes .Add("style","c ursor:hand;widt h:16px;height:1 6px;margin:0;pa d
ding:0;margin-left:4px;border :0;");

oImg.Attributes["title"]= this._UID + ":" +
"Expanded:"+thi s._Vars.Expande d.ToString();

if (!this._Vars.Ex panded)

{

ID_ExpandBtn.Im ageUrl =
XLib.Resources. cImages.ICON_NA V2_RIGHT(XLib.E nums.eImgPathTy pe.URL);

}

else

{

ID_ExpandBtn.Im ageUrl =
XLib.Resources. cImages.ICON_NA V2_DOWN(XLib.En ums.eImgPathTyp e.URL);

}

oRow.Controls.A dd(oImg);

//Put the Container's Title in Cell2:

oCell = new System.Web.UI.H tmlControls.Htm lTableCell();

oCell.InnerHtml = this.Subject; //Set text of Container TitleBar

oRow.Cells.Add( oCell);

//Put the Edit Button in Cell3:

oCell = new System.Web.UI.H tmlControls.Htm lTableCell();

oCell.InnerHtml = this.Subject; //Set text of Container TitleBar

oCell.Attribute s.Add("style"," margin:0;paddin g:0;width:1;");

oCell.Visible = this._Vars.Edit able;

oRow.Cells.Add( oCell);
oImg = ID_EditBtn = new System.Web.UI.W ebControls.Imag eButton();

oImg.ID = "ID_EditBtn ";

oImg.Click += OnClick_EditMe;

oImg.Attributes .Add("style","w idth:16px;heigh t:16px;margin:0 ;padding:0;marg i
n-left:4px;border :0;");

if (this._Vars.Edi table)

{

ID_EditBtn.Imag eUrl =
XLib.Resources. cImages.ICON_ED IT(XLib.Enums.e ImgPathType.URL );

ID_EditBtn.Attr ibutes["title"]= "Edit this Control";

}

oCell.Controls. Add(oImg);

//Move on to the Inner-Bottom Div -- in which we want to inject sub
controls...

oDivLower = new System.Web.UI.H tmlControls.Htm lGenericControl ();

oDivLower.TagNa me = "div";

oDivLower.ID = "ID_Data";

oDivOuter.Contr ols.Add(oDivLow er);

//Close with a break so that each control lines up vertically within the
uc_page_panel.a scx

oBR = new System.Web.UI.H tmlControls.Htm lGenericControl ();

oBR.TagName = "br";

oDivOuter.Contr ols.Add(oBR);

//All done, except that I STILL have not injected the HTML of the the
module_phoneboo k.ascx page

//within this code:

//MAKES NO SENSE!!!

//oDivLower.Contr ols.AddAt(0,thi s);

//But if I use the Write() function that was mentioned, none of the event
wiring that I just

//did above will work, right?

//To get wireup controls, you do have to add them control by control - you
can't just add a

//Write() and expect it to work, no?

//writer.Write ("<div id=ID_Data runat=server onclick='ID_Dat a_Click'>);

//this.Controls.A ddAt(0,oGen);

//base.Render (writer);

//writer.Write ("</div>);

}









"Natty Gur" <na***@dao2com. com> wrote in message
news:eQ******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi again,

Yes you can achieve it. but you need to use Controls Addat method to
place your code in front of the derived control code :

protected override void Render(System.W eb.UI.HtmlTextW riter writer)
{
System.Web.UI.H tmlControls.Htm lGenericControl oGen = new
System.Web.UI.H tmlControls.Htm lGenericControl ();
oGen.InnerHtml = "Start <br/>";
this.Controls.A ddAt(0,oGen);

// the control data will render here

base.Render (writer);
writer.Write("< br/><b> End Base Class Text </b>");

}
2) I don't see any reason for server side events to stop working.

3) I try it out on my machine (VS 2003) and it working.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #6
Hi,

e-amil me and i'll return a demo project ....

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #7
Sky
Hi Natty:
Was able to analyse your code, and I do understand the notion of injecting
prefix and suffix code around the base.Render(wri ter); statement.

But that -- although simple enough to accomplish -- completly destroys any
chance of injecting working buttons above and below.

What I am saying is that what I would like to accomplish is the following:

writer.Write("< div stuff above the enherited controls/><asp:button
runat=server onClick=ClickMe ......./>");
base.Render(wri ter);
writer.Write("< asp:button runat=server... ../></div>");

but obviously since these were injected after InstantiateCont rols(), they
are completly 'dead'.
They appear as buttons (maybe) but have never been delegated back to the
forms attached ClickMe1() event...
Parts of the puzzle that I have figured out to doing this include the
following steps...

Create and instantiate controls dynamically within the OnInit() event so
that later InstantiateCont rols() wires them up correctly to be
parts of the webform's visualstate,etc . wiring.

Just before getting out of OnInit() -- one has to move the descendant
Controls INTO the container we want -- by a combination of
Remove() and AddAt().

So far so good. If we stopped here, we would have mostly all the parts of
visual enheritence.

The only problem is that any controls created dynamically in the descendant
control -- such as the TextBox control you created in the descendant's
OnLoad() -- would not exist at this point, and therefore could not be moved
into place...

So, in the Render() event we have to repeat the Remove/AddAt process
here...(for some reason, it doesn't work at all if you don't do the
Add/Remove
loop in the OnInit()...noth ing shows up on page).
At this point with the base classes code below, I have got the controls to
show up in the right place -- and correctly wired...but...w ell...I'm not
satisfied.

"What?! It works! Move on!" Yeah...well...t rue...but I don't understand
really why it works. Which means that I will lose a ton of time again on
another
project, repeating all my mistakes...etc.
So I have two questions.
a) In the OnInit() event, when I've created all the new controls dynamically
BUT NOT ADDED them to the page -- and you have only one DropDownList
in yours, does it report that Controls.Count = 2??? More disturbing, if you
look at their ID's..why are they BOTH THE SAME element?!?!

b) Why does this solution fail if I do not do the Loop/AddAt() -- to move
the children controls into the right location -- in BOTH OnInit and later
Render().
It appears to me that it should work fine if I just put it in the Render()
event. no?

c) And how could I improve the loop mechanism? In other words -- if class b
enherits from a -- is there any way that I can distinguish a.class[0] as
being from a rather than b? "wot?!" ...I think if you look at the loop you
will understand:

for (int i=(Controls.Cou nt-1);i>-1;i--)

{

tC = Controls[i];

if ((tC != ID_DivOuter) && (ID_DivLower.Co ntrols.Contains (tC)==false))

{

try

{

// Controls.Remove (tC);

ID_DivLower.Con trols.AddAt(0,t C);

}

catch {

s = "SHIT! " + tC.GetType().To String();

}
}

}



Ok. The full class that works...but still puzzles me, is here:

namespace WebApplication3

{

using System;

using System.Data;

using System.Drawing;

using System.Web;

using System.Web.UI.W ebControls;

using System.Web.UI.H tmlControls;

/// <summary>

/// Summary description for baseUC.

/// </summary>

public class baseUC : System.Web.UI.U serControl

{

private System.Collecti ons.ArrayList _SubControls;

protected System.Web.UI.W ebControls.Imag eButton ID_ExpandBtn;

protected System.Web.UI.H tmlControls.Htm lGenericControl ID_DivOuter;

protected System.Web.UI.H tmlControls.Htm lGenericControl ID_DivUpper;

protected System.Web.UI.H tmlControls.Htm lGenericControl ID_DivLower;

public bool Expanded = true;

public bool Editable = true;

public string BgColor="";

public string Header="";

public string Subject="";

public string Body = "";

public System.Collecti ons.ArrayList SubControls = new
System.Collecti ons.ArrayList() ;

public System.Web.UI.C ontrol SubControl = null;

public string SubControlSrc=" ";



private void Page_Load(objec t sender, System.EventArg s e)

{

// Put user code to initialize the page here

if (Session[this.UniqueID + "Expanded"]==null){Session[this.UniqueID +
"Expanded"] = Expanded;}

Expanded = (bool)Session[this.UniqueID + "Expanded"];

}

#region Web Form Designer generated code

override protected void OnInit(EventArg s e)

{

//Because the *.ascx file will be ignored, and therefore any and all

//html elements put here, this base classe's html and buttons need to

//created dynamically here:

//Another point: it needs to be created Here -- because if you make and
inject

//them into the page after InitializeCompo nent runs, you will get buttons --
but

//they won't be wired up into the event handling so are useless.

//Preamble:

//at the top of the page there are the following protected global vars

//so that Render event can re-access what is created here:

//protected System.Web.UI.W ebControls.Imag eButton ID_ExpandBtn;

//protected System.Web.UI.H tmlControls.Htm lGenericControl ID_DivOuter;

//protected System.Web.UI.H tmlControls.Htm lGenericControl ID_DivUpper;

//protected System.Web.UI.H tmlControls.Htm lGenericControl ID_DivLower;

//Declare local vars:

System.Web.UI.H tmlControls.Htm lGenericControl oDivOuter;

System.Web.UI.H tmlControls.Htm lGenericControl oDivUpper;

System.Web.UI.H tmlControls.Htm lGenericControl oDivLower;

System.Web.UI.H tmlControls.Htm lTable oTable;

System.Web.UI.H tmlControls.Htm lTableRow oRow;

System.Web.UI.H tmlControls.Htm lTableCell oCell;

System.Web.UI.W ebControls.Imag eButton oImg;

System.Web.UI.H tmlControls.Htm lGenericControl oBR;

System.Web.UI.C ontrol tC;

string s;
//Create the Outer div, that will contain two inner divs:

oDivOuter = ID_DivOuter = new
System.Web.UI.H tmlControls.Htm lGenericControl ();

oDivOuter.TagNa me = "div";

oDivOuter.ID = "DivOuter";

//Create the Upper-Inner div that will contain a table

//to hold icons, and container "Toolbar/Title"

oDivUpper = new System.Web.UI.H tmlControls.Htm lGenericControl ();

oDivUpper.TagNa me = "div";

oDivUpper.ID = "ID_DivUppe r";

oDivUpper.Attri butes.Add("clas s","HEADER GRADIENT");

oDivOuter.Contr ols.Add(oDivUpp er);
oTable=new System.Web.UI.H tmlControls.Htm lTable();

oTable.Border = 1;

oTable.ID ="TheTable";

oTable.Style.Ad d("width","100% ");

oTable.Style.Ad d("background-color","#A0FFA0 ");

oDivUpper.Contr ols.Add(oTable) ;

oRow = new System.Web.UI.H tmlControls.Htm lTableRow();

oRow.ID = "TheRow";

oTable.Rows.Add (oRow);

oCell = new System.Web.UI.H tmlControls.Htm lTableCell();

oCell.Attribute s.Add ("style","margi n:0;padding:0;w idth:1;");

oCell.ID = "TheCell";

oRow.Cells.Add( oCell);

//Put the Expand/Collapse Icon in cell 1:

oImg = ID_ExpandBtn = new System.Web.UI.W ebControls.Imag eButton();

oImg.ID = "TheImg";

oImg.ID = "ID_ExpandB tn";

ID_ExpandBtn.Cl ick += new System.Web.UI.I mageClickEventH andler
(OnClick_Expand Me);

oImg.Attributes .Add("style","c ursor:hand;widt h:16px;height:1 6px;margin:0;pa d
ding:0;margin-left:4px;border :0;");

oImg.Attributes["title"]= "Expanded:"+Exp anded.ToString( );

oCell.Controls. Add(oImg);

//Put the Container's Title in Cell2:

oCell = new System.Web.UI.H tmlControls.Htm lTableCell();

oCell.InnerHtml = this.Subject; //Set text of Container TitleBar

oRow.Cells.Add( oCell);

//Move on to the Inner-Bottom Div -- in which we want to inject sub
controls...

oDivLower = ID_DivLower = new
System.Web.UI.H tmlControls.Htm lGenericControl ();

oDivLower.TagNa me = "div";

oDivLower.ID = "ID_DivLowe r";

oDivLower.Style .Add("backgroun d-color","#A0A0FF ");

oDivLower.Inner Text = "This is the lower div... where the controls should
end up!";

oDivOuter.Contr ols.Add(oDivLow er);

//Close with a break so that each control lines up vertically within the
uc_page_panel.a scx

oBR = new System.Web.UI.H tmlControls.Htm lGenericControl ();

oBR.TagName = "br";

oBR.ID = "TheBR";

oDivOuter.Contr ols.Add(oBR);

int tTest = Controls.Count;

//WHY is tTEST=2 ??? I only have one enherited control visible from this
page at this point

//in time. Plus! both appears to be the same control...

for (int i=0;i<Controls. Count;i++)

{

tC = Controls[i];

s=(tC.ID);

}

//Move any controls already created in children into this component...

//***DESIGN FLAW***:

//But if you do it here, you won't catch any controls dynamically injected

//later by descendant control

//One other point. It's wierd, but if you remove this code, and rely on
doing

//it all in the Render() event -- you won't get squat. It seems you have to

//do it in 2 'halves'...one here, one repeat job in Render()

int iMax = Controls.Count -1;

for (int i=iMax;i>-1;i--)

{

tC = Controls[i];

//Remove from Controls -- and inject into one only:

// this.Controls.R emove(tC);

ID_DivLower.Con trols.AddAt(0,t C);

}

this.Controls.A dd(oDivOuter);

//

// CODEGEN: This call is required by the ASP.NET Web Form Designer.

//

InitializeCompo nent();

base.OnInit(e);

}
/// <summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

/// </summary>

private void InitializeCompo nent()

{

this.Load += new System.EventHan dler(this.Page_ Load);

// this.PreRender += new System.EventHan dler(this.Page_ PreRender);

}

public void OnClick_ExpandM e(object sender,
System.Web.UI.I mageClickEventA rgs e)

{

Expanded = ! Expanded;

Session[this.UniqueID + "Expanded"] = Expanded;
}

private void Page_PreRender( object sender, System.EventArg s e)

{
}

protected override void Render(System.W eb.UI.HtmlTextW riter writer)

{

//We 'could' use the PreRender event to do this -- but then we would have to
wire in

//all descendant controls to point to it?

if (Expanded)

{

ID_ExpandBtn.Im ageUrl =
"http://localhost/xlib/xlib_graphics/btn13/btn13_arrow_1a_ down.gif";

ID_DivLower.Sty le["display"] = "inline";

}

else

{

ID_ExpandBtn.Im ageUrl =
"http://localhost/xlib/xlib_graphics/btn13/btn13_arrow_1a_ right.gif";

ID_DivLower.Sty le["display"] = "none";

}

System.Web.UI.C ontrol tC;

string s = "";

for (int i=(Controls.Cou nt-1);i>-1;i--)

{

tC = Controls[i];

if ((tC != ID_DivOuter) && (ID_DivLower.Co ntrols.Contains (tC)==false))

{

try

{

// Controls.Remove (tC);

ID_DivLower.Con trols.AddAt(0,t C);

}

catch {

s = "ERROR! " + tC.GetType().To String();

}
}

}

/*

* MS SaMPLE:

if (HasControls()) {

for (int i=0; i < Controls.Count; i++) {

Controls[i].RenderControl( writer);

}

}

*/

base.Render(wri ter);

}

#endregion

}

}












"Natty Gur" <na***@dao2com. com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Hi,

e-amil me and i'll return a demo project ....

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5415
by: François de Dardel | last post by:
Please don't scream that EMBED is evil ! What I am doing is <EMBED SRC="BWV659.mid" AUTOSTART="false" LOOP="TRUE" CONTROLS="SMALLCONSOLE" WIDTH="50" HEIGHT="15" TITLE="BWV 659"> Note the AUTOSTART="false"... In the good old days of Netscape 3 or so, just <A HREF="BWV659.mid">Musique</A> would open a small console in the active page...
1
5401
by: Mehr H | last post by:
I've been trying to figure out how i can embed a Windows.Forms.ProgressBar in my webform (aspx) file. I have tried putting a Windows.Forms.ProgressBar as public on a regular winform designer form (form called ProgressForm) and the built the dll. Then I reference this new assembly from within my asp.net applicaiton and tried to access...
2
2057
by: Romantschik | last post by:
Hi guys, i searched the web for a tutorial of embedding a datagrid control within an iframe. But I didn't find any tutorials. Can somebody help me or give me some short code. Programming language is C#. Any suggestions for me?
1
3431
by: snicks | last post by:
I have a series of XLS files which I need to embed into a PowerPoint presentation on an IIS server. I’ll be using VB.NET. I’ve tried using an ASPOSE.PowerPoint control to do this and it does partially work. The problem is that when I embed the XLS files PowerPoint is not running and has no way of capturing the XLS image and embedding it...
3
4343
by: ShaunO | last post by:
I am looking to embed an application into my c# Application. (Google Earth for reference) It does not appear to have an OLE interface. I want to use it on a panel within my application thus allowing me to add my own customised tool bar etc. Does anyone have any suggestions on how to best acheive this goal?
1
2972
by: Andrew Poulos | last post by:
With "normal" SWF HTML there's an EMBED tag nested within an OBJECT tag. How can I check which tag is actually displaying the SWF? I'm using CSS on them and the style on the OBJECT affects the EMBED tag so I'm going to use some code to correct it but I can't tell which tag is responsible for the display. Andrew Poulos
1
2092
by: Udi | last post by:
Hi All, I need to embed the ethereal process inside my .NET app. ( http://www.ethereal.com ) I assume the best solution would be getting hands on the ethereal main window form and host it in my app. (BTW - unmanaged code...) However, I'm not sure how easy it is or even if its possible, so I was thinking about launching the ethereal process...
14
1895
by: jim | last post by:
OK...Don't ask why - it'll just make ya mad. It makes me mad just thinking about it. I swear....if I didn't need this job, I'd tell 'em where to embed their webbrowser control. But, since I do need it, here are my questions... Can I embed an IE activex control in a webpage? I basically would like to be able to embed the same component...
0
1525
by: VigneshS | last post by:
Hi, I am a newbie to Globalization and Localisation Concepts. I tried almost all the methods of the Globalization concepts. But i cannot be able to embed a text file within a Resource. My need is to open a solution programmatically, select a Project within, and get a source resource file. Then, select a number of cultures and create...
0
7700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7614
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.