Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a user control in asp.net, which is having two text scrollers within a table. Both scrollers having their own triggers. The code is given as below:

ASP.NET
 <asp:Timer runat="server" id="UpdateTimer1" interval="60000" ontick="UpdateTimer1_Tick" />
 <asp:Timer runat="server" id="UpdateTimer2" interval="60000" ontick="UpdateTimer2_Tick" />
<asp:Table ID="Table1" runat="server" Width="100%" Height="100%" GridLines="Both"
CellPadding="2" CellSpacing="2" >
   <asp:TableRow ID="TableRow1" Width="100%" Height="100%">
     <asp:TableCell ID="cellScroller1" runat="server" Width="50%" Height="100%">
        <asp:UpdatePanel runat="server" id="UpdatePanel1" updatemode="Conditional">
            <triggers>
                <asp:AsyncPostBackTrigger controlid="UpdateTimer1" eventname="Tick" />
            </triggers>
            <contenttemplate>
                <marquee onmouseover="stop();" onmouseout="start();" scrollAmount="1" scrollDelay="30" direction="up">
                    <asp:Label ID="lblTextScroller1" Runat="server" Width="100%" Height="100%" BorderWidth="1px">scoller1 text
               </marquee>
            </contenttemplate>
        
     
     <asp:TableCell ID="cellScroller2" runat="server" Width="50%" Height="100%" BorderWidth="2px">             
         <asp:UpdatePanel runat="server" id="UpdatePanel2" updatemode="Conditional">
            <triggers>
                <asp:AsyncPostBackTrigger controlid="UpdateTimer2" eventname="Tick" />
            </triggers>
            <contenttemplate>
                <marquee onmouseover="stop();" onmouseout="start();" scrollAmount="1" scrollDelay="30" direction="up">
                    <asp:Label ID="lblTextScroller2" Runat="server" Width="100%" Height="100%" BorderWidth="1px">scoller2 text
               </marquee>
            </contenttemplate>


C#
protected void UpdateTimer1_Tick(object sender, EventArgs e)
{
    //TODO
}
protected void UpdateTimer2_Tick(object sender, EventArgs e)
{
    //TODO
}

Why both the text scollers are not fully occupying their cell space area?
Posted
Comments
Mehdi Gholam 23-Sep-11 2:58am    
I believe you have a borderwidth set.

1 solution

I found the solution!

User Control Code:
ASP.NET
<asp:timer runat="server" id="UpdateTimer1" interval="60000" ontick="UpdateTimer1_Tick" xmlns:asp="#unknown" />
 <asp:timer runat="server" id="UpdateTimer2" interval="60000" ontick="UpdateTimer2_Tick" xmlns:asp="#unknown" />
<asp:table id="Table1" runat="server" width="100%" height="100%" gridlines="Both" xmlns:asp="#unknown">
CellPadding="2" CellSpacing="2" >
   <asp:tablerow id="TableRow1" width="100%" height="100%">
     <asp:tablecell id="cellScroller1" runat="server" width="50%" height="100%">
        <asp:updatepanel runat="server" id="UpdatePanel1" updatemode="Conditional">
            <triggers>
                <asp:asyncpostbacktrigger controlid="UpdateTimer1" eventname="Tick" />
            </triggers>
            <contenttemplate>
                <marquee onmouseover="stop();" onmouseout="start();" scrollAmount="1" scrollDelay="30" direction="up">
                    <asp:label id="lblTextScroller1" runat="server" width="100%" height="100%" borderwidth="1px">scoller1 text</asp:label>
               </marquee>
            </contenttemplate>
        </asp:updatepanel>
     </asp:tablecell>
     <asp:tablecell id="cellScroller2" runat="server" width="50%" height="100%" borderwidth="2px">             
         <asp:updatepanel runat="server" id="UpdatePanel2" updatemode="Conditional">
            <triggers>
                <asp:asyncpostbacktrigger controlid="UpdateTimer2" eventname="Tick" />
            </triggers>
            <contenttemplate>
                <marquee onmouseover="stop();" onmouseout="start();" scrollAmount="1" scrollDelay="30" direction="up">
                    <asp:label id="lblTextScroller2" runat="server" width="100%" height="100%" borderwidth="1px">scoller2 text</asp:label>
               </marquee>
            </contenttemplate>
        </asp:updatepanel>
    </asp:tablecell>
   </asp:tablerow>          
</asp:table>


In Default.aspx:
ASP.NET
<form id="form1" runat="server">
    <asp:scriptmanager id="ScriptManager1" runat="server" xmlns:asp="#unknown" />
        <div>        
            <asp:table id="Table2" runat="server" width="100%" height="100%" gridlines="Both" xmlns:asp="#unknown">
                    CellPadding="2" CellSpacing="2" >
                <asp:tablerow id="TableRow2" width="100%" height="100%">
                    <asp:tablecell id="TableCell1" runat="server" width="50%" height="100%">
                        <uc:webusercontrol1 id="webUserControl1" runat="server" xmlns:uc="#unknown" /> 
                    </asp:tablecell>
                </asp:tablerow>          
            </asp:table>
        </div>          
    </form></form>


Thanks! :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900