Click here to Skip to main content
15,892,643 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionValidating Email without the use of regular Expression ? Pin
Rameez Raja12-Jul-11 20:14
Rameez Raja12-Jul-11 20:14 
SuggestionRe: Validating Email without the use of regular Expression ? Pin
Blue_Boy12-Jul-11 21:07
Blue_Boy12-Jul-11 21:07 
AnswerEmail validation WebService Pin
David Mujica13-Jul-11 2:52
David Mujica13-Jul-11 2:52 
QuestionXML Deserialization Pin
indian14312-Jul-11 9:58
indian14312-Jul-11 9:58 
QuestionOnFocus server side event for textbox in datagrid Pin
minckle12-Jul-11 8:53
minckle12-Jul-11 8:53 
AnswerRe: OnFocus server side event for textbox in datagrid Pin
Viral Upadhyay12-Jul-11 23:36
Viral Upadhyay12-Jul-11 23:36 
Questionresolving class using interface using UNITY container to implement ioc pattern???? Pin
siva45512-Jul-11 7:43
siva45512-Jul-11 7:43 
QuestionRepeater Control - formatting columns problem Pin
Richard Blythe12-Jul-11 6:25
Richard Blythe12-Jul-11 6:25 
I'm using a Repeater to display a list of events. Here's a stripped down version of the code:

<asp:Repeater ID="rptEvents" runat="server">
    <ItemTemplate>
        <table style="width: 100%" border="1">
            <tr>
                <td style="width: 180px; white-space: nowrap;">
                    <img align="middle" alt="Events" src="images/thumbnail.png" style="width: 50px; height: 51px" />
                    <asp:Label ID="lblEventName" runat="server"></asp:Label>
                </td>
                <td>
                    <asp:Label ID="lblDescription" runat="server"></asp:Label>
                </td>
            </tr>
        </table>
    </ItemTemplate>
</asp:Repeater>


Notice that the first column has been set to "white-space: nowrap" so that longer event names will push the column to be wider. Here's some sample html that the Repeater would generate:

<table style="width: 100%" border="1">  
<tr>  
<td style="width: 100px; white-space: nowrap;">  
<img align="middle" alt="Events" src="thumbnail.png" />  
<span id="rptEvents_ctl00_lblEventName">New Products Overview</span>  
</td>  
<td>  
<span id="rptEvents_ctl00_lblDescription">Showcases the new products the will be released this year.</span>  
</td>  
</tr>  
</table>  
 
<table style="width: 100%" border="1">  
<tr>  
<td style="width: 100px; white-space: nowrap;">  
<img align="middle" alt="Events" src="thumbnail.png" />  
<span id="rptEvents_ctl01_lblEventName">Supervisor Planning Meeting</span>  
</td>  
<td>  
<span id="rptEvents_ctl01_lblDescription">All supervisors must be present.</span>  
</td>  
</tr>  
</table>  
 
 
<table style="width: 100%" border="1">  
<tr>  
<td style="width: 100px; white-space: nowrap;">  
<img align="middle" alt="Events" src="thumbnail.png" />  
<span id="rptEvents_ctl02_lblEventName">Holiday Weekend</span>  
</td>  
<td>  
<span id="rptEvents_ctl02_lblDescription">The company will close for the week of Christmas.</span>  
</td>  
</tr>  
</table>


If and when that occurs, I want the first column in each repeater item to be the same width as the column with the longest event name.
How can I do such a task? Would I have to employ some sort of javascript?
Be nice to your kids. They'll choose your nursing home.

My Articles
   Developer's Best Friend

QuestionDeploying website on Windows XP computer? Pin
kbalias12-Jul-11 1:13
kbalias12-Jul-11 1:13 
AnswerRe: Deploying website on Windows XP computer? Pin
Pete O'Hanlon12-Jul-11 1:22
mvePete O'Hanlon12-Jul-11 1:22 
GeneralRe: Deploying website on Windows XP computer? Pin
kbalias12-Jul-11 19:44
kbalias12-Jul-11 19:44 
GeneralRe: Deploying website on Windows XP computer? Pin
Pete O'Hanlon12-Jul-11 23:25
mvePete O'Hanlon12-Jul-11 23:25 
QuestionRegex Pin
Morgs Morgan11-Jul-11 21:42
Morgs Morgan11-Jul-11 21:42 
AnswerRe: Regex Pin
Pete O'Hanlon11-Jul-11 21:50
mvePete O'Hanlon11-Jul-11 21:50 
GeneralRe: Regex Pin
Morgs Morgan11-Jul-11 22:06
Morgs Morgan11-Jul-11 22:06 
QuestionGridview merge cells with edit button Pin
C#Coudou11-Jul-11 15:11
C#Coudou11-Jul-11 15:11 
Questionpass data between different views in MVC in c#.net Pin
siva45511-Jul-11 7:12
siva45511-Jul-11 7:12 
AnswerRe: pass data between different views in MVC in c#.net Pin
Anurag Gandhi11-Jul-11 20:28
professionalAnurag Gandhi11-Jul-11 20:28 
QuestionCustom Configuration section Pin
indian14311-Jul-11 6:02
indian14311-Jul-11 6:02 
AnswerRe: Custom Configuration section Pin
GenJerDan11-Jul-11 6:11
GenJerDan11-Jul-11 6:11 
GeneralRe: Custom Configuration section Pin
indian14311-Jul-11 6:25
indian14311-Jul-11 6:25 
GeneralRe: Custom Configuration section Pin
GenJerDan11-Jul-11 6:31
GenJerDan11-Jul-11 6:31 
GeneralRe: Custom Configuration section Pin
indian14311-Jul-11 6:57
indian14311-Jul-11 6:57 
GeneralRe: Custom Configuration section Pin
GenJerDan11-Jul-11 7:14
GenJerDan11-Jul-11 7:14 
AnswerRe: Custom Configuration section Pin
Shameel11-Jul-11 21:41
professionalShameel11-Jul-11 21:41 

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.