RequiredFieldValidator AND ContentPlaceHolderID

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Feb 2008
Posts: 5
Reputation: shim55 is an unknown quantity at this point 
Solved Threads: 0
shim55 shim55 is offline Offline
Newbie Poster

RequiredFieldValidator AND ContentPlaceHolderID

 
0
  #1
Feb 18th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: RequiredFieldValidator AND ContentPlaceHolderID

 
0
  #2
Feb 18th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 5
Reputation: shim55 is an unknown quantity at this point 
Solved Threads: 0
shim55 shim55 is offline Offline
Newbie Poster

Re: RequiredFieldValidator AND ContentPlaceHolderID

 
0
  #3
Feb 19th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: RequiredFieldValidator AND ContentPlaceHolderID

 
0
  #4
Feb 19th, 2008
You are allowed to attach and use screenshots. It's standard practice here to receive help.

Post both your master page code and your regular page (ALL HTML ONLY), and I will let you know what's up.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 5
Reputation: shim55 is an unknown quantity at this point 
Solved Threads: 0
shim55 shim55 is offline Offline
Newbie Poster

Re: RequiredFieldValidator AND ContentPlaceHolderID

 
0
  #5
Feb 19th, 2008
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:progidXImageTransform.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">
&nbsp;
<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;">
&nbsp;<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">
&nbsp;</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>
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: RequiredFieldValidator AND ContentPlaceHolderID

 
0
  #6
Feb 19th, 2008
Do me a favor, edit that post and put the code in code tags (just remove the periods from the following syntax: [.code.][./code.] )
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 5
Reputation: shim55 is an unknown quantity at this point 
Solved Threads: 0
shim55 shim55 is offline Offline
Newbie Poster

Re: RequiredFieldValidator AND ContentPlaceHolderID

 
0
  #7
Feb 19th, 2008
I appologize, is this correct?

  1.  
  2. <%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>
  3.  
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  5.  
  6. <html xmlns="http://www.w3.org/1999/xhtml" >
  7. <!-- code -->
  8. <head runat="server">
  9. <title>LDA Master</title>
  10. <link href="Master.css" rel="stylesheet" type="text/css" />
  11. </head>
  12. <body bottommargin="0" topmargin="0">
  13. <form id="form1" runat="server">
  14.  
  15. <div> <table id="MainTable"> <!-- div Fullpage table -->
  16.  
  17. <tr> <!-- First row topheader -->
  18. <td id="TopHeader" colspan="2" >
  19. </td>
  20. </tr>
  21.  
  22. <tr> <!-- Second row Company Title -->
  23. <td id="Title" colspan="2" style="filter:progid:DXImageTransform.Microsoft.Gradient(endColorstr='blue', startColorstr='white', gradientType='1'); height: 10px;">
  24. <h2> ICS Consulting</h2>
  25. </td>
  26. </tr>
  27.  
  28. <tr> <!-- Third row, 2 columns first column is the menu second col is for content -->
  29. <td id="LeftPanel" >
  30. <ul id="mainnav" >
  31. <li><a href="Default.aspx" > Home </a> </li>
  32. <li><a href='Aboutus.aspx'>About Us</a></li>
  33. <li><a href='Services.aspx'>Services</a></li>
  34. <li><a href='Industries.aspx'>Industries</a></li>
  35. <li><a href='contact.aspx'>Contact Us</a></li>
  36. </ul>
  37. </td>
  38.  
  39. <td id="RightPanel">
  40. &nbsp;
  41. <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
  42. </asp:ContentPlaceHolder>
  43. </td>
  44. </tr>
  45.  
  46. <tr>
  47. <td id="Footer" colspan="2" >
  48. Copyright © 2008 ICS Consulting LLC, Inc.
  49. </td>
  50. </tr>
  51. </table>
  52.  
  53. </div> <!-- End div Fullpage table -->
  54. </form>
  55. </body>
  56. </html>


  1.  
  2. <%@ Page Language="VB" MasterPageFile="~/MasterPage.master"
  3. AutoEventWireup="false" CodeFile="contact.aspx.vb" Inherits="_contact" %>
  4.  
  5. <asp:Content ID="Content1" runat="server"
  6. ContentPlaceHolderID="ContentPlaceHolder1">
  7. <h1> Contact Us </h1>
  8. <table id="ContactTable" >
  9. <tr> <!-- Row 1 -->
  10. <td style="width: 112px; height: 26px;"> Name</td>
  11. <td style="width: 214px; height: 26px;">
  12. <asp:TextBox ID="txtName" runat="server" Width="272px"></asp:TextBox>
  13. </td>
  14.  
  15. <td style="width: 131px; height: 26px;">
  16. &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName"
  17. ErrorMessage="*"></asp:RequiredFieldValidator></td>
  18.  
  19. </tr>
  20.  
  21. <tr><!-- Row 2 -->
  22. <td style="width: 112px; height: 26px;"> E-mail</td>
  23. <td style="width: 214px; height: 26px;">
  24. <asp:TextBox ID="txtEmail" runat="server" Width="272px"></asp:TextBox>
  25. </td>
  26.  
  27. <td style="width: 131px; height: 26px;">
  28. <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtEmail"
  29. ErrorMessage="*"></asp:RequiredFieldValidator></td>
  30. </tr>
  31.  
  32. <tr><!-- Row 3 -->
  33. <td style="width: 112px; height: 153px"> Comments/ Feedback</td>
  34. <td style="width: 214px; height: 153px" valign="baseline">
  35. <asp:TextBox ID="txtComments" runat="server" Height="104px" TextMode="MultiLine"
  36. Width="272px"></asp:TextBox></td>
  37. <td style="width: 131px; height: 163px">
  38. </td>
  39. </tr>
  40.  
  41. <tr><!-- Row 4 -->
  42. <td style="width: 112px; height: 19px"> </td>
  43. <td align="right" style="width: 214px; height: 19px" valign="baseline">
  44. <asp:Button ID="Button1" runat="server" OnClick="Button1_Click1" Text="Send" /></td>
  45. <td style="width: 131px; height: 19px" valign="bottom">
  46. </td>
  47. </tr>
  48.  
  49. <tr><!-- Row 5 -->
  50. <td style="width: 214px; height: 70px">
  51. &nbsp;</td>
  52. <td style="width: 131px; height: 70px" valign="bottom">
  53. <asp:ValidationSummary ID="ValidationSummary1" runat="server" Width="264px" />
  54. </td>
  55. </tr>
  56. <tr><!-- Row 6 -->
  57. <td colspan="3" style="text-align: center; height: 8px; ">
  58. </td>
  59. </tr>
  60. </table>
  61. </asp:Content>
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: RequiredFieldValidator AND ContentPlaceHolderID

 
0
  #8
Feb 19th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 5
Reputation: shim55 is an unknown quantity at this point 
Solved Threads: 0
shim55 shim55 is offline Offline
Newbie Poster

Re: RequiredFieldValidator AND ContentPlaceHolderID

 
0
  #9
Feb 19th, 2008
You are truly wonderful, the screen works and looks good, I truly appreciate you help and support
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: RequiredFieldValidator AND ContentPlaceHolderID

 
0
  #10
Feb 19th, 2008
No problem, happy to help.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC