I am reading an rss feed and I am binding it to a repeater. I would like to select the 3 most recent posts. in my XPathExpression I use AddSort The data are sorted just fine but when I bind to the repeater the sort is lost.
That is my first issue. I am using xpath expression [position()<=3] to limit to 3 items. This, however, occurs prior to the sort. So, I would not be getting the 3 most recent records but rather the first three from the feed which are then sorted (if I get the sorting working properly with the repeater). Here is a code snippet.
Dim xpn As XPathNavigator = New XPathDocument(RssURL).CreateNavigator
_xmlnsm = XmlHelper.GetXmlNameSpaceManager(xpn)
Dim expr As XPathExpression
expr = xpn.Compile(String.Format("/rss/channel/item[position()<={0}]", numRecords))
expr.AddSort("title", XmlSortOrder.Descending, XmlCaseOrder.None, "", XmlDataType.Text)
Dim iterator As XPathNodeIterator = xpn.Select(expr.Expression, _xmlnsm)
rptNews.DataSource = iterator
rptNews.DataBind()
I am using AutoCompleteExtender on a text box as follows
[Code]....
My problem is the autocomplete returns a long list of recods ,I want to limit it to maximum 10 recods .How can I do that? I set CompletionSetCount="10" ,but it doesn't seem to work How can i do that?
dlRSS.DataSource = GetRSSFeed("http://www.foodsafetynews.com/headlines.xml") dlRSS.DataBind() Function GetRSSFeed(ByVal strURL As String) As DataTable 'Get the XML data Dim reader As XmlTextReader = New XmlTextReader(strURL) 'return a new DataSet Dim ds As DataSet = New DataSet() ds.ReadXml(reader) Return ds.Tables(2) End Function <asp:DataList ID="dlRSS" runat="server" Width="100%" > <ItemTemplate> <strong><p><div><asp:HyperLink ID="TitleLink" runat="server" Text='<%# Eval("title") %>' Target="_blank" NavigateUrl='<%# Eval("link") %>'/></div></p></strong> <strong><p> <div><asp:Label ID="SubtitleLabel" runat="server" Text='<%# Eval("description") %>' /></div></p></strong> </ItemTemplate> </asp:DataList>
But is returning all rows in RSS Feed I would only like top 5 or so
im tryin to create repeater from code behaind using C#. The data bind is working good, im tryin to put some pager. the pager is half working. i can see the pager links at the bottom, i can see the the code split the records to 10 lines each page as i set it but when i click the next link the records stay the same it wont changing for the next 10 records. my code
In ASP.NET Can we achieve both grouping and sorting in a repeater control.If possible please suggest me the way of doing it or links ..I have to implement that in my application
How to bind repeater control after sorting the values. i got values from database table. i need to bind the repeater with this values but i need to sort values by date values. is it possible to do dynamically or i need to go for store procedure. Also i like to display only 5 results out of my any records.
I have repeater control on page which bind with sql data source.i have dropdown to filter the records of repeater on button click event it refresh complete page i just want to show a wait message to user and just refresh repeater data instead of complete page refresh.i do not want to use ajax update panel.
Moderators Note: THIS ISSUE IS BIG FOR ME AND EVEN IF POSSIBLE, GET THE REPLY FROM THE DESIGNER OF GRIDVIEW. I have been looking for him for long. I am really fed up with reviewing a good lot of web pages on how we can possibly customize the gridview to enable sorting and paging. So many sites have listed out a lot of information and so many guidances. But the problem is that one works out fine and the other is a burden. I really feel bad about being given the job of customizing this kind of a gridview which has no user friendly approach to it. Also, this control is rendered without the pager links inside the <tfoot> tag. I have tried the Pear Pager in php. It is that good and easy to use and compared to that, the gridview in asp.net is the worst ever control i have ever tried so far.
1. i can use the images to indicate the sorting direction 2. I can have the custom pager like
[code]
<<Previous 1 2 3 .. 7 Next >>.
[/code]
When i click the next when i am viewing the page at 3 , the pager links should change as
[code]
<<Previous 2 3 4 .. 7 Next >>
[/code]
Kindly look into this type of requirement and firstly tell me whether this is possible with the gridview control. I would like this request even to be escalated to the designers of the gridview control also, so that Microsoft comes out with a reply THAT WORKS and not the kind of stuff like surfing through a lot of links and pages and finally wasting a lot of days precious time and still breaking the head with this useless control. I have spent a lot of time in searching for a perfect way. Not writing a code that is non-standard. I am really serious b'cos I have spent weeks in customizing this control. If I dont get a solid reply atleast now, I am going to generate all the output by HTML content by custom coding.
I'm building an ASP.NET MVC site where I want to limit how often authenticated users can use some functions of the site.
Although I understand how rate-limiting works fundamentally, I can't visualize how to implement it programatically without creating a major code smell.
If it matters, all of these functions are currently expressed as Actions that only accept HTTP POST. I may eventually want to implement rate-limiting for HTTP GET functions as well, so I'm looking for a solution that works for all such circumstances.
in the global.ascx file might be an option. I could setup a static object per application that contains some the error details and the time logged and check it and cancel the email notification if need be?
I have a site that I am developing with VS 2008. I have a breakpoint set in my code behind file. This file is vast as some of it was created with Iron Speed 7.0. What I'd like to do is limit the debugger to the one file. That is, no matter where the code goes it skips over code in other files, and automatially breaks when execution returns to the file I put the break point in. The code is too vast to step a bit at time and choose to step into or out of bit of code. I want it to just debug the current file.
I have a site under construction which has a control panel for login/logout and it is in an include file on every page.
We currently have a "login page" which functions just fine but I want to take that and incorporate it into the control panel so the user could log in from any page.
Problem is that the .NET programmer wrote all of the login logic using code behind only on one single page.
Is there some way for me to work around this or to incorporate this vb code into every page so that the cpanel can function as it should?
I need to limit the length of the string that load into a DataTable that is being used to display. The data I am loading is coming from another DataTable. How do I shorten row["CG_GalleryName"] contents to 24 characters.
Convert.ToString(row["CG_GalleryName"]) -- how do I set this length to 24 characters? Using it in the below code.
I wantto make a slower transmitting/transferring data speed for debugging issues.(no threading sleep is not my answer) searching a way to limit webdev.webserver speed (bandwidth) ?
for example maybe checking on "custom web server=webdev.webserver /BandwidthLimit=128bs"
I have a Gridview showing the MemberLastName, MemberFirstName, MemberBirthYear, MemberGender, MemberRelationship.
During Edit mode, I have managed to display a DropDownList for the Relationships.What I am trying to achieve now, is that, based on the Gender of the member I would like to limit the items in the Relationships dropdownlist.
e.g if the Gender is Male, then only display Male Relationships
What is the best way to achieve this scenario?Here is my snippet of code for the event. The code is commented out as it throws an exception.
How do I limit my result in my Gridview to 1 decimal places and insert kWh after each answer. For example my current result is 15.513 Im looking to have it display 15.5 kWh. Is this posisble I know for standard stuff like currency symbols you can use