We help IT Professionals succeed at work.

asp.net repeater

ITsolutionWizard
on
45 Views
Last Modified: 2017-04-25
Inside of the asp.net repeater, how can I put like <%# Left(Eval("VehicleID"),3) %>?



        <asp:Repeater runat="server" ID="classCCoachList">
            <ItemTemplate>
                <div class="property span3">
            <div class="image">
                <div class="content">
                    <a target="_blank" href="ccc.aspx?VehicleID=<%# Eval("VehicleID") %>&VID=<%# Eval("VehicleID") %>&Vname=<%# Eval("VehName")%>&Make=<%# Eval("Make") %>&Type=<%# Eval("Type") %>&Location=Stanton, CA&DailyRate=<%# Eval("DailyRate") %>" ></a>
                    <img src="http:///ccc.com//UserData/VehicleImages/<%# Eval("VehicleID") %>/medium/Primary.jpg" alt="<%# Eval("MakeModel") %>">
                </div><!-- /.content -->

                <div style="display:none;" class="price">1 250 000€</div><!-- /.price -->
                <div style="display:none;" class="reduced">Reduced </div><!-- /.reduced -->
            </div><!-- /.image -->

            <div class="title">
                <h2><a target="_blank" href="sdfgfd.aspx?VehicleID=<%# Eval("VehicleID") %>&VID=<%# Eval("VehicleID") %>&Vname=<%# Eval("VehName")%>&Make=<%# Eval("Make") %>&Type=<%# Eval("Type") %>&Location=Stanton, CA&DailyRate=<%# Eval("DailyRate") %>" >
                     <%# Eval("VehName")%>
                    </a></h2>
            </div><!-- /.title -->

            <div class="location>LA, CA</div><!-- /.location -->
            <div class="area">
                <span class="key">Price:</span><!-- /.key -->
                <span class="value"><%# Eval("DailyRate") %></span><!-- /.value -->
            </div><!-- /.area -->
            <div class="bedrooms"><div class="content">4</div></div><!-- /.bedrooms -->
            <div class="bathrooms"><div class="content">1</div></div><!-- /.bathrooms -->
        </div>
            </ItemTemplate>
        </asp:Repeater>

Open in new window

Comment
Watch Question

Ryan ChongSoftware Tead Lead / Business Analyst / System Analyst / Data Engineer / Applications Consultant
CERTIFIED EXPERT

Commented:
Inside of the asp.net repeater, how can I put like <%# Left(Eval("VehicleID"),3) %>?
You need to define a function instead.
Ryan ChongSoftware Tead Lead / Business Analyst / System Analyst / Data Engineer / Applications Consultant
CERTIFIED EXPERT

Commented:
try add this in code behind:

Public Function Left(ByVal v As String, ByVal Len As Int32) As String
        Left = v.Substring(0, Len)
    End Function

Open in new window

Author

Commented:
I use c# not vm.net
Software Tead Lead / Business Analyst / System Analyst / Data Engineer / Applications Consultant
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Ryan ChongSoftware Tead Lead / Business Analyst / System Analyst / Data Engineer / Applications Consultant
CERTIFIED EXPERT

Commented:
have you tried out the last solution posted above?
Ryan ChongSoftware Tead Lead / Business Analyst / System Analyst / Data Engineer / Applications Consultant
CERTIFIED EXPERT

Commented:
suggested solution should solved the issue.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.