Click here to Skip to main content
15,906,645 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i required string length to use in aspx page using for loop. This string length will be calculate the database values count from code behind and that value will be retrieved to aspx page for for loop condition. how to achieve this please anybody give me suggestion. But i am getting error saying: The name 'count' does not exist in the current context.

What I have tried:

<asp:UpdatePanel ID="upQuestionsAndChoiceTabPanel" runat="server">
    <ContentTemplate>
        <cc1:TabContainer ID="OnlineTestTab" runat="server" AutoPostBack="true" ActiveTabIndex="1">
            <% for (int i = 0; i < count.Length; i++)
            { %>
                <cc1:TabPanel></cc1:TabPanel>
            <%} %>
        </cc1:TabContainer>
    </ContentTemplate>
</asp:UpdatePanel>

In code behind:
public string count;
This count will bind data from database in page_load event. That count length i require anybody please help me
Posted
Updated 22-Dec-18 10:21am

1 solution

Read that editor value in a string variable and then you can find the count using string.Length property.

string test="Code Project";
int count=test.Length;
 
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