MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Group Search   (Mono Support )

Viewed 34852 time(s), 18 post(s) 10/19/2011 7:14:13 AMby ashutosh0901
khorvat

khorvat

10/19/2011 2:00:11 PM
Hi,

source code for these modules and pages isn't provided in the MonoX Free package so you need to do some development of your own. It is very easy to implement the above code, just follow the guidelines I have provided you with and we will try to help you in your implementation.

Regards 
This content has not been rated yet. 
15993 Reputation 2214 Total posts
denis

denis

10/19/2011 4:18:33 PM

As I said, posting single-line questions on multiple threads under different titles only makes the job more difficult for us and results in longer response times.
If you already in such urgent situation, could you please be more specific and instead of posting "help, it is urgent" every few minutes, give us all details and more detailed description of what you are trying to achieve?

As for you questions, if I understand it correctly, you want to search only groups (or some other section), based on the selected radio button. The code to achieve this would look like this:

protected void btnSearch_Click(object sender, EventArgs e)
{
 
    if (txtSearch.Text == this.DefaultSearchText || String.IsNullOrEmpty(txtSearch.Text))
    {
        txtSearch.Text = !String.IsNullOrEmpty(this.DefaultSearchText) ? this.DefaultSearchText : DefaultResources.Search_EnterSearchPhrase;
        return;
    }
 
    //by default, SearchResultsUrl variable equals to /search/{Query}/
string resultsPageUrl = SearchResultsUrl.Replace("{Query}", MonoSoftware.Web.UrlEncoder.UrlEncode(txtSearch.Text), StringComparison.InvariantCultureIgnoreCase);
    string url = LocalizationUtility.RewriteLink(resultsPageUrl);
    if (resultsPageUrl.Equals(SearchResultsUrl))
    url = url.Append(UrlParams.Search.SearchTerm, MonoSoftware.Web.UrlEncoder.UrlEncode(txtSearch.Text));
    url = UrlFormatter.ResolveUrl(url);
    foreach (string key in SearchParams.Keys)
    {
        url = url.Append(new UrlParam<string>(key), SearchParams[key]);
    }
     
    //this is where you would put your cusom code. Instead of looping through the collection of search providers, you would loop through the list of your radio buttons
    //group search provider name is GroupSearchProvider, the template name is Default
    if (SearchProviders != null)
    {
        foreach (SearchProviderItem provider in SearchProviders)
        {
            url = UrlUtility.AddToUrlWithDuplicates(url, UrlParams.Search.Provider.Name, provider.Name);
            url = UrlUtility.AddToUrlWithDuplicates(url, UrlParams.Search.Template.Name, provider.Template);
        }
    }
 
    Response.Redirect(url);
}

Now, if you want to change the behavior of any of the existing provider or implement your own, you can use khorvat's suggestions and information from my earlier post.

This content has not been rated yet. 
7207 Reputation 956 Total posts
ashutosh0901

ashutosh0901

10/19/2011 6:40:26 PM
@Denis
Well first of all i really obliged that you are giving you precious to me but that doesnt mean anyone can be rude to me, secondly i understood the screaming for help will not make things easier for me so i will keep this in mind, third for multiple post i have already apologized cant do more than that.


Now,
On Group search i have used radiobuttonlist which has two options
1- My Center
2- All Centers
when user selects My center and type groupname in the textbox and click on go ...it will only show the data based on the address column and groupname from sngroup table.
but when user selects All Centers and type groupname in the textbox and click go it will show all the records based on the groupname
this is all i want


This content has not been rated yet. 
353 Reputation 46 Total posts
denis

denis

10/19/2011 7:10:45 PM
We all try to do our best here, and I don't think anyone was being rude to you. I'm glad that we now agree on communication issues.

Now, what address column are you referring to? The address from the user's profile? If that is the fact, this is a rather specific scenario that could be covered both by a standard search provider and by your custom code. Some pointers to the search provider topics were already provided, if you consider this approach as too complicated for this scenario you can always build a custom Web part, write a simple query using any technology you normally use to pull out the data from the database (ADO.NET, Linq, LLBLGen or any other ORM tool) and bind the results to a repeater.
If you did not work with Web parts before, one of our colleagues is about to publish a code sample in this thread, and you will be able to study it and to put in your own code - basically only the data retrieval part will be different.
This content has not been rated yet. 
7207 Reputation 956 Total posts
ashutosh0901

ashutosh0901

10/20/2011 7:06:20 AM
Actually i never worked with data providers and web parts .so could please give a example to create custom search provider
This content has not been rated yet. 
353 Reputation 46 Total posts
ashutosh0901

ashutosh0901

10/20/2011 7:08:36 AM
And how does query is formed in monox application to get a record from sql server
This content has not been rated yet. 
353 Reputation 46 Total posts
denis

denis

10/20/2011 8:09:36 AM
For more information on the search provider development, please visit MonoX user manual (PDF), section 15.11, "Developing custom search providers".
This content has not been rated yet. 
7207 Reputation 956 Total posts
denis

denis

10/20/2011 8:16:42 AM
Regarding Web part development information, please use the users' manual and the following resources:
Building a custom ASP.NET project based on MonoX
Building a custom Web part

You can use a data access technology of your choice - MonoX use the LLBLGen Pro ORM mapper, but it is not mandatory, you can also use ADO.NET, Linq, Nhibernate, Entity Framework...
This content has not been rated yet. 
7207 Reputation 956 Total posts
1 2