473,574 Members | 2,639 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

placeholder in datalist

How do I replace the place holder
<asp:Content ID="content2" ContentPlaceHol derID="leaderco ntent"
runat="Server">
<asp:DataList ID="DataList2" runat="server"
OnItemDataBound = ddccd *********?????? ????
CellPadding="1"
CellSpacing="1"
RepeatColumns=" 1"
RepeatDirection ="vertical"
DataSourceID="S qlDataSource1"
Width="199px"

<ItemTemplate >
<table border="0" cellpadding="0" cellspacing="3" width="202">
<tr>
<asp:PlaceHolde r ID="PlaceHolder 1"
runat="server"> </asp:PlaceHolder >
</tr>
</table>
</ItemTemplate>

</asp:DataList>
<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:Spotbowlcom %>"
SelectCommand=" leaderBoard"
SelectCommandTy pe="StoredProce dure">
</asp:SqlDataSour ce>

</asp:Content>

void Item_Bound(Obje ct sender, DataListItemEve ntArgs e)
{
// Retrieve the Label control in the current DataListItem.

PlaceHolder PlaceHolder1 =
(PlaceHolder)e. Item.FindContro l("PlaceHolder1 ");
PlaceHolder1.Co ntrols. **********NOT SURE from here***********
StringBuilder sScript = new StringBuilder() ;
sScript.Append( "<td align=\"center\ " valign=\"middle \" width=\"30\"
height=\"20\" class=\"<%# getClass() %>\">1</td>" + "\r\n");

sScript.Append( "<td align=\"left\" valign=\"middle \" class=\"" +
mc.GetClass() + "\">“'" + advertiser + "'”</td>" + "\r\n");
return (sScript.ToStri ng());

}

Jan 22 '06 #1
0 1072

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

Similar topics

0
2457
by: CoreyMas | last post by:
Hello everyone, I am in a bit of a dilema trying to write an HTML <br> tag into a panel or placeholder. Here is the situation I have 4 tables that represent 4 levels of data (level4 is linked to a level3 etc) all the way up to a level 1
0
1130
by: Chris Ericoli | last post by:
Hi, I am wanting to add a usercontrol programatically to a placeholder's control collection. The placeholder is coded within the ITEMTEMPLATE of a datalist. The problem that I am facing, is that when I render the page, the placeholder variable (that I have declared as per the ID of the placeholder control), is throwing an error of object...
2
3051
by: Chad Crowder | last post by:
Is it possible to create a placeholder inside a template column of a datagrid? My goal is to use a placeholder, and during runtime add user controls to the placeholder as the items in the datagrid are being built. I've tried doing this with a simple link button, but I get the "Object Reference not set to an instance of an object" whenever I...
3
2478
by: Wee Bubba | last post by:
2 questions please. 1) if i make a placeholder invisible or remove it programmatically does that mean its contents wont get loaded. e.g. lets say i had a heavy datagrid within the placeholder which took a few seconds to load. if i made the placeholder invisible does that mean the grid would not get loaded at all so the page would load...
6
9573
by: Paul | last post by:
I am trying to use a DataList and the ItemTemplate. I am binding the Datalist to a SQL query that gives me a list of Items with a Parent Category. I want to loop through all the items, but only print the Parent Category once, regardless of how many child items are in it. So my perfect output would look something like:
3
10288
by: Mirek Endys | last post by:
I have DataList as part of DataList item. DataList in DataList. The parent DataList working well including Edit command, that shows Edit template and correctly bind the data into edit template (where is the child DataList).... But in case I want to make Edit in this child DataList it is not working... No edit template showed... :( this is...
4
1426
by: Dica | last post by:
i need to dynamically add a web control to a page without using placeHolder. i'm looping through all the files in a folder and creating a table row as string for each file. the contol is to be nested in that row as follows: sTblRow = "<tr><td>" + sFrom + "</td><td><asp:DropDownList id=\"lstAction_" + filename + "\"...
1
2295
by: Stuart Shay | last post by:
Hello All: I have a Datalist where each row has TextBoxes and Dropdowns that are created dynamically. The code renders correctly and is very similar to this sample I found http://www.codeguru.com/csharp/.net/net_asp/controls/article.php/c12495/ void rptFields_ItemDataBound(object sender, RepeaterItemEventArgs e) {
3
2803
by: Crazy Cat | last post by:
Hi all, I am developing an asp.net 2.0 application in Visual Studio 2005. On my page I have a simple datalist that is bound programmatically to a collection of simple objects. On this page I need to control the visibility of a textbox based on a dropdown selection in the datalist's edititem template. To do this, I registered a client script...
0
7813
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
7736
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
8106
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6461
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
5631
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
5305
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2251
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
1350
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1066
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.