Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 22nd, 2006, 01:27 PM
Authorized User
 
Join Date: Dec 2006
Location: Montreal, Quebec, Canada.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Search Function and User Controls

Hi (first post here),

I implemented a search functionality to a website. That website was developed using a 3-layers architecture as described in Bellinaso's Problem - Design - Solution.

I use a custom control ProductListings.ascx to show the results. Basically, the Recherche class take a string and return a List<Product>. Then the GridView use that List<Product> to show all the results found by the search.

Code:
<asp:ObjectDataSource 
    ID="objRecherche"
    runat="server"
    SelectMethod="SmartSearch" 
    TypeName="SiteWeb.BLL.Services.Recherche">
    ...

<asp:GridView 
    ID="GridView1" runat="server"
    DataSourceID="objRecherche"
    ...
What we want to add is a way to add more information than only the results via a GridView. For example, we want to print the keywords that were used to search for these products, the time taken to process the search, a special message when there is no product.

The Recherche class does more than just pass the search string to the DAL. It will take a string such as "le ski de fond", cut it into 4 words and remove "le" and "de" because they're article. So it will pass ["ski", "fond"]. I want to print that on the result page so the user knows "le" and "de" were not taken into account.

My idea was to add properties (keywords, timeTaken) inside the Recherche object that can be set during the algorithms. Then inside the control, get those properties and print whatever I want before the GridView using either another control or just a Literal.

So, my question is "how do I do this?" and if it's not possible, "what should be done instead?" I tried to do this in the control but it didn't work:

Code:
<asp:Literal runat="server" Text='<%# Test() %>' />

protected string Test()
{
  return ((Recherche)objRecherche).MyProperty;
}
Thanks

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
User controls' content: Chapter 2 User Controls AGS BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 10 July 26th, 2007 05:36 AM
Search Function and User Controls hpox BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 January 8th, 2007 10:00 AM
AJAX Use Search with HTMl controls and Datagrid Nikhil1978 Access ASP 0 December 27th, 2005 01:25 AM
Search All Controls donnie_darko1983 ASP.NET 2.0 Basics 1 April 13th, 2005 01:41 PM
Search Controls on a Form donnie_darko1983 ASP.NET 1.0 and 1.1 Basics 2 April 12th, 2005 05:20 AM



All times are GMT -4. The time now is 08:35 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.