Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #21 (permalink)  
Old August 16th, 2010, 10:54 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

If you want me to take a look and see if I can figure something out, post the HTML code and CSS or send me a copy of the site.

Does the menu look good in a browser such as Firefox?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #22 (permalink)  
Old August 16th, 2010, 01:24 PM
Authorized User
 
Join Date: Jul 2010
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Menu

Hi Imar

I solved the spacing by altering the menu1 properties Layout Width = 800px and StaticMenuItemStyle width = 160px

However, altering background -color in the Css file for static menu items has no effect and hover dynamic attributes are also non effective with no background colour present at all....strange because altering the font-size from 14px to say 10px works fine?

seems like some styles are overridden? also the hyperlinks have control tip text which i cant locate.

I will move to next section regardless.

Regards


gerry
Reply With Quote
  #23 (permalink)  
Old August 16th, 2010, 02:24 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Quote:
seems like some styles are overridden?
Possibly; but again: impossble for me to say without seeing any code.

Quote:
also the hyperlinks have control tip text which i cant locate.
The tooltips come from the description attribute in the web.sitemap file.

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #24 (permalink)  
Old August 18th, 2010, 11:28 AM
Authorized User
 
Join Date: Jul 2010
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default browser and validation

Thanks again for your prompt reply. I sent you the site by return email in a zip folder and checked the menu in firefox which still displays the sama. I have moved on through chapter 9 regardless.

There are no reported errata for chapter 9. one thing i noticed in firefox and IE8 is that the asp validation code and the client java code do not seem produce the error listings as per page 304. The java validation errors for home or business phone do not appear in the bullet list with the other elements when send is pressed with no data. Rather, they appear as a single line when all the others have been corrected and send pressed?

I placeed the java immediately before the table of the form code as instructed... i will continue through chapter 9 - 11

Regards

Gerry
Reply With Quote
  #25 (permalink)  
Old August 18th, 2010, 11:35 AM
Authorized User
 
Join Date: Jul 2010
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default browser validation

PS I also noticed that if all the data except the home and business numbers are present, the form actually submits (complete progress bar as opposed to no progress bar when data missing). Then the home / business errors appear after?
Reply With Quote
  #26 (permalink)  
Old August 18th, 2010, 11:35 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

What "return mail" do you mean? I haven't seen anything yet,.....

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #27 (permalink)  
Old August 18th, 2010, 11:43 AM
Authorized User
 
Join Date: Jul 2010
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default site

I sent the entire site as a zipped attachment by return email (not through here) to p2p.wrox.com Forums [p2padmin@wrox.com].
Reply With Quote
  #28 (permalink)  
Old August 18th, 2010, 12:09 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Wrox forum != Imar Spaanjaars ;-)

I don't run or own this forum. I just use it as an end user just like you. To find out my e-mail address, visit my siite (see link in my signature), click Contact and then send me a message. I'll repy so you have my e-mail address. Then you can send me the site and I'll take a look.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #29 (permalink)  
Old August 18th, 2010, 03:11 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Somebody at Wiley intercepted your message and forwarded it to me. A miracle ;-)
So, I got the files and looked at your site. Amazing how looking at code for less than a minute can solve a problem that needs days of explaining.

You're using the .NET 3.5 book and associated resource files using Visual Studio 2010 and .NET 4. The way the Menu renders has changed considerably between these two versions. Rather than generating old skool tables, the menu now renders clean <ul> and <li> elements. This renders (no pun intended), part of the CSS from the 3.5 book useless. More importantly, a table equally divides its cells over the full width available. So, a menu of 1000px pixels with 5 elements gives each item a width of 200 automatically. With a <ul> and <li> items, you need to do that explicitly.

So, to summarize, your dev tools and framework on one side are not completely compatible with the 3.5 book and its resources on the other side.

Three ways to fix it:

1. The expensive way
Buy a copy of Beginning ASP.NET 4 in C# and VB and learn new stuff right from the start.

2. The cheap way
Download the code for the Beginning ASP.NET 4 in C# and VB book and use that in your menu and master page

3. The cheesy way
Make the following changes to web,config:

<pages theme="Light" controlRenderingCompatibilityVersion="3.5">

This tells controls to render the way they did on 3.5, causing the menu to render as a table instead of an <ul> element, instantly fixing the problem, leaving you with the slightly unpleasant feeling you're doing things the old way.

Hope this helps, and hopes it also shows the necessity of posting relevant code ;-)

The code you sent earlier doesn't contain the contact form validation code, so I can't say much about that. Sounds like a mismatch in function names, or like a bad implementation of the code. Posting the relevant markup of the User Control could shed some light on this.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #30 (permalink)  
Old August 18th, 2010, 03:43 PM
Authorized User
 
Join Date: Jul 2010
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Validation (and site menu)

Thanks again Imar.

The version compatibility makes sense....and when I produce my application I will use all v 4.0 code and resource...

I just emailed you the updated site code halfway through chapter 9. this has the validation markup, but i will also investigate the function name mismatch...here the markup code.

Jscript

</style>

<script type="text/javascript">

function ValidatePhoneNumbers(source, args)
{
var txtPhoneHome = document.getElementById('<%= txtPhoneHome.ClientID %>');
var txtPhoneBusiness = document.getElementById('<%= txtPhoneBusiness.ClientID %>');

if (txtPhoneHome.Value != '' || txtPhoneBusiness != '')
{
args.IsValid = true;
}
else
{
args.IsValid = false;
}
}


</script>


<table class="style1">
<tr>
<td colspan="3">
<span class="style3">Get in touch with us:</span><br />
<span class="style5">Use the form below to contact us. Please enter your name, e-mail address and
telephone number. We will get in touch with you asap.</span></td>
</tr>
<tr>
<td class="style9">
Your Name:</td>
<td class="style7">
<asp:TextBox ID="txtName" runat="server" Width="197px" CssClass="style8"></asp:TextBox>
</td>
<td class="style6">
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txtName" ErrorMessage="Please enter your name">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style9">
E-mail</td>
<td class="style7">
<asp:TextBox ID="txtEmailAddress" runat="server" Width="198px"></asp:TextBox>
</td>
<td class="style6">
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
Display="Dynamic" ErrorMessage="Please enter an e-mail address"
ControlToValidate="txtEmailAddress">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
Display="Dynamic" ErrorMessage="Please enter a valid e-mail address"
ControlToValidate="txtEmailAddress"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td class="style9">
Confirm E-mail</td>
<td class="style7">
<asp:TextBox ID="txtEmailaddressConfirm" runat="server" Width="198px"></asp:TextBox>
</td>
<td class="style6">
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
Display="Dynamic" ErrorMessage="Please confirm e-mail address"
ControlToValidate="txtEmailaddressConfirm">*</asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator1" runat="server" Display="Dynamic"
ErrorMessage="Please retype e-mail address"
ControlToCompare="txtEmailAddress" ControlToValidate="txtEmailaddressConfirm">*</asp:CompareValidator>
</td>
</tr>
<tr>
<td class="style9">
Home Phone</td>
<td class="style7">
<asp:TextBox ID="txtPhoneHome" runat="server"
ontextchanged="txtPhoneHome_TextChanged" Width="198px"></asp:TextBox>
</td>
<td class="style6">
<asp:CustomValidator ID="CustomValidator1" runat="server"
ClientValidationFunction="ValidatePhoneNumbers" Display="Dynamic"
ErrorMessage="Please enter your home or business phone"
onservervalidate="CustomValidator1_ServerValidate" >*</asp:CustomValidator>
</td>
</tr>
<tr>
<td class="style9">
Business Phone</td>
<td class="style7">
<asp:TextBox ID="txtPhoneBusiness" runat="server" Width="198px"></asp:TextBox>
</td>
<td class="style6">
&nbsp;</td>
</tr>
<tr>
<td class="style9">
Comments</td>
<td class="style7">
<asp:TextBox ID="txtComments" runat="server" TextMode="MultiLine" Width="287px"></asp:TextBox>
</td>
<td class="style6">
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
Display="Dynamic" ErrorMessage="Please enter a comment"
ControlToValidate="txtComments">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style9">
&nbsp;</td>
<td class="style7">
<asp:Button ID="btnSend" runat="server" Text="Send" />
</td>
<td class="style6">
&nbsp;</td>
</tr>
<tr>
<td colspan="3">
<asp:ValidationSummary ID="ValidationSummary1" runat="server" />
</td>
</tr>
</table>
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CH 15 Context Menu - Element Menu Items Razzy The Pug BOOK: Ivor Horton's Beginning Visual C++ 2005 2 November 9th, 2008 03:53 PM
how create menubar, menu, menu item in xsl vijayanmsc XSLT 1 June 5th, 2006 06:43 AM
Menu Help in statusbar at mousemove over Menu item Kaustav VB Components 1 September 14th, 2005 09:28 AM
right click menu hidden by drop-drown menu Andraw HTML Code Clinic 0 March 18th, 2005 03:28 PM
Changing Menu made with VB 4 Menu Editor Zooker VB How-To 1 July 26th, 2003 11:44 PM



All times are GMT -4. The time now is 10:42 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.