How can you use datalist if there is no data or the data is not enough to fill a page, and each row

Updated on technology 2024-04-14
18 answers
  1. Anonymous users2024-02-07

    I think your idea is weird! When you don't have enough data, you want to add some to fill up the number yourself, just for the sake of the interface! You can put all the data into the datatable and then calculate how many rows are less according to the pagesize, and then you can write a loop to add data to the datatable how many rows of data, and then bind the data!

    I think the method will definitely work! But I think it's unpleasant to sacrifice performance for the sake of the interface! Or you can try doing the same with CSS!

    It would be much better!

  2. Anonymous users2024-02-06

    You can add a method in your background...

    public string showrevercontent(string revercontent)

    if(<=0)

    revercontent="None";

    return revercontent;

    Then in the foreground you may be empty on that field on the binding.

    #showrevercontent(,"The name of the field").tostring())

  3. Anonymous users2024-02-05

    Since I'm afraid of destroying the style, I have to have data in it, and I'm afraid that it's not good to look at it without data, but what to show in the datalist without data depends on what lz thinks.

  4. Anonymous users2024-02-04

    What kind of pagination are you using? Is it the control that comes with it? Or do you write it yourself, or do you use a three-way control?

    You can use the three-party control aspnetpager

  5. Anonymous users2024-02-03

    Take as much as you want.

    100,000 pieces of data are also loaded at once?

  6. Anonymous users2024-02-02

    Double loop, this is simple.

    It's a bit complicated to write.

    Step 1: Put a hidden in the first loop, and the hidden value is the id, for example:

    Step 2: Very critical, after the datalist is bound, an itemDatabound event will be triggered, right-click "Properties" click on the lightning icon "select the event to see, double-click this event will automatically generate a method in the background:

    protected void datalist1_itemdatabound(object sender, datalistitemeventargs e)

    The same goes for multiple loops, and so on.

  7. Anonymous users2024-02-01

    This doesn't seem to be a way, in fact, you can consider other ways to solve this problem, datalist is a weak type, you can consider using dictionary

    Dictionarydd=new Dictionaryt: Define an entity class int: your id that defines the entity class in the datalist table

  8. Anonymous users2024-01-31

    So I made a datalist nested and noisy pants Jing Chun hunger two datalist a datalist is a radio button to put in your loop These two dlsecond and dlthird data sources are exactly the same, of course, there is a mistake Judge whether it is.

  9. Anonymous users2024-01-30

    Just write SQL statements!

  10. Anonymous users2024-01-29

    The display type of the datalist needs to be set first, and then the data must be bound.

  11. Anonymous users2024-01-28

    The datalist must have a template, and the gridview will automatically generate columns.

  12. Anonymous users2024-01-27

    This shouldn't be a problem, you can try executereader();

    See if there's anything wrong with the front desk and template columns.

  13. Anonymous users2024-01-26

    The number of records obtained in the query in CS. If the number of records is equal to zero, the datalist hides the output "No data yet".

  14. Anonymous users2024-01-25

    That's the problem with your data bonding!

    No data shows! That's probably the reason for most of it!

    No Bonding Good!

  15. Anonymous users2024-01-24

    Is your database connected?。。

  16. Anonymous users2024-01-23

    Those that use findcontrol to get out of the content plus. text, you need to put the front in parentheses

    Like what. ((label)"Country label"))text

  17. Anonymous users2024-01-22

    1. Select distinct name from users from the database aspect

    2. If the same data in your datalist is ordered (the same id together) eg: id11

    23. Use the following method (principle: the same ID is only taken once):

    for(int x = 0;x < x++)3, if the same data in your datalist is out of order (the same IDs may not be together).

    eg: id12

    31. Use the following method (here to take out the no duplicate ID as an example):

    [ Create a result object ].

    listlistresult=new list();

    [ Loop datalist ].

    for(int i = 0;i < i++)else

    [ Remove the ID from the datalist that has been added to the result object ];

    When the loop ends, the value in the listresult list is the result you wantlistresult[0]=1;

    listresult[1]=2;

    listresult[2]=3;

  18. Anonymous users2024-01-21

    It has nothing to do with datalist. Add the keyword distinct to your SQL statement.

    Select distinct name from users If you cannot change the SQL statement or the data source is not a database, you need to clean up the dataset before binding the data to the datalist, which will be more cumbersome. It involves issues such as algorithm optimization. The dumbest idea is to do a two-tier loop and compare them one by one.

    Remove the same.

    for(int x = 0; x < x++)

Related questions
7 answers2024-04-14

int sum=0;

for(int i = 0 ;i< -1;i++) assumes that the ID of the datalist is datalist1 >>>More

19 answers2024-04-14

The value of the label in the datalist is not recorded in the viewstate, so after postback, it must be found later. >>>More

11 answers2024-04-14

All mobile cards do not distinguish between 2G and 3G, as long as your mobile phone supports TD-SCDMA, any mobile card can directly use the mobile 3G network, and there is no need to open any business in the business hall, and the mobile tariff is not differentiated between 3G and 2G, and all tariffs** can be used in both 2G and 3G networks. >>>More

19 answers2024-04-14

The float switch uses the magnetic float on the switch to rise or fall with the liquid level, so that the reed switch chip at the set position in the switch detection tube moves, and sends out the contact open (off) conversion signal.

12 answers2024-04-14

As an international language, learning English requires years of perseverance to be effective. >>>More