Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 February 14th, 2012, 02:38 PM
Friend of Wrox
Points: 550, Level: 8
Points: 550, Level: 8 Points: 550, Level: 8 Points: 550, Level: 8
Activity: 22%
Activity: 22% Activity: 22% Activity: 22%
 
Join Date: Mar 2011
Posts: 113
Thanks: 31
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
Reply With Quote
  #2 (permalink)  
Old February 14th, 2012, 03:15 PM
Imar's Avatar
Wrox Author
Points: 66,557, Level: 100
Points: 66,557, Level: 100 Points: 66,557, Level: 100 Points: 66,557, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,119
Thanks: 65
Thanked 1,381 Times in 1,361 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!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
Tulsi (February 15th, 2012)
  #3 (permalink)  
Old February 14th, 2012, 03:22 PM
Friend of Wrox
Points: 742, Level: 10
Points: 742, Level: 10 Points: 742, Level: 10 Points: 742, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2009
Location: Tehran, Iran
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 03:29 PM.
Reply With Quote
The Following User Says Thank You to irProject For This Useful Post:
Tulsi (February 15th, 2012)
  #4 (permalink)  
Old February 14th, 2012, 03:37 PM
Imar's Avatar
Wrox Author
Points: 66,557, Level: 100
Points: 66,557, Level: 100 Points: 66,557, Level: 100 Points: 66,557, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,119
Thanks: 65
Thanked 1,381 Times in 1,361 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!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
irProject (February 14th, 2012)
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
Chapter 5:Access List with Server-side object Modle yueyao_xu BOOK: Beginning SharePoint 2010 Development 8 November 11th, 2010 04: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 04: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



All times are GMT -4. The time now is 05:40 PM.


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