Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : 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 February 14th, 2012, 03:38 PM
Friend of Wrox
 
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
Default Chapter 7 - Server-Side Redirects

Hi Imar,

I had a question from page 266. It says ..."a user may request a page like this http://www.domain.com/Cars/Volvo/850/T5". I was confused as to how the browser knows which page to request since there is no actual page listed in this URL.

Thank you.

Tulsi
 
Old February 14th, 2012, 04:15 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

It depends.... One solution is to put a Default.aspx or other default document in the folder which then gets served. However, it's more common these days to do wild car mapping and run each request through .NET. That way the .NET run time can look at the request and determine how to handle it, which could be different for the technology (e.g. MVC could do it differently from Web Forms)

So, in all cases, the browser just submits the full URL and the sevrer (IIS) then determines what file to execute.

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!
The Following User Says Thank You to Imar For This Useful Post:
Tulsi (February 15th, 2012)
 
Old February 14th, 2012, 04:22 PM
Friend of Wrox
 
Join Date: Nov 2009
Posts: 156
Thanks: 13
Thanked 16 Times in 16 Posts
Default Routing

Hi Tulsi

Actual Url is not "http://www.domain.com/Cars/Volvo/850/T5" but "it is displayed to user". you can use some techniques to do this. in asp.net MVC there is Routing tool, and in previous versions (Professional way) you can write your own HttpHandler and HttpModule that does it.

see
http://www.codeproject.com/Articles/...g-with-ASP-NET

http://www.simple-talk.com/dotnet/as...r-asp.net-2.0/

and then

http://weblogs.asp.net/scottgu/archi...h-asp-net.aspx

I'm writing a new one that acts like MVC that you can define some actions (but in WebForms):

http:// yourUrl/post/list ====> calls List Method of Post.aspx page
http:// yourUrl/post/new ====> calls New Method of Post.aspx page
http:// yourUrl/post/title-of-post ====> calls Detail(title) Method of Post.aspx

I'll send it here when completed
__________________
happy every time, happy every where

Reza Baiat

Last edited by irProject; February 14th, 2012 at 04:29 PM..
The Following User Says Thank You to irProject For This Useful Post:
Tulsi (February 15th, 2012)
 
Old February 14th, 2012, 04:37 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
Actual Url is not "http://www.domain.com/Cars/Volvo/850/T5" but "it is displayed to user".
Well, it *is* the actual URL, both to the user as to the server. However, it doesn't necessarily map to a physical document.....

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!
The Following User Says Thank You to Imar For This Useful Post:
irProject (February 14th, 2012)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 5:Access List with Server-side object Modle yueyao_xu BOOK: Beginning SharePoint 2010 Development 8 November 11th, 2010 05:02 PM
? Server-Side Redirects Princess Rose BOOK: Beginning ASP.NET 4 : in C# and VB 1 May 1st, 2010 06:50 PM
Problem Converting Client-side to Server-side Code kwilliams ASP.NET 2.0 Professional 1 November 21st, 2007 05:25 PM
Firing server side events at client side codes mehdi62b ASP.NET 1.0 and 1.1 Basics 6 May 18th, 2005 09:11 AM
Accessing Server Side Data on Client Side steve456 Classic ASP Professional 3 October 15th, 2003 02:33 PM





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