Newbie Question

S

Samuel Shulman

1 What is .ascx file (is that the new .css file)

2. I added the text below the this type of file
<font face ="Comic Sans MS" size="4" color="green"><li>

<%# DataBinder.Eval(Container, "DataItem.title" ) %>

</li></font>

and I referenced (as instructed) this file as a template to a repeater
control and all I get is the actual text of the file the content of the
field with the correct formatting

Any help will be appreciated,
Samuel Shulman
SBS Tech
 
T

Tasos Vogiatzoglou

Ascx are the extensions for custom control files.

Can you paste the markup of the repeater?

Regards,
Tasos
 
S

Samuel Shulman

this is the htnl of the form

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="DynamicTemplate.aspx.vb" Inherits="EsarWeb.DynamicTemplate"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>DynamicTemplate</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:DropDownList id="DropDownList1" style="Z-INDEX: 101; LEFT: 344px;
POSITION: absolute; TOP: 24px"
runat="server" Width="152px" Height="48px"
AutoPostBack="True"></asp:DropDownList>
<asp:Repeater id="Repeater1" runat="server"></asp:Repeater>
</form>
</body>
</HTML>


and here is the code of the load event of the form:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

'Put user code to initialize the page here

If Not IsPostBack Then

DropDownList1.Items.Add("Comic")

DropDownList1.Items.Add("Professional")

End If

If DropDownList1.SelectedItem.Text = "Professional" Then

Repeater1.ItemTemplate = LoadTemplate("Professional.ascx")

ElseIf DropDownList1.SelectedItem.Text = "Comic" Then

Repeater1.ItemTemplate = LoadTemplate("Comic.ascx")

End If



SqlDataAdapter1.Fill(DataSet1)

Repeater1.DataSource = DataSet1

Repeater1.DataBind()

End Sub

Thank you indeed
Samuel
 
S

Samuel Shulman

Please see below:
<font face ="Comic Sans MS" size="4" color="green"><li>

<%# DataBinder.Eval(Container, "DataItem.title" ) %>

</li></font>



Thanks,
Samuel
 
T

Tasos Vogiatzoglou

You should put the markup at the ItemStyle tag. The databinging
expression seems fine.

If you want to use it as a user control your control must support
templating. Is this want you want ?
 
S

Samuel Shulman

I don't want to use it a User Control

I added the ItemStyle tag and still I have the same problem

Thank you for your help,
Samuel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top