Solved

Url encoding in asp.net&c#

Posted on 2011-02-18
7
1,081 Views
Last Modified: 2012-05-11
Hi, I want to code for the url encoding in asp.net(c#).My aim is for example my site is www.example.com/register.aspx.Iin Browser Url "register.aspx cannot show in users browser instead of that register.aspx user can see any encoded format.Please give the code and explain how?
0
Comment
Question by:Manne
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 2

Expert Comment

by:jondow
ID: 34924989
Hi, not sure I completely understtod the question but this is how to url encode:

Server.UrlEncode("www.example.com/register.aspx")

0
 

Author Comment

by:Manne
ID: 34925018
i mean in browser user dont see the register.aspx in browser Address bar.
0
 
LVL 12

Expert Comment

by:Praveen Kumar
ID: 34925052
Encoding is not possible in the URL. But you can use other feature called "routing" which will hide the physical asp.net page and allowes you to customize the URL.

Below is the download:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=D5CDD637-AC85-4522-B8D5-D17B5B064614&displaylang=en

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Accepted Solution

by:
Praveen Kumar earned 500 total points
ID: 34925061
0
 

Author Comment

by:Manne
ID: 34931523
is Routing concept  available in .net 3.5 only?
0
 
LVL 12

Expert Comment

by:Praveen Kumar
ID: 34932720
Yes, URL routing was first time introduced in ASP.NET 3.5 SP1.
0
 

Author Comment

by:Manne
ID: 34996289

When iam trying url routing this error occur..

Server Error in '/url_rout' Application.
--------------------------------------------------------------------------------

The route handler 'RouteHandler' did not return an IHttpHandler from its GetHttpHandler() method.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The route handler 'RouteHandler' did not return an IHttpHandler from its GetHttpHandler() method.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[InvalidOperationException: The route handler 'RouteHandler' did not return an IHttpHandler from its GetHttpHandler() method.]
   System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context) +15588
   System.Web.Routing.UrlRoutingModule.OnApplicationPostResolveRequestCache(Object sender, EventArgs e) +81
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +216
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +120

 
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question