Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 23rd, 2017, 11:11 PM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2017
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default First exemple = problems

Hi l'm using Visual Studio 2017 Community on windows 10 home.

I try the first exemple but the Asp.net code refuse to be execute on the web page <%Datetime.now.toString() %>. So i'm leave with a page with Welcome to beginning ASP.Net 4.5.

This is an exemple of the output window

Severity Code Description Project File Line Suppression State
Error NuGet Package restore failed for project WebSiteVB1: Unable to find version '1.2.0' of package 'Respond'. C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'Respond.1.2.0' is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'. https://api.nuget.org/v3/index.json: Unable to load the service index for source https://api.nuget.org/v3/index.json. An error occurred while sending the request. The remote name could not be resolved: 'api.nuget.org'.

Severity Code Description Project File Line Suppression State
Error NuGet Package restore failed for project WebSiteVB1: Unable to find version '1.2.0' of package 'Respond'. C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'Respond.1.2.0' is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'. https://api.nuget.org/v3/index.json: Unable to load the service index for source https://api.nuget.org/v3/index.json. An error occurred while sending the request. The remote name could not be resolved: 'api.nuget.org'.

Severity Code Description Project File Line Suppression State
Error NuGet Package restore failed for project WebSiteVB1: Unable to find version '2.2.1' of package 'Microsoft.AspNet.Identity.Owin'. C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'Microsoft.AspNet.Identity.Owin.2.2.1' is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'. https://api.nuget.org/v3/index.json: Unable to load the service index for source https://api.nuget.org/v3/index.json. An error occurred while sending the request. The remote name could not be resolved: 'api.nuget.org'.
 
Old August 24th, 2017, 09:10 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Sounds like an issue with your network? Take a look at this:

>> Unable to load the service index for source https://api.nuget.org/v3/index.json. An error occurred while sending the request. The remote name could not be resolved: 'api.nuget.org'.

It seems it can't access the internet to download required packages.

Which commands did you choose to create the new site? File | New Project? Or File | New Website? Or something else?

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!
 
Old August 24th, 2017, 10:49 PM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2017
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Asp is not showing

Hi

It cleared a lot of errors messages once i was connected but still the asp code is not executed in default.aspx

I created a website

This is the code:

<%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">

<div class="jumbotron">
<h1>ASP.NET</h1>
<p><%Date.Today.ToString()%></p>

<p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS, and JavaScript.</p>
<p><a href="http://www.asp.net" class="btn btn-primary btn-lg">Learn more &raquo;</a></p>
</div>

<div class="row">
<div class="col-md-4">
<h2>Getting started</h2>
<p>
ASP.NET Web Forms lets you build dynamic websites using a familiar drag-and-drop, event-driven model.
A design surface and hundreds of controls and components let you rapidly build sophisticated, powerful UI-driven sites with data access.
</p>
<p>
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301948">Learn more &raquo;</a>
</p>
</div>
<div class="col-md-4">
<h2>Get more libraries</h2>
<p>
NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.
</p>
<p>
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301949">Learn more &raquo;</a>
</p>
</div>
<div class="col-md-4">
<h2>Web Hosting</h2>

<p>
You can easily find a web hosting company that offers the right mix of features and price for your applications.
</p>
<p>
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301950">Learn more &raquo;</a>
</p>
</div>
</div>

</asp:Content>


Only error i got was

Severity Code Description Project File Line Suppression State
Message IDE0017 Object initialization can be simplified WebSite3 C:\Users\Eric\source\WebSites\WebSite3\App_Code\Ro uteConfig.vb 8 Active
 
Old August 25th, 2017, 02:54 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're missing the colon in your code block which is responsible for the output. I.e. this:

<p><%Date.Today.ToString()%></p>

should be this:

<p><%:Date.Today.ToString()%></p>

Also, the book uses DateTime.Now.ToString() so it works for VB and C#; your example should work too.

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!
 
Old August 26th, 2017, 10:16 PM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2017
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Thanks

Thanks Imar




Similar Threads
Thread Thread Starter Forum Replies Last Post
Some problems Sheraz Khan C++ Programming 3 April 11th, 2008 03:42 PM
Problems already! KennySargent BOOK: Professional XNA Programming 2nd Edition ISBN: 978-0-470-26128-6 4 April 7th, 2008 03:36 AM
validate.asp problems and logon.asp problems p2ptolu Classic ASP Databases 0 February 16th, 2005 02:34 PM
Problems kilika Javascript 1 October 3rd, 2003 02:42 AM





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