Click here to Skip to main content
16,020,347 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questiondisplaying cursor wait while page load ,frameset involved Pin
333soori4-Dec-06 3:14
333soori4-Dec-06 3:14 
AnswerRe: displaying cursor wait while page load ,frameset involved Pin
Haissam4-Dec-06 3:30
Haissam4-Dec-06 3:30 
AnswerRe: displaying cursor wait while page load ,frameset involved Pin
ednrgc4-Dec-06 5:14
ednrgc4-Dec-06 5:14 
QuestionDoubts on ASP.NET compilation in 1.1 and 2.0. Pin
arunpnair4-Dec-06 2:58
arunpnair4-Dec-06 2:58 
AnswerRe: Doubts on ASP.NET compilation in 1.1 and 2.0. Pin
ednrgc4-Dec-06 3:55
ednrgc4-Dec-06 3:55 
GeneralRe: Doubts on ASP.NET compilation in 1.1 and 2.0. Pin
arunpnair4-Dec-06 19:47
arunpnair4-Dec-06 19:47 
GeneralRe: Doubts on ASP.NET compilation in 1.1 and 2.0. Pin
ednrgc5-Dec-06 1:56
ednrgc5-Dec-06 1:56 
QuestionHow do I make a server control with 2 child controls, AND design support? [modified] Pin
spazzman4-Dec-06 2:25
spazzman4-Dec-06 2:25 
I need to make a server control for controlling layout on my page. For various reasons, I don't want to use a master template, and the easiest approach is to make a server control which exposes two child controls. The content on my webpage will be added to these two exposed child controls, which in turn will be rendered surrounding by the layout HTML I need. Everything works fine, except I have no design-time support for it. In other words, I can compile the code, but I have no intellisense on in, which is a major inconvience. I've tried adding the standard attributes to the exposed properties, but I keep getting the "Content is not allowed between the opening and closing tags..." error. Can anyone tell me which attributes I need to add to my control class or its properties in order to get Visual Studio 2005 intellisense to work with the TopContent and BottomContent properties? Thanks!

// ######################################
// what the useage should look like :
// ######################################
<cc:LayoutTemplate runat="server">
<TopContent>

</TopContent>
<BottomContent>

</BottomContent>
</cc:LayoutTemplate>



// ######################################
// control definition :
// ######################################
public class LayoutTemplate : System.Web.UI.WebControls.WebControl, INamingContainer, IPostBackDataHandler, IPostBackEventHandler
{

#region FIELDS

private Control _topContent;
private Control _bottomContent;

#endregion

#region PROPERTIES

[PersistenceMode(PersistenceMode.InnerDefaultProperty),
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public Control TopContent
{
get
{
return _topContent;
}
}

[PersistenceMode(PersistenceMode.InnerDefaultProperty),
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public Control BottomContent;
{
get
{
return _bottomContent;
}
}


#endregion

#region CTORS

public LayoutTemplate(
)
: base(HtmlTextWriterTag.Div)
{
_toptContent = new Control();
_bottomContent = new Control();
this.Controls.Add(_topContent);
this.Controls.Add(_bottomContent);
}

#endregion

#region METHODS

protected override void RenderChildren(
HtmlTextWriter writer)
{

LiteralControl l = new LiteralControl(" ... top layout html here ... ");
l.RenderControl(writer);

this.TopContent.RenderControl(writer);

l = new LiteralControl(" ... middle layout html here ... ");
l.RenderControl(writer);

this.BottomContent.RenderControl(writer);

l = new LiteralControl(" ... bottom layout html here ... ");
l.RenderControl(writer);


// suppress child rendering
//base.RenderChildren(writer);
}

public void RaisePostDataChangedEvent(
)
{
}

void IPostBackEventHandler.RaisePostBackEvent(
string arg
)
{
}

public bool LoadPostData(
string postDataKey,
NameValueCollection postData
)
{
return true;
}

#endregion

}



-- modified at 8:45 Monday 4th December, 2006
AnswerRe: How do I make a server control with 2 child controls, AND design support? Pin
spazzman4-Dec-06 22:05
spazzman4-Dec-06 22:05 
QuestionText Box Problem Pin
Khan.Bangash4-Dec-06 1:35
Khan.Bangash4-Dec-06 1:35 
AnswerRe: Text Box Problem Pin
Haissam4-Dec-06 3:29
Haissam4-Dec-06 3:29 
Questionhow to display an image from datadase in a TemplateColumn Pin
rania_mansy4-Dec-06 1:34
rania_mansy4-Dec-06 1:34 
AnswerRe: how to display an image from datadase in a TemplateColumn Pin
Goalie354-Dec-06 8:22
Goalie354-Dec-06 8:22 
GeneralRe: how to display an image from datadase in a TemplateColumn Pin
rony_mansy5-Dec-06 0:58
rony_mansy5-Dec-06 0:58 
QuestionData Grid Pin
Shriya Kapoor4-Dec-06 1:27
Shriya Kapoor4-Dec-06 1:27 
AnswerRe: Data Grid Pin
_mubashir4-Dec-06 1:34
_mubashir4-Dec-06 1:34 
AnswerRe: Data Grid Pin
Khan.Bangash4-Dec-06 1:46
Khan.Bangash4-Dec-06 1:46 
AnswerRe: Data Grid Pin
saravanan054-Dec-06 10:36
saravanan054-Dec-06 10:36 
QuestionQuery String Encoding Pin
just3ala24-Dec-06 0:49
just3ala24-Dec-06 0:49 
AnswerRe: Query String Encoding Pin
Haissam4-Dec-06 0:54
Haissam4-Dec-06 0:54 
QuestionTo display Hourglass until the pages get loaded into frames Pin
333soori4-Dec-06 0:31
333soori4-Dec-06 0:31 
AnswerRe: To display Hourglass until the pages get loaded into frames Pin
Haissam4-Dec-06 0:47
Haissam4-Dec-06 0:47 
GeneralRe: To display Hourglass until the pages get loaded into frames Pin
333soori4-Dec-06 0:58
333soori4-Dec-06 0:58 
GeneralRe: To display Hourglass until the pages get loaded into frames Pin
Haissam4-Dec-06 1:04
Haissam4-Dec-06 1:04 
GeneralRe: To display Hourglass until the pages get loaded into frames Pin
333soori4-Dec-06 1:19
333soori4-Dec-06 1:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.