locked
Check the data RRS feed

  • Question

  • User-1687766116 posted

    Hi,

    I use bleow code to load data in button:

    Me.SqlDataSource1.SelectParameters("TopVal").DefaultValue = (Integer.Parse(Me.SqlDataSource1.SelectParameters("TopVal").DefaultValue) + 200).ToString()
    

    I want disable button when data is ended.

    Please help me,

    Monday, July 1, 2013 11:45 AM

Answers

  • User-359936451 posted

    If the records are coming from a SQL db you can use the count function to first see how many there are. Then use that value to decided when to hide your button.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 3, 2013 9:56 AM

All replies

  • User-359936451 posted

    You post doesn't make much sense, what are the requirements of your project. show more code and what type of data you are returning.

    Why are you trying to put everything in a button?

    Monday, July 1, 2013 2:22 PM
  • User-1687766116 posted

    my SqlDataSource:

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:enConnectionString %>" SelectCommand="SELECT top (@TopVal) * FROM [userpro]">
                        <SelectParameters>
                            <asp:Parameter Name="TopVal" DefaultValue="30" Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>

    and my button code is:

    Me.SqlDataSource1.SelectParameters("TopVal").DefaultValue = (Integer.Parse(Me.SqlDataSource1.SelectParameters("TopVal").DefaultValue) + 200).ToString()
    

    I use this code for loading more data . .  .

    But I want when the load all data(all records of table) finished, the button visible set to false.

    Monday, July 1, 2013 3:28 PM
  • User-359936451 posted

    Add this code to your logic after processing, where button = the name of your button control.

    button.visible = false

    Monday, July 1, 2013 4:28 PM
  • User-1687766116 posted

    I use this code for Load large data with infinite scroll

    I need similar code:

    If (all records loaded) then
    
    button1.visible=false
    
    End If

    how to check for: all records loaded?

    Monday, July 1, 2013 4:49 PM
  • User-359936451 posted

    If the records are coming from a SQL db you can use the count function to first see how many there are. Then use that value to decided when to hide your button.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 3, 2013 9:56 AM
  • User1938476581 posted

    Hi,

    Yes, I agree with mehr. In button click event you can access the count of the records and compare it with the default value to check if set button visible as false.

    Thursday, July 4, 2013 6:13 AM