| | |
RequiredFieldValidator AND ContentPlaceHolderID
Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Feb 2008
Posts: 5
Reputation:
Solved Threads: 0
I am net to asp.net, I am having the following issue. I have developed a masterpage. The masterpage has a left navigation panel. I have another page that uses the masterpage and fieldvalidations in it as well, when I view the page it seems that the page with the navigation is left justified and covers the left pane and the menu. when I remove the validation the page displays correctly. is this a bug in ASP or am I doing something incorrectly.
Thanks in advance for help and support
Thanks in advance for help and support
•
•
Join Date: Sep 2007
Posts: 1,080
Reputation:
Solved Threads: 68
with your validation, you have 2 types of display, static and dynamic.
Static basically displays the information, but masks it (equivalent to visibility:none in css), where Dynamic hides it all together as if it isn't there (equivalent to display:none in css).
Try moving the validation to a different point on the page and check the Display attribute to make sure it isn't disrupting your layout.
Static basically displays the information, but masks it (equivalent to visibility:none in css), where Dynamic hides it all together as if it isn't there (equivalent to display:none in css).
Try moving the validation to a different point on the page and check the Display attribute to make sure it isn't disrupting your layout.
•
•
Join Date: Feb 2008
Posts: 5
Reputation:
Solved Threads: 0
I Thank you so much for your help and support, it is truly appreciated. As I "mistyped" yesterday I am relatively new to asp.net. Here is what I’ve done so far based on your suggestions. I have tried all the display type values, then I have moved the validation to another location and I am having the same difficultly. Could the issue be caused by using a table in my masterpage, then a separate table my content page. I am not sure of protocol as to attachments and screenshots.
•
•
Join Date: Feb 2008
Posts: 5
Reputation:
Solved Threads: 0
You are a wonderful person for taking this time and reviewing my code. I truly appreciate your support, thank you so much. I like to keep thinks easy, simple and documented as you can see.
My MasterPage
<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<!-- code -->
<head runat="server">
<title>ics Master</title>
<link href="Master.css" rel="stylesheet" type="text/css" />
</head>
<body bottommargin="0" topmargin="0">
<form id="form1" runat="server">
<div> <table id="MainTable"> <!-- div Fullpage table -->
<tr> <!-- First row topheader -->
<td id="TopHeader" colspan="2" >
</td>
</tr>
<tr> <!-- Second row Company Title -->
<td id="Title" colspan="2" style="filter:progid
XImageTransform.Microsoft.Gradient(endColorstr='blue', startColorstr='white', gradientType='1'); height: 10px;">
<h2> ICS Consulting</h2>
</td>
</tr>
<tr> <!-- Third row, 2 columns first column is the menu second col is for content -->
<td id="LeftPanel" >
<ul id="mainnav" >
<li><a href="Default.aspx" > Home </a> </li>
<li><a href='Aboutus.aspx'>About Us</a></li>
<li><a href='Services.aspx'>Services</a></li>
<li><a href='Industries.aspx'>Industries</a></li>
<li><a href='contact.aspx'>Contact Us</a></li>
</ul>
</td>
<td id="RightPanel">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</td>
</tr>
<tr>
<td id="Footer" colspan="2" >
Copyright © 2008 ICS Consulting LLC, Inc.
</td>
</tr>
</table>
</div> <!-- End div Fullpage table -->
</form>
</body>
</html>
----Contact Page
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master"
AutoEventWireup="false" CodeFile="contact.aspx.vb" Inherits="_contact" %>
<asp:Content ID="Content1" runat="server"
ContentPlaceHolderID="ContentPlaceHolder1">
<h1> Contact Us </h1>
<table id="ContactTable" >
<tr> <!-- Row 1 -->
<td style="width: 112px; height: 26px;"> Name</td>
<td style="width: 214px; height: 26px;">
<asp:TextBox ID="txtName" runat="server" Width="272px"></asp:TextBox>
</td>
<td style="width: 131px; height: 26px;">
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName"
ErrorMessage="*"></asp:RequiredFieldValidator></td>
</tr>
<tr><!-- Row 2 -->
<td style="width: 112px; height: 26px;"> E-mail</td>
<td style="width: 214px; height: 26px;">
<asp:TextBox ID="txtEmail" runat="server" Width="272px"></asp:TextBox>
</td>
<td style="width: 131px; height: 26px;">
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtEmail"
ErrorMessage="*"></asp:RequiredFieldValidator></td>
</tr>
<tr><!-- Row 3 -->
<td style="width: 112px; height: 153px"> Comments/ Feedback</td>
<td style="width: 214px; height: 153px" valign="baseline">
<asp:TextBox ID="txtComments" runat="server" Height="104px" TextMode="MultiLine"
Width="272px"></asp:TextBox></td>
<td style="width: 131px; height: 163px">
</td>
</tr>
<tr><!-- Row 4 -->
<td style="width: 112px; height: 19px"> </td>
<td align="right" style="width: 214px; height: 19px" valign="baseline">
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click1" Text="Send" /></td>
<td style="width: 131px; height: 19px" valign="bottom">
</td>
</tr>
<tr><!-- Row 5 -->
<td style="width: 214px; height: 70px">
</td>
<td style="width: 131px; height: 70px" valign="bottom">
<asp:ValidationSummary ID="ValidationSummary1" runat="server" Width="264px" />
</td>
</tr>
<tr><!-- Row 6 -->
<td colspan="3" style="text-align: center; height: 8px; ">
</td>
</tr>
</table>
</asp:Content>
My MasterPage
<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<!-- code -->
<head runat="server">
<title>ics Master</title>
<link href="Master.css" rel="stylesheet" type="text/css" />
</head>
<body bottommargin="0" topmargin="0">
<form id="form1" runat="server">
<div> <table id="MainTable"> <!-- div Fullpage table -->
<tr> <!-- First row topheader -->
<td id="TopHeader" colspan="2" >
</td>
</tr>
<tr> <!-- Second row Company Title -->
<td id="Title" colspan="2" style="filter:progid
XImageTransform.Microsoft.Gradient(endColorstr='blue', startColorstr='white', gradientType='1'); height: 10px;"><h2> ICS Consulting</h2>
</td>
</tr>
<tr> <!-- Third row, 2 columns first column is the menu second col is for content -->
<td id="LeftPanel" >
<ul id="mainnav" >
<li><a href="Default.aspx" > Home </a> </li>
<li><a href='Aboutus.aspx'>About Us</a></li>
<li><a href='Services.aspx'>Services</a></li>
<li><a href='Industries.aspx'>Industries</a></li>
<li><a href='contact.aspx'>Contact Us</a></li>
</ul>
</td>
<td id="RightPanel">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</td>
</tr>
<tr>
<td id="Footer" colspan="2" >
Copyright © 2008 ICS Consulting LLC, Inc.
</td>
</tr>
</table>
</div> <!-- End div Fullpage table -->
</form>
</body>
</html>
----Contact Page
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master"
AutoEventWireup="false" CodeFile="contact.aspx.vb" Inherits="_contact" %>
<asp:Content ID="Content1" runat="server"
ContentPlaceHolderID="ContentPlaceHolder1">
<h1> Contact Us </h1>
<table id="ContactTable" >
<tr> <!-- Row 1 -->
<td style="width: 112px; height: 26px;"> Name</td>
<td style="width: 214px; height: 26px;">
<asp:TextBox ID="txtName" runat="server" Width="272px"></asp:TextBox>
</td>
<td style="width: 131px; height: 26px;">
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName"
ErrorMessage="*"></asp:RequiredFieldValidator></td>
</tr>
<tr><!-- Row 2 -->
<td style="width: 112px; height: 26px;"> E-mail</td>
<td style="width: 214px; height: 26px;">
<asp:TextBox ID="txtEmail" runat="server" Width="272px"></asp:TextBox>
</td>
<td style="width: 131px; height: 26px;">
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtEmail"
ErrorMessage="*"></asp:RequiredFieldValidator></td>
</tr>
<tr><!-- Row 3 -->
<td style="width: 112px; height: 153px"> Comments/ Feedback</td>
<td style="width: 214px; height: 153px" valign="baseline">
<asp:TextBox ID="txtComments" runat="server" Height="104px" TextMode="MultiLine"
Width="272px"></asp:TextBox></td>
<td style="width: 131px; height: 163px">
</td>
</tr>
<tr><!-- Row 4 -->
<td style="width: 112px; height: 19px"> </td>
<td align="right" style="width: 214px; height: 19px" valign="baseline">
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click1" Text="Send" /></td>
<td style="width: 131px; height: 19px" valign="bottom">
</td>
</tr>
<tr><!-- Row 5 -->
<td style="width: 214px; height: 70px">
</td>
<td style="width: 131px; height: 70px" valign="bottom">
<asp:ValidationSummary ID="ValidationSummary1" runat="server" Width="264px" />
</td>
</tr>
<tr><!-- Row 6 -->
<td colspan="3" style="text-align: center; height: 8px; ">
</td>
</tr>
</table>
</asp:Content>
•
•
Join Date: Feb 2008
Posts: 5
Reputation:
Solved Threads: 0
I appologize, is this correct?
ASP.NET Syntax (Toggle Plain Text)
<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <!-- code --> <head runat="server"> <title>LDA Master</title> <link href="Master.css" rel="stylesheet" type="text/css" /> </head> <body bottommargin="0" topmargin="0"> <form id="form1" runat="server"> <div> <table id="MainTable"> <!-- div Fullpage table --> <tr> <!-- First row topheader --> <td id="TopHeader" colspan="2" > </td> </tr> <tr> <!-- Second row Company Title --> <td id="Title" colspan="2" style="filter:progid:DXImageTransform.Microsoft.Gradient(endColorstr='blue', startColorstr='white', gradientType='1'); height: 10px;"> <h2> ICS Consulting</h2> </td> </tr> <tr> <!-- Third row, 2 columns first column is the menu second col is for content --> <td id="LeftPanel" > <ul id="mainnav" > <li><a href="Default.aspx" > Home </a> </li> <li><a href='Aboutus.aspx'>About Us</a></li> <li><a href='Services.aspx'>Services</a></li> <li><a href='Industries.aspx'>Industries</a></li> <li><a href='contact.aspx'>Contact Us</a></li> </ul> </td> <td id="RightPanel"> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </td> </tr> <tr> <td id="Footer" colspan="2" > Copyright © 2008 ICS Consulting LLC, Inc. </td> </tr> </table> </div> <!-- End div Fullpage table --> </form> </body> </html>
ASP.NET Syntax (Toggle Plain Text)
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="contact.aspx.vb" Inherits="_contact" %> <asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1"> <h1> Contact Us </h1> <table id="ContactTable" > <tr> <!-- Row 1 --> <td style="width: 112px; height: 26px;"> Name</td> <td style="width: 214px; height: 26px;"> <asp:TextBox ID="txtName" runat="server" Width="272px"></asp:TextBox> </td> <td style="width: 131px; height: 26px;"> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName" ErrorMessage="*"></asp:RequiredFieldValidator></td> </tr> <tr><!-- Row 2 --> <td style="width: 112px; height: 26px;"> E-mail</td> <td style="width: 214px; height: 26px;"> <asp:TextBox ID="txtEmail" runat="server" Width="272px"></asp:TextBox> </td> <td style="width: 131px; height: 26px;"> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtEmail" ErrorMessage="*"></asp:RequiredFieldValidator></td> </tr> <tr><!-- Row 3 --> <td style="width: 112px; height: 153px"> Comments/ Feedback</td> <td style="width: 214px; height: 153px" valign="baseline"> <asp:TextBox ID="txtComments" runat="server" Height="104px" TextMode="MultiLine" Width="272px"></asp:TextBox></td> <td style="width: 131px; height: 163px"> </td> </tr> <tr><!-- Row 4 --> <td style="width: 112px; height: 19px"> </td> <td align="right" style="width: 214px; height: 19px" valign="baseline"> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click1" Text="Send" /></td> <td style="width: 131px; height: 19px" valign="bottom"> </td> </tr> <tr><!-- Row 5 --> <td style="width: 214px; height: 70px"> </td> <td style="width: 131px; height: 70px" valign="bottom"> <asp:ValidationSummary ID="ValidationSummary1" runat="server" Width="264px" /> </td> </tr> <tr><!-- Row 6 --> <td colspan="3" style="text-align: center; height: 8px; "> </td> </tr> </table> </asp:Content>
•
•
Join Date: Sep 2007
Posts: 1,080
Reputation:
Solved Threads: 68
You should lose the space on the master page right above your contentplaceholder. If you are looking to create a new line, type in <br />. However, every browser will handle that space differently, so layout will change from browser to browser.
If you look at row 5 where you have validation summary, that "TD" cell has a set width of 131 px. However, your validation summar has a width of 264px, that's why it's messing up. Match up the widths or combine some cells to get the width needed.
If you look at row 5 where you have validation summary, that "TD" cell has a set width of 131 px. However, your validation summar has a width of 264px, that's why it's messing up. Match up the widths or combine some cells to get the width needed.
![]() |
Similar Threads
- Validation difficulties *sigh* (ASP.NET)
- Login used to work (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: User Control
- Next Thread: hide/show part of form using client side code for ASP.NET
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 activexcontrol advice ajax alltypeofvideos anathor application asp asp.net bc30451 bottomasp.net browser button c# c#gridviewcolumn checkbox click commonfunctions confirmationcodegeneration courier css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dynamically edit expose feedback fill flash form formatdecimal forms formview google grid gridview homeedition hosting iframe iis javascript jquery list listbox login microsoft mono mouse mssql multistepregistration news numerical objects opera panelmasterpagebuttoncontrols parent project radio registration reportemail richtextbox rotatepage save schoolproject search security silverlight smartcard smoobjects software sql-server sqlserver2005 suse textbox tracking unauthorized validation vb.net video videos view virtualdirectory vista visualstudio web webapplications webdevelopemnt webprogramming webservice xml xsl youareanotmemberofthedebuggerusers






