Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | 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 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 Display Modes
  #1 (permalink)  
Old August 24th, 2017, 12:11 AM
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'.
Reply With Quote
  #2 (permalink)  
Old August 24th, 2017, 10:10 AM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,955
Thanks: 79
Thanked 1,556 Times in 1,533 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!
Reply With Quote
  #3 (permalink)  
Old August 24th, 2017, 11: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
Reply With Quote
  #4 (permalink)  
Old August 25th, 2017, 03:54 AM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,955
Thanks: 79
Thanked 1,556 Times in 1,533 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!
Reply With Quote
  #5 (permalink)  
Old August 26th, 2017, 11: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
Reply With Quote
Reply


Thread Tools
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
Some problems Sheraz Khan C++ Programming 3 April 11th, 2008 04:42 PM
Problems already! KennySargent BOOK: Professional XNA Programming 2nd Edition ISBN: 978-0-470-26128-6 4 April 7th, 2008 04: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 03:42 AM



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


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