Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7802309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:13:30+00:00 2026-06-02T01:13:30+00:00

I have a repeater.Insidea a repeater there is a button.On item Command I try

  • 0

I have a repeater.Insidea a repeater there is a button.On item Command I try

protected void rptPost_ItemCommand(object source, RepeaterCommandEventArgs e)
{
 int contentID = Int32.Parse(e.CommandArgument.ToString());//Its return 1
 string host = HttpContext.Current.Request.Url.ToString();//its return http://localhost:1377/Forum.aspx
 //string URL = "~/Modules/Forum/PostDetails.aspx?ID=" + contentID +"&BackUrl=" + host;//Need help hear its not work
 string URL = "~/Modules/Forum/PostDetails.aspx?ID="  + contentID ;//Its work
 Response.Redirect(URL); 

}

when I only try to pass ID its work but if I try to pass multipal url one is ID and next is Current Page Url its unable to find page.And gives page not found error.I unable to understand the problem.Passing Url as a parameter is not support or I missing some thing.Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:13:32+00:00Added an answer on June 2, 2026 at 1:13 am

    Here is the solution:

    host = HttpUtility.UrlEncode(host)
    

    and here is why it works:

    You are passing the host URL as a GET parameter. GET parameters are part of the GET URI for the redirect. URI syntax includes characters with special meanings, in particular you are using colon (:) and slash (/), which have special meaning in a URI string. In almost all cases special characters should not be used as part of your GET parameter data values.

    For cases such as yours, where there is a need to include special characters, UrlEncoding was developed. UrlEncoding, or Percent-encoding, substitutes special characters in URIs with values encoded using the percent sign. These escape sequences are automatically converted back to the original special character as part of URI query processing. The HttpUtility class provides the UrlEncode method as a convenient way to escape all special characters in an input string.

    Please note that it is a good idea to URL encode all data that you pass via GET parameters unless you have full control over the data being passed and you can guarantee that encoding is not necessary. This can be a security issue because attackers can include new parameters and otherwise manipulate your URI if you pass user input to a GET parameter without first URL encoding it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Repeater with a Button inside the ItemTemplate . I added the
I have a UserControl called CustomerFinder for searhing customers. And there is "ADD" button
I have a Repeater with an ASP.NET AJAX 1.0 UpdatePanel inside it. There are
I have 2 Repeaters one inside another. <div id=result> <asp:Repeater runat=server id=results> <Itemtemplate> <asp:Button
I have two repeater which are nested..Means there is one repeater and inside that
I have a repeater inside which i put a Checkbox and above rapeater there
I have a HTML radio button inside a repeater. I'm facing two problems: When
There's this line of code inside of some repeater's ItemDataBound event that includes e.Item.ItemIndex..Now
I have an UpdatePanel which has a Repeater inside it, and inside of the
I have one control named thumbviewer inside repeater. I want to set its imageurl

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.