locked
master page created in Expression Web 4 is not returning any records RRS feed

  • Question

  • Hello

    I have working files (search.aspx and results.aspx). I created a master page (tac.master), so both files (search.aspx and results.aspx) have the top menu information on each page.

    However, when I attach this master page (tac.master), it does not return any records. When I detach the master page (tac.master), it works again. So this master page (tac.master) has something that is causing problems.

    Would you be able to help me?

    /This is a master page./

    <!DOCTYPE html>
    <%@ Master language="C#" %>
    <html>
    <head runat="server">
     <meta charset="utf-8">
     <title>Cascading Menus</title>
     <meta name="author" content="Ralph Phillips">
     
     <!-- internal styles -->
     <style>
     * {
      margin: 0px;
      padding: 0px;
      }
      
     body {
      font-family: verdana;
      padding: 50px;
      }
      
     h1 {
      text-align: center;
      border-bottom: 2px solid #009;
      margin-bottom: 50px;
      }
      
     /* rules for navigation menu */
     /* ========================================== */
     
     ul#navmenu {
      width: 1000px;
      margin: 0px auto;
     }
     ul#navmenu, ul.sub1, ul.sub2 {
      list-style-type: none;
      font-size: 9pt;
      }
      
     ul#navmenu li {
      width: 196px;
      text-align: center;
      ;
      float: left;
      margin-right: 4px;
      }
      
     ul#navmenu a {
      text-decoration: none;
      display: block;
      width: 196px;
      height: 25px;
      line-height: 25px;
      background-color: #FFF;
      border: 1px solid #CCC;
      border-radius: 5px;
      }
      
     ul#navmenu .sub1 li {
      }
      
     ul#navmenu .sub1 a {
      margin-top: 5px;
      }
      
     ul#navmenu .sub2 a {
      margin-left: 3px;
      }
      
     ul#navmenu li:hover > a {
      background-color: #CFC;
      }
      
     ul#navmenu li:hover a:hover {
      background-color: #FF0;
      }
      
     ul#navmenu ul.sub1 {
      display: none;
      ;
      top: 26px;
      left: 0px;
      }
      
     ul#navmenu ul.sub2 {
      display: none;
      ;
      top: 0px;
      left: 196px;
      }
      
     ul#navmenu li:hover .sub1 {
      display: block;
      }
      
     ul#navmenu .sub1 li:hover .sub2 {
      display: block;
      }
      
     .darrow {
      font-size: 11pt;
      ;
      top: 5px;
      right: 4px;
      }
      
     .rarrow {
      font-size: 13pt;
      ;
      top: 6px;
      right: 4px;
      }
     
     .auto-style1 {
     font-size: small;
    }
     
     </style>
     <asp:ContentPlaceHolder id="head" runat="server">
     </asp:ContentPlaceHolder>
    </head>
    <body>
    <form id="form1" runat="server">
    <h1>
    <img alt="" height="40" src="../TAC/Images/logo_official_color.jpg" width="263">&nbsp;</h1>

    <ul id="navmenu">
     <li class="auto-style1"><a href="#">Home</a></li>
     <li><a href="#"><span class="auto-style1">Resouces</span></a><span class="darrow">&#9660;</span>
      <ul class="sub1">
       <li><a href="#">CPB</a><span class="rarrow">&#9654;</span>
        <ul class="sub2">
         <li><a href="hResouces2.1">Oxyganator Comparison</a></li>
         <li><a href="Resouces2.2">SDD, Kitasato University</a></li>
         <li><a href="Resouces2.3">TripleFlow, Tokyo Women's</a></li>
         <li><a href="Resouces2.4">SDD, AmSECT (40th)</a></li>        
        </ul>
       </li>
       <li><a href="#">Cardiology</a><span class="rarrow">&#9654;</span>
        <ul class="sub2">
         <li><a href="Cardiology2.1">SoftNAV Catheter Nishiya</a></li>
        </ul>
       </li>
      </ul>
     <li><a href="#"><span class="auto-style1">Clinical Updates</span></a><span class="darrow">&#9660;</span>
      <ul class="sub1">
       <li><a href="#">CPB</a><span class="rarrow">&#9654;</span>
        <ul class="sub2">
         <li>
         <a href="CPB3.1">SDD Pump 1</a></li>
         <li>
         <a href="CPB3.2">No Blood Transfusion</a></li>
         <li>
         <a href="CPB3.3">SDD Pump 2</a></li>
         <li>
         <a href="CPB3.4">CP-4000 Calafiore</a></li>    
        </ul>
       <li><a href="#">Cardiology</a><span class="rarrow">&#9654;</span>
        <ul class="sub2">
         <li>
         <li><a href="Cardiology3.1">SoftNAV Catheter 1</a></li>
         <li><a href="Cardiology3.2">SoftNAV Catheter 2</a></li>
         <li>
         <a href="Cardiology3.3">SSS Guide Wire 1</a></li>
         <li>
         <a href="Cardiology3.4">SSS Guide Wire 2</a></li>
         <li>
         <a href="Cardiology3.5">SSS Guide Wire 3</a></li>
         <li>
         <a href="Cardiology3.6">SSS Guide Wire 4</a></li>
         <li>
         <a href="Cardiology3.7">SSS Guide Wire 5</a></li>
         <li>
         <a href="Cardiology3.8">SSS Guide Wire 6</a></li>
        </ul>
       </li>
      </ul>
     <li><a href="#"><span class="auto-style1">Products</span></a><span class="darrow">&#9660;</span>
      <ul class="sub1">
       <li><a href="#">CPB</a><span class="rarrow">&#9654;</span>
        <ul class="sub2">
         <li class="auto-style1"><a href="#">Heart Lung Machine History</a></li>
         <li class="auto-style1"><a href="#">Heater Cooler</a></li>
         <li class="auto-style1"><a href="#">Cardioplegia Pump</a></li>
         <li class="auto-style1"><a href="#">SHEF Hert Lung Machine</a></li>
         <li class="auto-style1"><a href="#">Triple Flow</a></li>
        </ul>
       <li><a href="#">Cardiac Surgery</a><span class="rarrow">&#9654;</span>
        <ul class="sub2">
         <li><a href="#">Micro Sucker</a></li>
        </ul>
       <li><a href="#">Cardiology</a><span class="rarrow">&#9654;</span>
        <ul class="sub2">
         <li><a href="#">Myocardial Biopsy Forceps</a></li>
         <li><a href="#">SoftNAV Catheter</a></li>
         <li><a href="#">SSS Guide Wire</a></li>
         <li><a href="#">Trans Radial Essentials</a></li>
        </ul>
       </li>
      </ul>
     </li>
     <li><a href="#"><span class="auto-style1">Useful Tools</span></a><span class="darrow">&#9660;</span>
      <ul class="sub1">
       <li><a href="#">Hematocrit Calculator</a></li>
       <li><a href="#">Body Fat Calculator</a></li>
       <li><a href="#">Unit Conversion Calculator</a></li>
       <li><a href="#">Pressure Unit Matrix</a></li>
       <li><a href="#">Dictionary</a></li>
       <li><a href="#">Dictionary Lite</a></li>
       <li><a href="#">Contrast Media</a></li>   
      </ul>
    </ul>
    <table style="width: 100%">
     <tr>
      <td style="height: 31px"></td>
     </tr>
    </table>
    <br>
        <asp:ContentPlaceHolder id="table" runat="Server">
           <table border="0" width="70%" height="233" style="width: 986px" align="center">
       <tr>
        <td align="center" height="204" style="width: 328px">&nbsp;</td>
        <td align="center" height="204" style="width: 328px">&nbsp;</td>
        <td align="center" height="204" style="width: 328px">&nbsp;</td>
       </tr>
       <tr>
        <td align="center" height="204" style="width: 328px">&nbsp;</td>
        <td align="center" height="204" style="width: 328px" class="auto-style3">
        &nbsp;</td>
        <td align="center" height="204" style="width: 328px">&nbsp;</td>
       </tr>
       <tr>
        <td align="center" height="204" style="width: 328px">&nbsp;</td>
        <td align="center" height="204" style="width: 328px">&nbsp;</td>
        <td align="center" height="204" style="width: 328px">&nbsp;</td>
       </tr>
      </table>
     
     </asp:ContentPlaceHolder>
    </form>
     
    </body>
    </html>

    Tuesday, August 16, 2016 5:31 AM

Answers

  • Your page markup is still wrong.

    Do as I advised on my previous post and clean up the master page (remove that empty table that you aren't using for anything), and create your search and results pages FROM the master page, don't attach it to an existing page.  You aren't doing that correctly, and the markup is such that it's not worth trying to fix.  Start over.



    Kathleen Wilber
    BrightWillow - Asp.Net Applications

    • Marked as answer by Cyber Learning Wednesday, August 24, 2016 10:42 PM
    Monday, August 22, 2016 4:23 AM
  • Listen... er, Cyber, if you are going to ask for advice, then follow it. Kathy is without question the foremost authority on ASP.NET contributing to this forum, and if she gives you a procedure to follow to resolve your issue, do it, don't keep fiddly-f*cking around with your original, failed approach.

    See her post of Wednesday, August 17, 2016 11:06 PM, above, and follow what she said there. Continuing to muck around with your approach (attaching a master page to existing search/result pages) is clearly not working. Kathy has already given you exactly the solution you need, and no matter how many times you come back and ask the same question based upon your approach, her answer is going to be the same—"I already told you what to do, now please do it."

    BTW, thank your lucky stars for ClientIDMode, which only just appeared in ASP.NET 4.0. Prior to that, you had to live with munged Naming Container ID conventions, and it was no fun. Anyway, in the post I referenced above, Kathy has provided all that you need to know to resolve your issue. If you follow her instructions and you are still having issues, then you can come back and ask for help. Until then, you're basically spitting into the wind, and there can be no response other than "Why haven't you done what you were advised to do?"

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.

    • Marked as answer by Cyber Learning Wednesday, August 24, 2016 10:43 PM
    Monday, August 22, 2016 7:40 PM

All replies

  • (Why do you have a blank table in the ContentPlaceHolder area of a master file? That area should be for page-specific content, which is created in the content page.)

    Showing us only the master page doesn't tell us anything about your final page, since it doesn't contain any code that would be functional for a search and result.



    Kathleen Wilber
    BrightWillow - Asp.Net Applications


    • Edited by KathyW2 Wednesday, August 17, 2016 6:38 PM
    Wednesday, August 17, 2016 2:40 AM
  • Kathy, I believe that the search and result code he's talking about is in the pages referenced in this thread, which has already been answered. It would seem that he is now trying to consolidate the search and result functions of those two pages into a single page controlled by this new master page.

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.

    Wednesday, August 17, 2016 7:14 PM
  • Scott,

    Since attaching a master page changes the markup, the original page is not helpful in determining what went wrong.



    Kathleen Wilber
    BrightWillow - Asp.Net Applications


    • Edited by KathyW2 Wednesday, August 17, 2016 8:03 PM
    Wednesday, August 17, 2016 7:52 PM
  • Hello Scot and Kathleen

    Thank you so much for taking the time to look into this. Yes, I simply want the files (search.aspx and results.aspx) to retrieve the top menu from the master page (tac.master) and this function is working and I can see the top menu on search.aspx and results.aspx on my local PC. However, results.aspx is not returning any records. When I detach the master page (tac.master), results.aspx is returning correct records.

    These are search.aspx and results.aspx with master page (tac.master).

    <%@ Page Language="C#" masterpagefile="../TAC/TAC.master" title="Search" %>
    <asp:Content id="Content1" runat="Server" contentplaceholderid="table">
    	<style type="text/css">
    .auto-style1 {
    	margin-bottom: 0px;
    }
    .auto-style2 {
    	text-align: left;
    }
    </style>
    
    <P align=center>&nbsp;<body></body><P align=center class="auto-style2">
    <body>
    
    	<asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
    	<asp:Button id="Button1" runat="server" PostBackUrl="2results.aspx" Text="Search (EN)" CssClass="auto-style1" Height="26px" Width="150px" />
    
    </body>
    	<P align=center class="auto-style2">
    	<body>
    
    	<p>
    	<asp:TextBox id="TextBox2" runat="server"></asp:TextBox>
    	<asp:Button id="Button2" runat="server" PostBackUrl="2results.aspx" Text="Search (JP)" CssClass="auto-style1" Height="26px" Width="150px" />
    	</p>
    	<p>&nbsp;</p>
    
    </body>
    
    </asp:Content>
    
    <%@ Page Language="C#" masterpagefile="../TAC/TAC.master" title="Search Results" %>
    <asp:Content id="Content1" runat="Server" contentplaceholderid="table">
    <style type="text/css">
    .auto-style1 {
    	font-weight: bold;
    	text-align: center;
    }
    .auto-style2 {
    	text-align: center;
    }
    </style>
    	<div class="auto-style2">
    		</div>
    	<p class="auto-style1">Search Results</p>
    	
    &nbsp;<asp:AccessDataSource id="dsn1006984_AccessDataSource1" runat="server" DataFile="~\App_Data\English-Japanese-Dictionary-2008-02-TAC.mdb" SelectCommand="SELECT [English], [Japanese], [Class] FROM [TechnicalWords] WHERE ([English] LIKE '%' + ? + '%')">
    	<SelectParameters>
    			<asp:FormParameter FormField="TextBox1" Name="English" Type="String" />
    		</SelectParameters>
    	</asp:AccessDataSource>
    	<asp:GridView id="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="dsn1006984_AccessDataSource1" HorizontalAlign="Center">
    		<Columns>
    			<asp:BoundField DataField="English" HeaderText="English" SortExpression="English">
    			</asp:BoundField>
    			<asp:BoundField DataField="Japanese" HeaderText="Japanese" SortExpression="Japanese">
    			</asp:BoundField>
    			<asp:BoundField DataField="Class" HeaderText="Class" SortExpression="Class">
    			</asp:BoundField>
    		</Columns>
    	</asp:GridView>
    	<asp:AccessDataSource id="dsn1006984_AccessDataSource2" runat="server" DataFile="~\App_Data\English-Japanese-Dictionary-2008-02-TAC.mdb" SelectCommand="SELECT [English], [Japanese], [Class] FROM [TechnicalWords] WHERE ([Japanese] LIKE '%' + ? + '%')">
    		<SelectParameters>
    			<asp:FormParameter FormField="TextBox2" Name="Japanese" Type="String" />
    		</SelectParameters>
    	</asp:AccessDataSource>
    	<asp:GridView id="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="dsn1006984_AccessDataSource2" HorizontalAlign="Center">
    		<Columns>
    			<asp:BoundField DataField="Japanese" HeaderText="Japanese" SortExpression="Japanese">
    			</asp:BoundField>
    			<asp:BoundField DataField="English" HeaderText="English" SortExpression="English">
    			</asp:BoundField>
    			<asp:BoundField DataField="Class" HeaderText="Class" SortExpression="Class">
    			</asp:BoundField>
    		</Columns>
    	</asp:GridView>
    </asp:Content>
    
    I think I carefully followed the instructions on how to attach a master page on the online tutorial. Do you see anything wrong? Once again, thank you for looking into ths.

    Wednesday, August 17, 2016 10:12 PM
  • Your pages are mal-formed. Your style section should be in the "head" contentplaceholder, not in the "table" contentplaceholder, and you have multiple opening and closing <body> tags in the Search page, when there should be none: the master page contains the body tags.

    Try creating the pages from the master page (File -> New -> Create from Master Page).  Use the Style Pane and Create New Style, set it to be in the current page, and create any style.  Doing that will make EW show you the ContentPlaceHolder in the <head> section.  (You can delete the bogus style you created.)  Put your style section in there, in Code View.  In Design View, use the arrow in the upper right corner of the Content area and select "Create Custom Content.  That will show the code in that ContentPlaceHolder - which you will need to delete because it will bring in that table you put there.  Replace it, in Code View, by pasting in the code from your original page that is *between* (not including) the opening and closing <form> tag.

    Now, a final and very important thing:  When your controls are inside other controls, their id's are not the same as you think they are.  Open your Search page in a browser, and view the source in your browser.  You'll see that the ids of TextBox1 and TextBox2 are no longer TextBox1 and TextBox2.  They are table_TextBox1 and table_TextBox2, because the are inside the ContentPlaceHolder control with id of "table".  That means the form parameters you are passing to the Results page don't exist.

    You have some choices.  One is to use the new ids of the textboxes as the FormFields in your Results page.  Another is to add  ClientIDMode="Static" to the two textboxes: that tells asp.net to leave the control id name alone, and relies on you to not create duplicate ids:

    <asp:TextBox id="TextBox1" ClientIDMode="Static" runat="server"></asp:TextBox>
    and do the same for TextBox2.



    Kathleen Wilber
    BrightWillow - Asp.Net Applications

    Wednesday, August 17, 2016 11:06 PM
  • Scott,

    Since attaching a master page changes the markup, the original page is not helpful in determining what went wrong.



    Kathleen Wilber
    BrightWillow - Asp.Net Applications


    Yeah. I'm hip. If nothing else, the ID changes would scotch things. I just didn't know if you were aware what he was trying to do..

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.

    Wednesday, August 17, 2016 11:10 PM
  • Hello Scott and Kathleen

    Thank you again for providing some advice for this. I have been working on this and still have some difficulties. I cleaned the codes on all three pages (default1.master, search.aspx and results.aspx). Would you please look at the codes once again?

    This is a master page.

    <!DOCTYPE html> <%@ Master language="C#" %> <html> <head runat="server"> <meta charset="utf-8"> <title>TAC</title> <meta name="author" content="Ralph"> <asp:ContentPlaceHolder id="head" runat="server"> <!-- internal styles --> <style> * { margin: 0px; padding: 0px; } body { font-family: verdana; padding: 50px; } h1 { text-align: center; border-bottom: 2px solid #009; margin-bottom: 50px; } /* rules for navigation menu */ /* ========================================== */ ul#navmenu { width: 1000px; margin: 0px auto; } ul#navmenu, ul.sub1, ul.sub2 { list-style-type: none; font-size: 9pt; } ul#navmenu li { width: 196px; text-align: center; ; float: left; margin-right: 4px; } ul#navmenu a { text-decoration: none; display: block; width: 196px; height: 25px; line-height: 25px; background-color: #FFF; border: 1px solid #CCC; border-radius: 5px; } ul#navmenu .sub1 li { } ul#navmenu .sub1 a { margin-top: 5px; } ul#navmenu .sub2 a { margin-left: 3px; } ul#navmenu li:hover > a { background-color: #CFC; } ul#navmenu li:hover a:hover { background-color: #FF0; } ul#navmenu ul.sub1 { display: none; ; top: 26px; left: 0px; } ul#navmenu ul.sub2 { display: none; ; top: 0px; left: 196px; } ul#navmenu li:hover .sub1 { display: block; } ul#navmenu .sub1 li:hover .sub2 { display: block; } .darrow { font-size: 11pt; ; top: 5px; right: 4px; } .rarrow { font-size: 13pt; ; top: 6px; right: 4px; } .auto-style1 { font-size: small; } </style> </asp:ContentPlaceHolder> </head> <form id="form1" runat="server"> <body> <h1> <img alt="" height="40" src="../TAC/Images/logo_official_color.jpg" width="263">&nbsp;</h1> <ul id="navmenu"> <li class="auto-style1"><a href="#">Home</a></li> <li><a href="#"><span class="auto-style1">Resouces</span></a><span class="darrow">&#9660;</span> <ul class="sub1"> <li><a href="#">CPB</a><span class="rarrow">&#9654;</span> <ul class="sub2"> <li><a href="#">Oxyganator Comparison</a></li> <li><a href="#">SDD, Kitasato University</a></li> <li><a href="#">TripleFlow, Tokyo Women's</a></li> <li><a href="#">SDD, AmSECT (40th)</a></li> </ul> </li> <li><a href="#">Cardiology</a><span class="rarrow">&#9654;</span> <ul class="sub2"> <li><a href="SoftNAV Catheter Nishiya</a></li> </ul> </li> </ul> <li><a href="#"><span class="auto-style1">Clinical Updates</span></a><span class="darrow">&#9660;</span> <ul class="sub1"> <li><a href="#">CPB</a><span class="rarrow">&#9654;</span> <ul class="sub2"> <li> <a href="#">SDD Pump 1</a></li> <li> <a href="#">No Blood Transfusion</a></li> <li> <a href="#">SDD Pump 2</a></li> <li> <a href="#">CP-4000 Calafiore</a></li> </ul> <li><a href="#">Cardiology</a><span class="rarrow">&#9654;</span> <ul class="sub2"> <li> <li><a href="#">SoftNAV Catheter 1</a></li> <li><a href="#">SoftNAV Catheter 2</a></li> <li> <a href="#">SSS Guide Wire 1</a></li> <li> <a href="#">SSS Guide Wire 2</a></li> <li> <a href="#">SSS Guide Wire 3</a></li> <li> <a href="#">SSS Guide Wire 4</a></li> <li> <a href="#">SSS Guide Wire 5</a></li> <li> <a href="#">SSS Guide Wire 6</a></li> </ul> </li> </ul> <li><a href="#"><span class="auto-style1">Products</span></a><span class="darrow">&#9660;</span> <ul class="sub1"> <li><a href="#">CPB</a><span class="rarrow">&#9654;</span> <ul class="sub2"> <li class="auto-style1"><a href="#">Heart Lung Machine History</a></li> <li class="auto-style1"><a href="#">Heater Cooler</a></li> <li class="auto-style1"><a href="#">Cardioplegia Pump</a></li> <li class="auto-style1"><a href="#">SHEF Hert Lung Machine</a></li> <li class="auto-style1"><a href="#">Triple Flow</a></li> </ul> <li><a href="#">Cardiac Surgery</a><span class="rarrow">&#9654;</span> <ul class="sub2"> <li><a href="#">Micro Sucker</a></li> </ul> <li><a href="#">Cardiology</a><span class="rarrow">&#9654;</span> <ul class="sub2"> <li><a href="#">Myocardial Biopsy Forceps</a></li> <li><a href="#">SoftNAV Catheter</a></li> <li><a href="#">SSS Guide Wire</a></li> <li><a href="#">Trans Radial Essentials</a></li> </ul> </li> </ul> </li> <li><a href="#"><span class="auto-style1">Useful Tools</span></a><span class="darrow">&#9660;</span> <ul class="sub1"> <li><a href="#">Hematocrit Calculator</a></li> <li><a href="#">Body Fat Calculator</a></li> <li><a href="#">Unit Conversion Calculator</a></li> <li><a href="#">Pressure Unit Matrix</a></li> <li><a href="#">Dictionary</a></li> <li><a href="#">Dictionary Lite</a></li> <li><a href="#">Contrast Media</a></li> </ul> </ul> <table style="width: 100%"> <tr> <td style="height: 31px"></td> </tr> </table> <br> <asp:ContentPlaceHolder id="table" runat="Server"> <table border="0" width="70%" height="233" style="width: 986px" align="center"> <tr> <td align="center" height="204" style="width: 328px">&nbsp;</td> <td align="center" height="204" style="width: 328px">&nbsp;</td> <td align="center" height="204" style="width: 328px">&nbsp;</td> </tr> <tr> <td align="center" height="204" style="width: 328px">&nbsp;</td> <td align="center" height="204" style="width: 328px" class="auto-style3"> &nbsp;</td> <td align="center" height="204" style="width: 328px">&nbsp;</td> </tr> <tr> <td align="center" height="204" style="width: 328px">&nbsp;</td> <td align="center" height="204" style="width: 328px">&nbsp;</td> <td align="center" height="204" style="width: 328px">&nbsp;</td> </tr> </table> </asp:ContentPlaceHolder> </body> </form>

    This is a search.aspx (I detached default1.master, but the reference still is on the top). Then, it brings results on results.aspx

    <%@ Page Language="C#" masterpagefile="../TAC/default1.master" title="Search" %>
    <asp:Content id="Content1" runat="Server" contentplaceholderid="table">
    	<p>
    	<div class="auto-style2">
    	Seach
    	</div>
    <br>
    	<asp:TextBox id="TextBox1" ClientIDMode="Static" runat="server"></asp:TextBox>
    	<asp:Button id="Button1" runat="server" Text="Button" PostBackUrl="results.aspx" />
    	
    	<br>
    	<asp:TextBox id="TextBox2" ClientIDMode="Static" runat="server"></asp:TextBox>
    	<asp:Button id="Button2" runat="server" Text="Button" PostBackUrl="results.aspx" />
    </p>
    </asp:Content>
    <asp:Content id="Content2" runat="server" contentplaceholderid="head">
    	<!-- internal styles -->
    	<style>
    
    
    	* {
    		margin: 0px;
    		padding: 0px;
    		}
    		
    	body {
    		font-family: verdana;
    		padding: 50px;
    		}
    		
    	h1 {
    		text-align: center;
    		border-bottom: 2px solid #009;
    		margin-bottom: 50px;
    		}
    		
    	/* rules for navigation menu */
    	/* ========================================== */
    	
    	ul#navmenu {
    		width: 1000px;
    		margin: 0px auto;
    	}
    
    	ul#navmenu, ul.sub1, ul.sub2 {
    		list-style-type: none;
    		font-size: 9pt;
    		}
    		
    	ul#navmenu li {
    		width: 196px;
    		text-align: center;
    		;
    		float: left;
    		margin-right: 4px;
    		}
    		
    	ul#navmenu a {
    		text-decoration: none;
    		display: block;
    		width: 196px;
    		height: 25px;
    		line-height: 25px;
    		background-color: #FFF;
    		border: 1px solid #CCC;
    		border-radius: 5px;
    		}
    		
    	ul#navmenu .sub1 li {
    		}
    		
    	ul#navmenu .sub1 a {
    		margin-top: 5px;
    		}
    		
    	ul#navmenu .sub2 a {
    		margin-left: 3px;
    		}
    		
    	ul#navmenu li:hover > a {
    		background-color: #CFC;
    		}
    		
    	ul#navmenu li:hover a:hover {
    		background-color: #FF0;
    		}
    		
    	ul#navmenu ul.sub1 {
    		display: none;
    		;
    		top: 26px;
    		left: 0px;
    		}
    		
    	ul#navmenu ul.sub2 {
    		display: none;
    		;
    		top: 0px;
    		left: 196px;
    		}
    		
    	ul#navmenu li:hover .sub1 {
    		display: block;
    		}
    		
    	ul#navmenu .sub1 li:hover .sub2 {
    		display: block;
    		}
    		
    	.darrow {
    		font-size: 11pt;
    		;
    		top: 5px;
    		right: 4px;
    		}
    		
    	.rarrow {
    		font-size: 13pt;
    		;
    		top: 6px;
    		right: 4px;
    		}
    	
    	.auto-style1 {
    	font-size: small;
    }
    	
    	</style>
    	<style type="text/css">
    .auto-style2 {
    	text-align: center;
    }
    </style>
    </asp:Content>

    This is a search.aspx (default1.master is attached). Then, it does NOT bring results on results.aspx

    <%@ Page Language="C#" title="Search" masterpagefile="../TAC/default1.master" %>
    <asp:Content id="Content1" runat="Server" contentplaceholderid="table">
    <body>
    
    <table style="width: 100%">
    	<tr>
    		<td style="height: 31px"></td>
    	</tr>
    </table>
    <br>
    	<p>
    	<div class="auto-style2">
    	Seach
    	</div>
    <br>
    	<asp:TextBox id="TextBox1" ClientIDMode="Static" runat="server"></asp:TextBox>
    	<asp:Button id="Button1" runat="server" Text="Button" PostBackUrl="results.aspx" />
    	<br>
    	<asp:TextBox id="TextBox2" ClientIDMode="Static" runat="server"></asp:TextBox>
    	<asp:Button id="Button2" runat="server" Text="Button" PostBackUrl="results.aspx" />
    </p>
      
    </body>
    </asp:Content>
    <asp:Content id="Content2" runat="server" contentplaceholderid="head">
    	<!-- internal styles -->
    	<style>
    
    	* {
    		margin: 0px;
    		padding: 0px;
    		}
    		
    	body {
    		font-family: verdana;
    		padding: 50px;
    		}
    		
    	h1 {
    		text-align: center;
    		border-bottom: 2px solid #009;
    		margin-bottom: 50px;
    		}
    		
    	/* rules for navigation menu */
    	/* ========================================== */
    	
    	ul#navmenu {
    		width: 1000px;
    		margin: 0px auto;
    	}
    
    	ul#navmenu, ul.sub1, ul.sub2 {
    		list-style-type: none;
    		font-size: 9pt;
    		}
    		
    	ul#navmenu li {
    		width: 196px;
    		text-align: center;
    		;
    		float: left;
    		margin-right: 4px;
    		}
    		
    	ul#navmenu a {
    		text-decoration: none;
    		display: block;
    		width: 196px;
    		height: 25px;
    		line-height: 25px;
    		background-color: #FFF;
    		border: 1px solid #CCC;
    		border-radius: 5px;
    		}
    		
    	ul#navmenu .sub1 li {
    		}
    		
    	ul#navmenu .sub1 a {
    		margin-top: 5px;
    		}
    		
    	ul#navmenu .sub2 a {
    		margin-left: 3px;
    		}
    		
    	ul#navmenu li:hover > a {
    		background-color: #CFC;
    		}
    		
    	ul#navmenu li:hover a:hover {
    		background-color: #FF0;
    		}
    		
    	ul#navmenu ul.sub1 {
    		display: none;
    		;
    		top: 26px;
    		left: 0px;
    		}
    		
    	ul#navmenu ul.sub2 {
    		display: none;
    		;
    		top: 0px;
    		left: 196px;
    		}
    		
    	ul#navmenu li:hover .sub1 {
    		display: block;
    		}
    		
    	ul#navmenu .sub1 li:hover .sub2 {
    		display: block;
    		}
    		
    	.darrow {
    		font-size: 11pt;
    		;
    		top: 5px;
    		right: 4px;
    		}
    		
    	.rarrow {
    		font-size: 13pt;
    		;
    		top: 6px;
    		right: 4px;
    		}
    	
    	.auto-style1 {
    	font-size: small;
    }
    	
    	</style>
    	<style>
    
    
    	* {
    		margin: 0px;
    		padding: 0px;
    		}
    		
    	body {
    		font-family: verdana;
    		padding: 50px;
    		}
    		
    	h1 {
    		text-align: center;
    		border-bottom: 2px solid #009;
    		margin-bottom: 50px;
    		}
    		
    	/* rules for navigation menu */
    	/* ========================================== */
    	
    	ul#navmenu {
    		width: 1000px;
    		margin: 0px auto;
    	}
    
    	ul#navmenu, ul.sub1, ul.sub2 {
    		list-style-type: none;
    		font-size: 9pt;
    		}
    		
    	ul#navmenu li {
    		width: 196px;
    		text-align: center;
    		;
    		float: left;
    		margin-right: 4px;
    		}
    		
    	ul#navmenu a {
    		text-decoration: none;
    		display: block;
    		width: 196px;
    		height: 25px;
    		line-height: 25px;
    		background-color: #FFF;
    		border: 1px solid #CCC;
    		border-radius: 5px;
    		}
    		
    	ul#navmenu .sub1 li {
    		}
    		
    	ul#navmenu .sub1 a {
    		margin-top: 5px;
    		}
    		
    	ul#navmenu .sub2 a {
    		margin-left: 3px;
    		}
    		
    	ul#navmenu li:hover > a {
    		background-color: #CFC;
    		}
    		
    	ul#navmenu li:hover a:hover {
    		background-color: #FF0;
    		}
    		
    	ul#navmenu ul.sub1 {
    		display: none;
    		;
    		top: 26px;
    		left: 0px;
    		}
    		
    	ul#navmenu ul.sub2 {
    		display: none;
    		;
    		top: 0px;
    		left: 196px;
    		}
    		
    	ul#navmenu li:hover .sub1 {
    		display: block;
    		}
    		
    	ul#navmenu .sub1 li:hover .sub2 {
    		display: block;
    		}
    		
    	.darrow {
    		font-size: 11pt;
    		;
    		top: 5px;
    		right: 4px;
    		}
    		
    	.rarrow {
    		font-size: 13pt;
    		;
    		top: 6px;
    		right: 4px;
    		}
    	
    	</style>
    	<style type="text/css">
    .auto-style2 {
    	text-align: center;
    }
    	</style>
    </asp:Content>

    This is a result.aspx (default1.master is attached). It brings results only when search.aspx (default1.master is detached; the reference still is on the top) is used.

    <%@ Page Language="C#" masterpagefile="../TAC/default1.master" title="Search Results" %>
    <asp:Content id="Content1" runat="server" contentplaceholderid="table">
    	<p>
    	<div class="auto-style2">
    	Seach Results
    	</div>
    	<asp:AccessDataSource id="dsn1006984_AccessDataSource1" runat="server" DataFile="App_Data/English-Japanese-Dictionary-2008-02-TAC.mdb" SelectCommand="SELECT [English], [Japanese], [Class] FROM [TechnicalWords] WHERE ([English] LIKE '%' + ? + '%')">
    		<SelectParameters>
    			<asp:FormParameter FormField="TextBox1" Name="English" Type="String" />
    		</SelectParameters>
    	</asp:AccessDataSource>
    	<asp:GridView id="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="dsn1006984_AccessDataSource1">
    		<Columns>
    			<asp:BoundField DataField="English" HeaderText="English" SortExpression="English">
    			</asp:BoundField>
    			<asp:BoundField DataField="Japanese" HeaderText="Japanese" SortExpression="Japanese">
    			</asp:BoundField>
    			<asp:BoundField DataField="Class" HeaderText="Class" SortExpression="Class">
    			</asp:BoundField>
    		</Columns>
    	</asp:GridView>
    	<br>
    	<asp:AccessDataSource id="dsn1006984_AccessDataSource2" runat="server" DataFile="App_Data/English-Japanese-Dictionary-2008-02-TAC.mdb" SelectCommand="SELECT [English], [Japanese], [Class] FROM [TechnicalWords] WHERE ([Japanese] LIKE '%' + ? + '%')">
    		<SelectParameters>
    			<asp:FormParameter FormField="TextBox2" Name="Japanese" Type="String" />
    		</SelectParameters>
    	</asp:AccessDataSource>
    	<asp:GridView id="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="dsn1006984_AccessDataSource2">
    		<Columns>
    			<asp:BoundField DataField="English" HeaderText="English" SortExpression="English">
    			</asp:BoundField>
    			<asp:BoundField DataField="Japanese" HeaderText="Japanese" SortExpression="Japanese">
    			</asp:BoundField>
    			<asp:BoundField DataField="Class" HeaderText="Class" SortExpression="Class">
    			</asp:BoundField>
    		</Columns>
    	</asp:GridView>
    	</p>
    	<p>&nbsp;</p>
    	<p>&nbsp;</p>
    </asp:Content>
    <asp:Content id="Content2" runat="server" contentplaceholderid="head">
    	<!-- internal styles -->
    	<style>
    
    
    	* {
    		margin: 0px;
    		padding: 0px;
    		}
    		
    	body {
    		font-family: verdana;
    		padding: 50px;
    		}
    		
    	h1 {
    		text-align: center;
    		border-bottom: 2px solid #009;
    		margin-bottom: 50px;
    		}
    		
    	/* rules for navigation menu */
    	/* ========================================== */
    	
    	ul#navmenu {
    		width: 1000px;
    		margin: 0px auto;
    	}
    
    	ul#navmenu, ul.sub1, ul.sub2 {
    		list-style-type: none;
    		font-size: 9pt;
    		}
    		
    	ul#navmenu li {
    		width: 196px;
    		text-align: center;
    		;
    		float: left;
    		margin-right: 4px;
    		}
    		
    	ul#navmenu a {
    		text-decoration: none;
    		display: block;
    		width: 196px;
    		height: 25px;
    		line-height: 25px;
    		background-color: #FFF;
    		border: 1px solid #CCC;
    		border-radius: 5px;
    		}
    		
    	ul#navmenu .sub1 li {
    		}
    		
    	ul#navmenu .sub1 a {
    		margin-top: 5px;
    		}
    		
    	ul#navmenu .sub2 a {
    		margin-left: 3px;
    		}
    		
    	ul#navmenu li:hover > a {
    		background-color: #CFC;
    		}
    		
    	ul#navmenu li:hover a:hover {
    		background-color: #FF0;
    		}
    		
    	ul#navmenu ul.sub1 {
    		display: none;
    		;
    		top: 26px;
    		left: 0px;
    		}
    		
    	ul#navmenu ul.sub2 {
    		display: none;
    		;
    		top: 0px;
    		left: 196px;
    		}
    		
    	ul#navmenu li:hover .sub1 {
    		display: block;
    		}
    		
    	ul#navmenu .sub1 li:hover .sub2 {
    		display: block;
    		}
    		
    	.darrow {
    		font-size: 11pt;
    		;
    		top: 5px;
    		right: 4px;
    		}
    		
    	.rarrow {
    		font-size: 13pt;
    		;
    		top: 6px;
    		right: 4px;
    		}
    	
    	.auto-style1 {
    	font-size: small;
    }
    	
    	</style>
    	<style type="text/css">
    .auto-style2 {
    	text-align: center;
    }
    </style>
    </asp:Content>
    

    So, something may be wrong on search.aspx (default1.master is attached). I know that this post is long and I apologize. But I think I am getting close. It will be greatly appreciated if you can correct errors on search.aspx (default1.master is attached). I am still testing on my local PC. Once again, thank you for your contribution.


    Monday, August 22, 2016 1:01 AM
  • Your page markup is still wrong.

    Do as I advised on my previous post and clean up the master page (remove that empty table that you aren't using for anything), and create your search and results pages FROM the master page, don't attach it to an existing page.  You aren't doing that correctly, and the markup is such that it's not worth trying to fix.  Start over.



    Kathleen Wilber
    BrightWillow - Asp.Net Applications

    • Marked as answer by Cyber Learning Wednesday, August 24, 2016 10:42 PM
    Monday, August 22, 2016 4:23 AM
  • Listen... er, Cyber, if you are going to ask for advice, then follow it. Kathy is without question the foremost authority on ASP.NET contributing to this forum, and if she gives you a procedure to follow to resolve your issue, do it, don't keep fiddly-f*cking around with your original, failed approach.

    See her post of Wednesday, August 17, 2016 11:06 PM, above, and follow what she said there. Continuing to muck around with your approach (attaching a master page to existing search/result pages) is clearly not working. Kathy has already given you exactly the solution you need, and no matter how many times you come back and ask the same question based upon your approach, her answer is going to be the same—"I already told you what to do, now please do it."

    BTW, thank your lucky stars for ClientIDMode, which only just appeared in ASP.NET 4.0. Prior to that, you had to live with munged Naming Container ID conventions, and it was no fun. Anyway, in the post I referenced above, Kathy has provided all that you need to know to resolve your issue. If you follow her instructions and you are still having issues, then you can come back and ask for help. Until then, you're basically spitting into the wind, and there can be no response other than "Why haven't you done what you were advised to do?"

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.

    • Marked as answer by Cyber Learning Wednesday, August 24, 2016 10:43 PM
    Monday, August 22, 2016 7:40 PM
  • Hello Kathleen and Scott

    I'm sorry for my poor understanding on the Asp.NET causing you to follow-up to unnecessary replies. I removed tables from the master page. I created search and results pages again. Then I realized that the control names for TextBox1 and TextBox2 were changed with ctl00$ContentPlaceHolder1$ on the web browser. So I added this extra onto TextBox1 and TextBox2 to FormField of FormParameter on results page. Of course I am using ClientIDMode="Static" as well. Now it is working.

    Once again, thank you for being so patient. I am a slow learner. I sincerely appreciate your help.

    Wednesday, August 24, 2016 10:44 PM