Solved

Url encoding in asp.net&c#

Posted on 2011-02-18
7
1,067 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
asp Google Map 2 65
VS 2015 is giving [No relevant source lines] 2 40
ASP.NET MVC - Views 3 43
Set the FileVersion of a website dll 1 29
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

730 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