Last post Mar 10, 2008 03:30 PM by ashmetry
Feb 08, 2008 01:49 AM|paggy4u|LINK
I have been looking for a solution since long, and i had already posted it once long back, but no solution so far.
As you all know, once you post an advertisement in generates a number.
I am looking for a solution, that shows the advertisement with that ID, when placed inside he search box.
Ok...Its like that. The search box would have the heading like " Search with ID " and once you place the ID like 1003 in the search box, you immediately reach that particular advertisement.
This is the most important requirement as you can easily inform the other person ( Seller/Buyer ) on phone as... " Please look for this particular Advertisement with this ID..."
" You can also place an advertisement in newspaper and say "For more details. please visit www.xyz.com and look for ID No:- 1003 " for full details and Pictures."
I hope i will be guided in right direction this time.
Feb 08, 2008 10:42 AM|ashmetry|LINK
I have that implemented in www.love2trade.com. I didn't even do a special search textbox for it. Test it by searching for
1010, that willl pull up the TV i have for sale (Which by the way it still is for sale :P)
How its done:
1. I have a property SearchTerm for the Results.aspx, in the setter of the property I call
Feb 08, 2008 10:58 PM|paggy4u|LINK
Thanks for the help buddy.
Can i ask for a little more help please.
Can you kindly guide me, where should i be making this changes. ( i.e in which page or in which control )
Plus... is it possible to kindly offer the same code in VB. As i am not much in touch with C#.
Thanks in advance.
Feb 09, 2008 09:56 AM|ashmetry|LINK
I re-wrote pretty much the whole thing so telling you where to put it in the stock version is not tested. :)
But you can simply call this method anywhere before you Bind the grid in the results.aspx.
I used a converter to generate this code so you might need to re-address it but it will give you the idea.
Private Sub checkIfKeywordIsItemNumber(ByVal value As String)
Dim id As Integer = -1
If Integer.TryParse(value,out id) Then
Dim adObj As AdsDataComponent.AdsRow = AdsDB.GetAdById(id)
If Not adObj Is Nothing Then
Feb 11, 2008 09:59 PM|paggy4u|LINK
Sorry for troubling you again.
Can you kindly guide me, where was this unmodified code placed in the Original StarterKit.
Perhaps that would help me to make the changes in the right way.
Feb 12, 2008 09:44 AM|ashmetry|LINK
This code was not in the original kit. This is new code i wrote.
Try calling the method checkIfKeywordIsItemNumber(searchTerm)
from inside SetSearchMessage(int flag), this might be a good place to place it.
Let me know if this makes sense
Feb 20, 2008 12:36 AM|paggy4u|LINK
Sorry for troubling you.
Unable to find the root of search.
ANY HOW.... Is it possible to make the changes in original search, since i do not want any extra advanced search features on the front page except searching with ID
I hope this would be easy....?
Can you guide me again please.
Feb 20, 2008 10:00 AM|ashmetry|LINK
The way i have it setup...is all search boxes point to Search.aspx, right?
So why code every Search Term text box with code that points it ONLY to the ShowAd page if the search term is an Ad ID.?
Its easier & makes more sense to enable that feature from all search term text boxes...
So when you are posting back to the search.aspx page you can extract the search term passed from the PreviousPage and set the
SearchTerm TextBox .
So what you can do is something like ;
Inside SetSearchMessage(int i) check the value of SearchTermTextBox.Text,
-If its numeric (int.TryParse(SearchTermTextBox.Text) ....then you can check and see if that Number is actually an AD id...If it is, then simply redirect the visitor to the ad page....pretty simply...
Im sorry, my code now is not even close to the original code so its not gonna help you much to just copy and paste...however, the method that can do that last piece of logic is posted above..
Mar 09, 2008 01:50 AM|SoftMind|LINK
I am also facing same problem like paggy4u.
If any one has implemented the same code in Vb.Net then please help us here.
The Advt is getting posted as Item Number, rather than ID number.
Whats the exact term classified kit is using for Item Number,...? Is it ID or Item Number.
Some one please help with this. It should function the same way as mentioned above, but in VB.Net.
Ashmetry has been helping us. but he is an C# guy.
Mar 09, 2008 08:04 AM|SoftMind|LINK
private void checkIfKeywordIsItemNumber(string value)
int id= -1;
Can you guide me, where is the above code located. I mean which aspx or aspx.cs page.
Pl. guide me with the location.
Mar 10, 2008 03:30 PM|ashmetry|LINK
http://labs.developerfusion.co.uk/convert/vb-to-csharp.aspx to convert my code....
I dont know how you guys read VB.NET
The code is in Search.aspx.cs/vb.. this is the page that all searchboxes post to..