Newbie Question

Discussion in 'ASP .Net' started by Samuel Shulman, May 19, 2006.

  1. 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
     
    Samuel Shulman, May 19, 2006
    #1
    1. Advertising

  2. Ascx are the extensions for custom control files.

    Can you paste the markup of the repeater?

    Regards,
    Tasos
     
    Tasos Vogiatzoglou, May 19, 2006
    #2
    1. Advertising

  3. 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

    "Tasos Vogiatzoglou" <> wrote in message
    news:...
    > Ascx are the extensions for custom control files.
    >
    > Can you paste the markup of the repeater?
    >
    > Regards,
    > Tasos
    >
     
    Samuel Shulman, May 19, 2006
    #3
  4. Show us the markup for the template that gets loaded.

    --
    -Demetri


    "Samuel Shulman" wrote:

    >
    > 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
    >
    > "Tasos Vogiatzoglou" <> wrote in message
    > news:...
    > > Ascx are the extensions for custom control files.
    > >
    > > Can you paste the markup of the repeater?
    > >
    > > Regards,
    > > Tasos
    > >

    >
    >
    >
     
    =?Utf-8?B?RGVtZXRyaQ==?=, May 19, 2006
    #4
  5. Please see below:
    <font face ="Comic Sans MS" size="4" color="green"><li>

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

    </li></font>



    Thanks,
    Samuel

    "Demetri" <> wrote in message
    news:...
    > Show us the markup for the template that gets loaded.
    >
    > --
    > -Demetri
    >
    >
    > "Samuel Shulman" wrote:
    >
    >>
    >> 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
    >>
    >> "Tasos Vogiatzoglou" <> wrote in message
    >> news:...
    >> > Ascx are the extensions for custom control files.
    >> >
    >> > Can you paste the markup of the repeater?
    >> >
    >> > Regards,
    >> > Tasos
    >> >

    >>
    >>
    >>
     
    Samuel Shulman, May 20, 2006
    #5
  6. 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 ?
     
    Tasos Vogiatzoglou, May 21, 2006
    #6
  7. 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

    "Tasos Vogiatzoglou" <> wrote in message
    news:...
    > 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 ?
    >
     
    Samuel Shulman, May 22, 2006
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jerry C.
    Replies:
    8
    Views:
    263
    Uri Guttman
    Nov 23, 2003
  2. Kruno Saho
    Replies:
    0
    Views:
    157
    Kruno Saho
    Apr 7, 2013
  3. Dave Angel
    Replies:
    0
    Views:
    137
    Dave Angel
    Apr 7, 2013
  4. rusi
    Replies:
    0
    Views:
    126
  5. Miki Tebeka
    Replies:
    0
    Views:
    91
    Miki Tebeka
    Apr 7, 2013
Loading...

Share This Page