Solved

Url encoding in asp.net&c#

Posted on 2011-02-18
7
1,047 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
  • 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:Mamtha1982
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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 12

Accepted Solution

by:
Mamtha1982 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:Mamtha1982
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
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…

832 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