asp.net session
Date: 01/18/06
(Asp Dot Net) Keywords: css, asp
below is the code to run my searcg stored procudure i need
to find a way to add in the variable TotalRecordCount into
the dgResultset dataset so i can call it into the datalist
that corrosponds to dgResultset. If there is an easier way
of doing it i'd be interested.
Cheers
' Runs the search in the DB for the relevant result
Dim SearAccomStat As New Devotion2Motion.AccomSearchClass()
' send the variables to be searched on through to the component in the accomsearch class
dgResultset.DataSource = SearAccomStat.SearchAccomStats(accomType, Totalsgle, Totaldble, Totaltwin, TotalTriple, aGarage, aPhone, aCarPark, aTv, aTownCentre, aSwimPool, aRadio, aNearSlopes, aDgsAdmit, aSafe, aCrossCtry, aSuitDisable, aBalcony, aOnTLake, aSolarium, aSuite, aQutZone, aBeautyCb, aMinibar, aTennis, aWhirlPl, aElevator, aSauna, PriceRgLow, PriceRgHigh, DateFromTotal, DateToTotal, aselfcatering, ahalfboard, afullboard, aroomphone, asuitdisableroom, countryID, OrderBy, ResortID, StarRating)
dgResultset.DataBind()
' This counts up all the returned records and writes the total into a asp.net label
Dim I As Long
Dim Counting As Integer
Dim RecordCount As Integer
Dim TotalRecordCount As Int
For I=0 To dgResultset.Items.Count -1
Counting = 1
RecordCount = RecordCount + Counting
Next
TotalRecordCount = RecordCount
[asp:datalist RepeatDirection="Vertical" width="650px" ShowHeader="true" EnableViewState="true" ItemStyle-Width="3px" GridLines="none" ID="dgResultset" runat="server"]
[headertemplate]
[tr]
[td colspan="3"][span class="hometitle"]Accommodation available[/span][/td]
[/tr]
[tr]
[td colspan="3"][span class="formlabel"]Your search has resulted in the accommodation listed below. If you want to confirm availability please select the tickbox on any of the accommodation results. Rememeber to send the 'send your enquiry' button at the end of the results.[/span][/br][/br][/td]
[/tr]
[tr]
[td colspan="3" bgcolor="#eeeeee"][span class="AccommResultsedBD"]Accommodation Results[/span] [span class="AccommResultsSmall"]([/span] [asp:Label Text='[%# session("TotalRecordCount") %]' CssClass="AccommResultsSmall" runat="server" /] [span class="AccommResultsSmall"]Item match your selection criteria)[/span][/td]
[/tr]
[/headertemplate]
Source: http://www.livejournal.com/community/aspdotnet/54652.html