.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

QueryExtender Control - Variable field name to search against

Posted By:      Posted Date: September 25, 2010    Points: 0   Category :ASP.Net

FrownI have been alerted to the Query Extender control through previous posts, but I am still seeking the final part of my desired solution.

NB the following is written in conceptual English (programming specification) format, rather than actual asp code.

While I fully understand that I can use the QueryExtender control to pass a parameter from one web page to another, I do not see, and maybe this is not even possible, how I can pass a parameter of which field I want to select on.

Ideally I would like to be able to implement a query which is

SELECT tiles where 'Passed Variable Name' contains 'Passed Test Value'

such as would then generate, for example -

SELECT titles where 'Series Available' contains 'A'


SELECT titles where 'Authors' contains 'Wyndham'

but I just can't work out how I can implement the varying search field.

Is what I am seeking for possible? OR

Am I going to be forced to implement an approach such as the following?

SELECT Calling Web Page

CASE "Series" 

SELECT titles where 'Series Available' contains 'passed variable'

CASE "Authors"

View Complete Post

More Related Resource Links

How to take value of bound field of grid in a variable or in a textbox.


How to take value of bound field of grid in a variable or in a textbox.

 I m using this code in .aspx page for grid.

<asp:GridView ID="Grd_Mprocess" runat="server" AutoGenerateColumns="False"

                      Width="100%" AllowPaging="True"


                      AllowSorting="True" PageSize="5"  >

                 <RowStyle CssClass="odd" />


<asp:BoundField HeaderText="DOC_TYPE_PK" DataField="DOC_TYPE_PK"  Visible="true" >


  <asp:TemplateField HeaderText="DOC TYPE ID" Visible="true">  &nbs

Pass the server variable to search core result web part


I'd like to custom the search core result web part to filter results based on the log on user name.

It can easily be done in Dataview web part.

However the search core web part doesn't accept "<parameterbining>" to pass in the server variable [logon_user]. I can't figure out how to use <xsl:param> to get this server variable either.


Any ideas? Thanks a lot!

If you get confused, listen to the music play...

Custom Field Control


I would like to know how can we build a custom field control in sharepoint. Following is the scenario i am looking into it:

1. Textbox control with browse button

2. When we click on browse button, need to display a popup (like business data dialog box) where i can search for project id from oracle datasource and then select the project id(s) from the search results. Selected project id(s) must be concatenated with colon or semi colon and display back to original text box.

I guess requirement is very clear. Please help me how to do this type of things in sharepoint. I have never done these type of requests earilier. Thank you very much for you help.

Custom Field Control 'not registered as safe'


Hi all,


my goal is to create a custom field control based on a custom field, to be part of a custom content type which derives from a publishing page. Also I want the custom field control to be part of a custom page layout which is associated with my custom content type.


I followed the steps from Patrick Tisseghems book 'Inside MOSS2007', which includes the following instructions:


  • Create and implement the following classes: CustomField, CustomFieldValue, CustomFieldControl. Sign them and deploy the assembly to the GAC.
  • Create a User Control Custom.ascx. Copy it to Controltemplates directory.
  • Create fldtypes_custom.xml and copy to 12\TEMPLATE\XML
  • Add <SafeControl /> entry to web.config

I did of all the above plus I created a page layout in SharePoint Designer which contains an instance of my CustomFieldControl.


When I create an instance of CustomPage (derived content type from Publishing Page, with extra field of type CustomField) with my custom page layout and add it to the Pages library of my Publishing site, everything seems to go fine. When i edit properties of the page with /Pages/Forms/EditForm.aspx I can even edit the custom field value trough the interface using mu custom field control! Everything seems to work perfectly!


But... this

Adv Search not returning calcuated field

I have a custom column associated with one of my content types, which I've set up as a Managed Property under Central Administration, and added to the Properties filter on my Adv Search page.  When I select this property in Adv Search, and specify a value that I now exists (on several documents), I get no results.  Non-calculated custom properties that I've set up work fine. Any ideas if there is some special config/requirement for search to return results based on caclulated column values? I set this up as follows: 1. Created the custom column on the content type 2. Created a managed property that maps to the crawled column "ows_MyCalculatedField" (in the mapped properties page this column showed up under Crawled Properties) 3. I reset the index and then ran a full crawl 4. I updated the Adv Search screen web part and added the column to the web part XML that defines what properties appear in the Properties picker list (the property shows up fine and I can select it and run a search) However, when i run the search for any value in the field, I get no results.  And I know there are documents that have the values I entered. Thanks

Search field question

hi guysin my database i have one table that has basic patient information (id,name,dob etc, visit date etc)i would like for the user to be able to search for a patient based on his unique personal id number and return the fields i specify (name,lastname) in the gridview. my problem in that one patient may have multiple visit dates. i would like the gridview to return the following as an exampleName     Lastname   Visit dateJoe         Johnson      10/05/10Joe         Johnson      13/08/10joe         Johnson       20/09/10from that the user will be able to click on the visit date that he wants to see the details aboutmy problem in that since the user ID is a unique field in my table i dont know how to create multiple visit dates. i think i should put the visit date in a different table and create a relationship but then i dont know how to present details from 2 tables in one gridviewthank you

Multible search criteria with empty field option

I have a gridview with two textboxes (first name & last name) and a linkbutton to search results inside the gridview.I have made select parameters as well and the search works if i write in both textboxes. However, if I leave one textbox blank, i don't get any results.------------------------------First Name: <asp:TextBox ID="txtSearch_FName" Width="100px" runat="server"></asp:TextBox>&nbsp;&nbsp;&nbsp;Last Name: <asp:TextBox ID="txtSearch_LName" Width="100px" runat="server"></asp:TextBox> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:LinkButton ID="LinkButton1" Text="Find" runat="server" OnClientClick="return check();" /><asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="Searching" CellPadding="4" PageSize="15" GridLines="Vertical" onrowcreated="GridView1_RowCreated" Width="100%"><PagerSettings Mode="NumericFirstLast" /><HeaderStyle BackColor="#666666" /><AlternatingRowStyle BackColor="#f4f4f4" /><FooterStyle BackColor="#666666" />  &

How can I get search to work for a Custom Document Library with a few third-party field types?

Hi, Using WSS 3.0 with SQL Server 2008 for Workgroups I have created a Custom Document Library (2,462 files - copied from folder into Explorer view and then renamed using Batch Update in web services i.e. "BaseName" field) - basically it uses three fields that are of "Filtered Lookup" (a field type from a third party). The document library is included in the search (i.e. Advanced Settings), but it displays none of the files - bascially not included in search at all with all testing I have done. I created a new Document Library called "Test" and uploaded a document and it is included in the search. Is there any way I can debug this. Is there a log file? Is there something in the Search Database that might help? Your help would be really appreciated as this is my last issue - and its soooo important to the deliverable. Thanks. John.

Problem setting variable/param in XSLT for XML control in .NET 4.0

I am using an XML control in VS2010 with .NET 4.0.I am trying to sort XML data into a table. I have a drop list with the sort key, and a button that is supposed to display the table with a new sort.Here is the code the button calls:</p><p></p><p style="text-align: left;" mce_style="text-align: left;"><font class="Apple-style-span" face="Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace"><span class="Apple-style-span" style="border-collapse: collapse; line-height: 13px;" mce_style="border-collapse: collapse; line-height: 13px;" mce_fixed="1"></span></font></p><p><font class="Apple-style-span" face="Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace"></font></p><p><font class="Apple-style-span" face="Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace"><div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste">private void PopulateXML( Xml MyXML)</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: h

search field

hi, I want to have a search field in mvc2 asp.net that with click on search button redirects to page with address: "xyz/search/?name=&amp; FolderNum="  But get this error: A potentially dangerous Request.Path value was detected from the client (?).

Lists - wrong field is nameing variable

I have created a list of applications which are installable via SCCM and the list is also used to raise new application packaging requests. What I am finding is that the workflow picks up the application developer as the name that is used in workflows, for example, if I raise a request for Microsoft Office Project 2010, the workflow comes back with "Please review Microsoft". How can I persuade the list and the workflow that it is the application name field I want brought back and not the company name? Regards Mark

How to set a string field with people picker control group

Hi Guys I have a problem with a form list, when I need to set a string field with de content of people picker control that have more than one "user". Is there any way to put in string a list of user like the people picker control shows in a form? The really problem is I don't know how to read an array of user in a formula rule. any example or idea should be appreciated. tnks.  

How can I get Result Search with Paging in DataList Control

 I have Database called mygroup , and I have three tables *  Cataloges table .. columns (CatalogeId  int,   CatalogeName nvarchar) *  Brand table  .. columns (BrandId  int,   BrandName nvarchar) *  Products table, it is consists of these columns : ProductId   int ProductNO  nvarchar CatalogeId  int BrandId   int MainSpecification  nvarchar DetailsSpecification  ntext Image  imageand I want to desgin form for products, and this form contain these ToolBox *   DropDownList  for CatalogeId *   DropDownList for BrandId *   DataList Control for displaying the Result Search *  Button   When the user visit Product Page for Example (productpage.aspx),  then he see the two DropDownList , then choose one of Cataloge Name (Laptop , Printer, ....) , and choose one of the Brand Name (Sony, Toshiba, ....) , then Click the Button, and get the  Result Search in Paging DataList 

how to apply styles on the message displayed by asp.net required field validator control?

 Hi,I want to apply styles on the message (i.e. Name field is required) display by the asp.net required field validator control.Styles=border, padding, background-color, font-color, font-weight, img etcAnd I also want highlight the border or asp.net textbox and asp.net dropdown list with which this control is associated.  RequiredFieldValidator does not have style property !Can anyone let me know how can I do this???Regards,Dazy

Gridview control Delete error -- Must declare the scalar variable "@GradeID"

 Hi All,Pardon me if this seems redundant. I have searched the archives and found many references to this type of error. Most (all?) boil down to a mismatch between the token for the databound field and the sql parameter. I have stared at this code for a long time and can see nothing wrong with it. In fact, it is so simple that I started over from scratch using only the designer (ie I wrote no code), so I don't see how it possible to have a name mismatch. I would very much appreciate any help figuring out what is the problem here. Thank you very much in advance.-Roger   Server Error in '/ssp/inet220a06' Application. Must declare the scalar variable "@GradeID". Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Must declare the scalar variable "@GradeID". Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Selecting a field based on a variable


If I have a field name in @FieldName is there a way to do something like

SET @FieldName = 'MyField'

SELECT @FieldName FROM MyTable

where the above would yeild the same results as

SELECT MyField from MyTable

Thanks in advance.

I need to pass a variable from a url to an .aspx search/results page


When I was using FrontPage, a .asp page would receive a varialbe from the url when ?field=value was added to the end of the url.  I am now using Expression Web and have found that this doesn't work with .aspx pages.  Can anyone tell me what code needs to be added to the page to accomplish this with .aspx?  I create the .aspx page with VB as the coding selection.

I am not sure what forum this should be in.



Eleanor V

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend