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 6710639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:02:44+00:00 2026-05-26T08:02:44+00:00

I have a textbox and an image button as follows <asp:TextBox ID=myText runat=server></asp:TextBox> <asp:ImageButton

  • 0

I have a textbox and an image button as follows

<asp:TextBox ID="myText" runat="server"></asp:TextBox>
<asp:ImageButton ID="btnExecute" runat="server" OnClick="btnExecute_Click" />

Now here is my problem, on the Page_Load there are some bindings.. and these bindings go into dozens of controls and classes, by the time it’s about to reach my code in the On_Click for my button its too late.. it would redirect to somewhere else.. I needed to redirect to a different page but it would never reach its destination unless i somehow ommit all the stuff in between which i am not willing to do..

So, the solution that i thought is to use Javascript on that image button OnClientClick, unfortunately I am not so good at it and was hoping you could help me.. the pseudo code would be something like this

if(the current url contains some page.aspx)
      {
          var value = get the value from myText;

          then navigate to  myotherpage?txtvalue=value;
      }

Can someone help me with this javascript without going into to much details on why i am doing it like this? please

I would really appreciate it.

Thank you

  • 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-05-26T08:02:45+00:00Added an answer on May 26, 2026 at 8:02 am

    Naively translating your pseudo code to javascript:

    if (window.location.href.indexOf('page.aspx') > -1)
    {
        var value = document.getElementById('<%= myText.ClientID %>').value;
        window.location.href = 'myotherpage?txtvalue=' + encodeURIComponent(value);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three TextBox controls on the page <asp:TextBox ID=TextBox1 runat=server AutoPostBack=True OnTextChanged=TextBox_TextChanged TabIndex=1>
I am attaching an asp.net textbox image I want my textbox should have two
I want to have image button for browse and upload I have textbox using
<div> <asp:Label ID=lblClientId runat=server CssClass=label meta:resourcekey=lblClientIdResource /> <asp:TextBox ID=tbClientId runat=server style=width:150px; /> <asp:Button ID=btnClientId
I have a textbox with calendar button. Here my requirement is I need to
I have a textbox where user will enter the url of the image :
I have a textbox and a link button. When I write some text, select
Here is my code: HTML <form> <img id='image' src=/> <input type='text' id='text'> <input type=button
I'm having an issue with an image button that I have built. When I
I have a Asp.net MVC 3 project where I want to implement a textbox

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.