Master page search box to other page


I have a Master page where is searching funtionality. When I search it display the records into repeater.I have other 2 pages (Browse by Name and browse by Author) ; both pages use the master page so that the search textbox and button appear on those pages.


My problem is: 

When I browse by Name, I created a A-Z lists there and it display the records, In the mean time when I use that search button it display the data on the same Name.aspx page (with those browse data) .I want to display those data into default.aspx when click the search button even even I open Name.aspx.


<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPage.master" CodeFile="BrowseByAuthor.aspx.cs" Inherits="BrowseByAuthor" Title="Browse By Author" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainPageArea" Runat="Server">



<asp:SqlDataSource ID="SqlDataSource1" runat="server"

ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

SelectCommand="SELECT [ID], [Name],[SectionAuthor] FROM [Book]">



<asp:Label ID="Label1" runat="server" Text="Browse by Author: "></asp:Label><br />

<asp:Repeater ID="Repeater2" OnItemCommand="Repeater1_RowCommand" runat="server">


<asp:LinkButton CommandName="AlphaPaging" Font-Bold="true" BorderWidth="10" BorderStyle="Dashed" CommandArgument='<%#(((RepeaterItem)Container).ItemIndex+ 65) %>'

ID="LinkButton1" runat="server" Text='<%#Container.DataItem %>'></asp:LinkButton>


</asp:Repeater><br /><br />


<asp:Label ID="NoData" runat="server" Font-Bold="true" ForeColor="Red" ></asp:Label><br />


<asp:Repeater ID="Repeater1"

runat="server" OnItemCreated="Repeater1_RowCreated"



<table cellpadding="5" cellspacing="2">

<tr bgcolor="0fddefer234">


<b>Lists of your Search Results:</b>







<asp:HyperLink ID="HyperLink1" Font-Bold="true" runat="server" NavigateUrl='<%#DataBinder.Eval(Container.DataItem,"ID","DetailsPage.aspx?id={0}" ) %>'>

<%# DataBinder.Eval(Container.DataItem, "Name")%></asp:HyperLink><br />

<%# DataBinder.Eval(Container.DataItem, "SectionAuthor")%>









Any help highly appreciated.






4/30/2009 4:49:05 PM 13714 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 3

I added following code and solved it.

In MasterPage.master.cs:

protected void search_button_Click(object sender, EventArgs e)


//redirect textbox's value to search.aspx page

Response.Redirect(@"~/search.aspx?q=" + Server.UrlEncode(txtSearchBox.Text));



 In Search.aspx.cs:

protected void Page_Load(object sender, EventArgs e)


//read the master page TextBox value

string str = Request.QueryString[@"q"];




5/4/2009 5:11:26 PM

Similar Artilces:

Content controls have to be top-level controls in a content page or a nested master page that references a master page.
Why in the world am I getting this error? The solutions I have seen either don't apply or don't work.  Here is my master page code:<%@ Master Language="C#" AutoEventWireup="false" CodeFile="TechLMSMasters/MainSide.master.cs" Inherits="MainSide" %> <%@ Register TagPrefix="usercontrol" TagName="Search" Src="~/library/uc/Search.ascx" %> <%@ Register TagPrefix="usercontrol" TagName="UserName" Src="~/library/uc/UserNameDisplay.ascx" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <html xmlns=""> <head runat="server"> <title>Untitled Page</title> <asp:ContentPlaceHolder id="head" runat="server"></asp:ContentPlaceHolder> </head> <body> <form id="form1" runat="server"> <div> <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"> <DIV class="user" id="userName" runat="server"><usercontrol:username id="userNameDsp" runat="server"></usercontrol:username></DIV> <DIV class="search" id="search" runat="server"><usercontrol:search id="pageSea...

Error : Content controls have to be top-level controls in a content page or a nested master page that references a master page.
when I make a directory on my root, and in that directory I put a masterpage and a web form ... I get always an error : Content controls have to be top-level controls in a content page or a nested master page that references a master page.   Does somebody know what the problem is ? Is it possible you can't set a masterpage in a directory ... ?Kind Regards,Joeri Pansaerts.From Bruges, Belgium :) i've founded ... I had to nest my masterpage ...Kind Regards,Joeri Pansaerts.From Bruges, Belgium :) Hi Joeri Pansaerts, I am receiving the same error as the one posted here, Could you please share your solution with me. I am using a single Master Page. Thank You, Sudhe Hi Sudhe,  Are you using 2 masterpages ?Kind Regards,Joeri Pansaerts.From Bruges, Belgium :) Hi Joeri, Thank you for the reply. I am using a single master page, however I had figured out the solution. Thanks once again, Sudhe hi, I also geting the same error, I am using single master page and a web form. please can any one help me to solve this problem....

ERROR Content controls have to be top-level controls in a content page or a nested master page that references a master page.
This all used to work until about 5 minutes ago. Did I change something? For some reason I am now getting this error: Content controls have to be top-level controls in a content page or a nested master page that references a master page. What I have:  I have a masterpage inside of a directory. That directory is a first level directory with its own web.config file....The whole thing is protected by the web.config file above it (in the main public directory). That main public directory has a masterpage as well. I am not currently linking the two masterpages together becuase...

HELP..... Master Page Error (The page has controls that require a Master Page, but none is specified.)
Hi, I had almost finished creting my master page to use as a template for all future internal applications.  I had created a template to use in creatign new applications and had sucessfully created a new project based upon the MasterPage template... All was working well when I noticed a small graphic inconsistancy on the MasterPage... I reopened the MasterPage and I got teh above error message... I have looked at the HTML and everything seems to be okay and there including the header lines... <%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %><%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %><%@ Register src="Common/Footer.ascx" tagname="Footer" tagprefix="uc1" %> A can no longer view the page in the designer without this error... what has happened?ThanksPhillip J. Hi, sniplet below I copied from this tutorial Whether the MasterPageFile property is set via the @Page directive or programmatically is inconsequential to the end user's experience. However, the MasterPageFile attribute in the @Page directive is used by Visual Studio during design-time to produce the WYSIWYG view in the Designer. If you return to Default.aspx in Visual Studio and navigate to the Designer you'll see the message, "Master Page error: The page ha...

Post from one search box (on master page) to another search page's query and display result.
Hi, I am using the code for a search using index server from this page  I want to post to the search from a text box on another page.  E.g. I have a navigationg box at the top of my page, included in all my page which has a search box and a submit button.  I want, when a user types in their search term, for the query to be posted to the search page and the results shown in one motion like google for example.  The search offers a number of different search options such as all words, any words etc. I would be quite happy for it t...

Problem Accessing Page Controls in a page that has a master page.
Hi,  I have a problem with accessing the controls of a page that has a masterpage. I am trying to access the Page.Controls from the code behind in the class file but no controls are returned.I can access single controls (ex. txtAddress.Text) but not the whole array of controls (ex. Page.Controls).  The controls structure is..                                 MasterPage  >  PlaceHolder > MyPage.aspx &n...

Doing Postback from master page to page in master's content place holder(search page)
Hi, Currently I am trying to do a postback which returns results. The master page has a textfield and button and the button redirects to the search page.The search page also has a textfield and button and when the button is clicked, the query statements take the input from teh user and looks for results. Currently, A Crosspage postback of master page + other pages in content place holder ------> master page+search page in content place holder works.I am trying to do a postback which returns results in master page+search page which gets its input from the textbox of the master page without affecting the function of the search page.Meaning that the search page's button still can retrieve the results on its own and the master page's button gets the input from the textbox(master page) and executes the button click event of the button(search page).Below is the back end code that I used.1 protected void Page_Load(object sender, EventArgs e) 2 { 3 if (PreviousPage != null) 4 { 5 TextBox retrieved = (TextBox)PreviousPage.Master.FindControl("crossSearchTextBox"); 6 basicSearch.Text = retrieved.Text; 7 8 if (basicSearch != null) 9 { 10 Go_Click(Go, EventArgs.Empty); 11 } 12 } 13 14 if (Session["usertype"].ToString() == "Librarian" || Session["usertype"].ToString() =...

how to access child page control (check box) in master page
hi all,        I need to implement it darely. can anybody tell me how can i access a child page check box in my master button event.       i need it urgent. Pls help me as early as possible Asraful hi, check th link how to access controls in masterpage Mark as Answer if it helps you Try  this if (this.Master.FindControl(" contentplaceholder1").FindControl("chkboxID").Checked == false){//your code stuff} Happy Coding...▌µùthùkûµâ₧á∩▐ . U can do l...

Paging Paging Paging
I am trying to do paging with my search results and it isnt working very well. Here is what I've tried and I feel I've tried everything, lol, please help me out. Sub DataGrid1_SortCommand(Sender as object, e as DataGridSortCOmmandEventArgs) DataGrid1.DataBind() End Sub Sub Datagrid1_PageIndexChanged(Sender as object, e as DataGridPageChangedEventArgs) Dim ds as dataSet DataGrid1.CurrentPageIndex = e.NewPageIndex if Session("Search") is nothing then 'Session probably has expired, get the datasource from database Datagrid1.DataSource = ...

I have made a search box, which works prefectly as I wished in that page, I would like to add the same search box in all other page
 I have made a search box, which works prefectly as I wished in that page, I would like to add the same search box in all other page. I have added the textbox adn all that . Transferred the textbox value to session variable. Made a resposnse.redirect to the target page. But then the grid is not taking the value frmo the session variable. Better say grid is not reacting to the whole linked up scenariio. Could any one help. Thanks in advance.  Digish A D The gridview that you are binding to probably uses a DataSourceObject. The paramater you are passing in to your s...

Using controls from pages, master pages, and user controls
How would I structure my site in this scenario: I'd like to use a dropdownlist all over my site, sometimes in a regular page, sometimes in a master page, and sometimes in a user control.  I wish to bind its events programmatically, so normally I would just put that in the codebehind.  However, I notice a lot of code duplication because I have to declare the control in everywhere, in my base page (which all my pages inherit from), in my base master page (which all my master pages inherit from) and in my base user control (which all my user controls inherit from).How should I be...

Model popup in master page not updating the child page list box control
 Hello, I am facing two unusual types of problems.  I have a Master Page that includes a Model Popup Extender code. When master page is loaded with inner child page, the child page has list box control to show address book list. The master page calls the model popup extender to edit the address books and add new address books. The issues comes, when I try to close the model popup extender that also saves the address book contacts. I want when this popup closes it should refresh the list box in child page with new address book data. Is it possible to block the AJAX call wh...

cannot view controls in mastre page and other pages with master page vwd 2008
I have written web application in visual web developer 2005. when I open this application in V W D 2008 I cannot view controls in master page. when open Masterpage and click on desgin it display images , tree, lables  and etc. then disappeared   same thing happend for pages with master page. why this is happening. in source code some cssclass are underlined says class or css value not defined. Does this the origin of the problem   It is difficult to say without seeing page markup. Can you post page HTML here?Thanks--------------------------------------------------...

Control of the page and the controls on a page
I am building a web app that has some pages that are public and some that are only available based on subscription. Could someone explain the best way (infrastructure wise) how to control whether a server control is visible or enabledand how to control whether a page is viewable or not based on the user and whether or not the user is logged in (or not). If a user is not logged in I would like some controls to be visible but disabled. I also have to control the URL's in case a person learnsthe URL and tries to type it in. My question is more towards how to do this database wise. I am u...

i have 3 pages student information , i filled two pages ,then go to 3rd page . First Two pages iam having 100 to store that controls and how to send these controls into 3rd page in ?
i have 3 pages student information , i filled two pages ,then go to 3rd page . First Two pages iam having 100 to store that controls and how to send these controls into 3rd page in ?  There are a number of ways storing values. Check out: Thanks,Karan~ Remember To Mark The Post(s) That Helped You As The ANSWER ~ Hi, Welcome to forums. Now as far as your requirements goes, the first thing that strikes me is that 100 controls are way too many to kee...

Net::LDAP::Control::Paged unexpected behavior using multiple paged searches against AD [SEC=UNCLASSIFIED]
------=_NextPart_000_003B_01CEEE7E.0BE685F0 Content-Type: multipart/related; boundary="----=_NextPart_001_003C_01CEEE7E.0BE685F0" ------=_NextPart_001_003C_01CEEE7E.0BE685F0 Content-Type: multipart/alternative; boundary="----=_NextPart_002_003D_01CEEE7E.0BE685F0" ------=_NextPart_002_003D_01CEEE7E.0BE685F0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit UNCLASSIFIED Hi . I am finding unexpected behaviour when using this control against our AD servers. I have tried this using 5.8 (perl-ldap 0.4...

synchronizing content pages to master page when master page is edited
 Hi Guys,I'm new to designing websites so please forgive this basic question.I've updated my master page and the modfications ( adding a couple of extra place holders)  are not reflecting in the content pages.Is there any way we can update the content pages created before the changes to the master page were made.Thanks a lot  :)  abhinaynag: I'm new to designing websites so please forgive this basic question. I've updated my master page and the modfications ( adding a couple of extra place holders)  are not reflecting in the content pages. Is t...

2 master pages/both loades irrespective of the pages master page
I have 2 master pages One in application’s root directory and one in Admin folder  all .aspx file on the   Admin folder uses AdminMaster.Master  the same folder.  all file  in application’s root directory   uses Open.master in in application’s root directory itself I have noticed one thing when I browse a page with master page AdminMaster.Master   the  events in Open.master    (Page_Init, Page_Load) also executes ! why it is sowhat can I do to avoid this problem ?         ...

CS0012 when referencing controls on master page's master page.
 I'm working with a content page that has a master page (we'll call it ChildMaster). ChildMaster also has a master page (ParentMaster). There is a control on ParentMaster I need to access from the content page. The code looks like this:  ControlType controlInstance = (ControlType) Master.Master.FindControl("controlID");  When I upload, I get CS0012 telling me that ParentMaster is defined in an assembly that is not referenced, and I need to add a reference to some assembly with a funky random-looking name (which changes when I reupload ParentMaster). Up t...

Nested Master Pages and Page controls
Hi, I am having difficulties trying to find a control which exists on a page which uses a mater page (nested) but is declared on one of the master pages. To make it easier to understand here's how my code is set up. I have two master pages: MasterBase MasterPage The MasterPage has a Content control which plugs straight into MasterBase's ContentPlaceHolder. The MasterPage's Content control contains ContentPlaceHolder so that ASPX pages that inherit this MasterPage can plug their Content(s) into those ContentPlaceHolders. Home.aspx, which I have created uses the MasterP...

Accessing Master Page Controls from Page
How can a page access its master page controls? Suppose a page's (.aspx) master file (.master) contains a control (e.g., Label myLabel).  How can one access the master file's control(s) within the scope of the page?  The this.Master.Controls collection (where this is the page in question) does not return what one would most likely think it would return. Hi    you can do this using javascript like    document.getelementbyid("<%controlname.clientid%>").value http:...

Calling a method from a control page on the axpx page where the control page exists.
Hello,  I have an .aspx page that has a method called grdMain_DataBind().  I have a control page that loads within the aspx page which has its own logic.  I have a button on my control page called "SAVE".  How can I call the method grdMain_DataBind thats in my aspx logic from the control that exists on that page when I click SAVE button.  Is there a way? If I were you, I'd simply create a "Save" Event within your control. When the Button in your control is pressed, in the Click handler for that Button you can raise the event. Then, within t...

Finding a control in the master page from within a control on the "child" page....
I've seen several examples of finding controls, but I'm struggling with this.  I want to turn a panel to visible and set a label's text field from within a control... All the examples that I've seen, including the really good one at MSDN2 shows Master.FindControl.  When I use that, it says Master is not declared.  Is there an easy way to set the panel and the label from within the control? Am I close? '---------- My Master page...abbreviated... <%@ Master Language="VB" CodeFile="Secure_Master.master.vb" Inherits="MasterPage" %><%@ Register TagPrefix="cc" TagName="men...

The Master Page file is not valid. Attach a different Master Page, or correct the problem in the specified Master Page.
 Hi all,I've created a site with a couple of nested Master Pages. Site runs and compiles without error. I need to get it set up in Expressions now so that the non-technical content creators are able to edit it but when I try to attach a Master Page to a newly created file, it just hangs with 'Loading Master Page...'. If I subsequently detach the Master Page, it shows the error: The Master Page file 'http://localhost/layout/images/masterpages/SectionInnerPageChild.Master' is not valid. Attach a different Master Page, or correct the problem in the specified Master Page...

Web resources about - Master page search box to other page -

Master craftsman - Wikipedia, the free encyclopedia
A master craftsman or master tradesman (sometimes called only master or grandmaster , German : Meister ) was a member of a guild . In the European ...

Masters suppliers raise payment concerns
Payment problems at Woolworths' loss-making Masters chain may have contributed to the collapse of one of its suppliers.

Augusta University master plan sees athletic growth
Clint Bryant can step out of the front door of Christen&shy;berry Fieldhouse and see a future soccer field and a new athletic building ahead ...

Donald Trump a master of perceptions?
Former CEO of Apple John Sculley joins CNBC to speak about Donald Trump's presidential campaign.

Now’s the time to become a JavaScript master
JavaScript is key language of the web, and one that no developer can be too familiar with. Whether you’ve been coding for years or are brand ...

‘The Master Cleanse’ SXSW Clip: Who Knows What Evil Lurks In A Clogged Drain?
Here’s a clip from The Master Cleanse , which is described as “a trippy and fantastic journey that examines how we deal with the things that ...

Master & Dynamic's brass earbuds mix style with great sound
So far, I haven't had the best luck with the earbuds I've reviewed: The OnePlus Icons were unremarkable, and though Earin sold me on the idea ...

ExtremeTalk: Let’s talk about the ‘PC Master Race’
I love PC gaming, but there's got to be a better way to label ourselves without referencing actual Nazi ideology.

Google's master plan for pushing the FCC set-top agenda: Get pay-TV's programmatic dollars
While operators say they're moving away from proprietary leased set-tops toward a paradigm of app-based IP-only delivery, there's a very good ...

12 Bright Ideas From The New Money Masters
12 Bright Ideas From The New Money Masters

Resources last updated: 3/9/2016 8:33:04 AM