hello,
i have listview which is connected with database table. it works fine.
i have master page and on top of master page i have bootstrap menu and when user click on menu it shows listview.
the problem is listview is always in bind mode so when user is navigating the pages listview bind and takes time to load the page.
i want listview only bind when user clickon bootstrap menu to open it.
so flow should be
1. page with boostrap menu
2. inside menu a listview should be on unbind mode
3. when user click on menu a loading image dispaly
4. then listview data show to user
so while navigating on other pages listview data should not load so it saves time of navigation.
<li>//dropdown menu is on master page and listview is also on master page. the problem
is listview is always binding and takes time to load. i want listview only binds
when user click on dropdown menu so while navigating to other page it does not time
to bind every time. it should only bind when user click on dropdown menu to view
it <a class=" dropdown-toggle top-display" id="dropdownMenu4" href="#" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="true">Messages <span class="caret"></span>
</a>
<ul class="dropdown-menu notifications" aria-labelledby="dropdownMenu4">
<div class="notification-heading">
<h4>
Notifications <small class="pull-right">//listview bind here
<asp:ListView ID="ListView1" runat="server" OnItemDataBound="ListView1_ItemDataBound"
OnItemCommand="ListView1_ItemCommand">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("chatid") %>' Visible="false"></asp:Label>
<div class="inbox">
<asp:LinkButton ID="LinkButton1" runat="server" CommandName="chat">
<div>
<h5 class="padding nomargin">
<asp:Label ID="Label2" runat="server" Text='<%# Eval("displayname") %>'></asp:Label>
<br>
<small>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("insertdate") %>'></asp:Label>
</small>
</div>
</h5>
<hr class="nomargin">
</div>
</ItemTemplate>
</asp:ListView>
//listview end here
</ul>
</li>
binding of listview method is on page load event.
Pro probydisplay = new Pro();
ListView1.DataSource = probydisplay.selectallprobydisplayname(displayname);
ListView1.DataBind();