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

  • SEARCH
  • Home
  • 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 8626017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:55:16+00:00 2026-06-12T07:55:16+00:00

I have this hyperlink called SEND in a ASP page called Home and here

  • 0

I have this hyperlink called “SEND” in a ASP page called Home and here it is:

<asp:TemplateField>
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink1" runat="server" 
                            NavigateUrl='<%# Eval("Post_ID", "~/RCA.aspx?Post_ID={0}") %>' 
                            Text="SEND"></asp:HyperLink>
                    </ItemTemplate>

when the user clicks the hyperlink it goes to another page called RCA and in this page there is a Button and here it is the code:

<asp:Button ID="btnRCA" runat="server" onclick="Button1_Click" 
                  Text="Assign RCA" Width="147px" />

so I want this button to be visible only when clicked the hyperlink in the HOME page. I am planning to have another button or control in the RCA page that will make it invisible when clicked or before someone leaves the page they have to make it invisible the Button by clicking some other control. can someone help me with this? 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-12T07:55:17+00:00Added an answer on June 12, 2026 at 7:55 am

    Use a QueryString parameter.

    Home.aspx

    //When linked to RCA.aspx from Home.aspx, a parameter called ShowButton=1 is included 
    //in the URL.
    
    <asp:HyperLink ID="HyperLink1" runat="server" 
        NavigateUrl='<%# Eval("Post_ID", "~/RCA.aspx?Post_ID={0}&ShowButton=1") %>' 
        Text="SEND"></asp:HyperLink>
    

    RCA.aspx

    //By default, since you want the button to NOT appear for all incoming traffic EXCEPT 
    //that which came from Home.aspx, the button's Visible property is set to false.
    
    <asp:Button ID="btnRCA" runat="server" onclick="Button1_Click" 
        Text="Assign RCA" Width="147px" Visible="false" />
    

    RCA.aspx.cs

    protected void Page_Load(object sender, EventArgs e)
    {
        //If the querystring has a parameter called ShowButton and it's equal to "1",
        //then set the button to Visible = true.
        //Else, do nothing, keeping the button in it's default, Visible=false state.
    
        //By putting this in an "IsPostback == false" check, you can guarantee that this will
        //only  happen on first page_load, and won't be triggered again even if you do other 
        //actions in the page that cause Postback
    
        //For example, if you don't use this !IsPostback check, and you end up creating some 
        //new function that causes the button to be hidden again, but then you make a 
        //selection from a dropdown list that causes postback, you will trigger the call to 
        //make the button Visible again, even though that's probably what you don't want at 
        //this point, since your other new function set it to Visible = false.
    
        if (!IsPostback)
        {
            if (Request.QueryString["ShowButton"] == "1")
            {
                RCAbtn.Visible = true;
            }
    
            if (Request.QueryString["Post_ID"] != null)
            {
                //do whatever you need to with the post ID  
            }
        }
    }
    

    SomeOtherPage.aspx.cs

    Response.Redirect("RCA.aspx?Post_ID=1234"); //button will be invisible
    

    And then let’s say later that you want to re-direct from some other page and have the button be visible, like the redirect from Home:

    Response.Redirect("RCA.aspx?Post_ID=1234&ShowButton=1"); //button will be visible
    

    If you don’t like cluttering up your URL or you feel that it looks tacky to have what you are doing so plainly available to the user’s eyes, you don’t necessarily need to use “ShowButton”. You could say ?Post_ID=1234&fkai3jfkjhsadf=1, and then check your query string for “fkai3jfkjhsadf”. I like to do that sometimes because then from the users point of view, it makes me look like I’m doing something really technical and encrypted, and not just passing around a bunch of basic instructions in plain English 🙂 Downside there is you need keep track of your own query string parameters.


    Edit:

    If you want to get the URL with only the Post_ID and nothing else, you can do this:

    string currenturl = Request.Url.ToString(); //get the current URL
    string urlToSend = currenturl.Substring(0, currenturl.IndexOf("?")); //cut off the QueryString entirely
    urlToSend += "?Post_ID=" + Request.QueryString["Post_ID"]; //re-append the Post_ID
    

    Be aware that your call to Substring will cause an exception if the URL doesn’t have a QueryString, so please patch that up in whatever way works best for you (try/catch, etc.).

    After that, you should just be able to use the “urlToSend” string in your mailMessage.Body.

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

Sidebar

Related Questions

I have following aspx page called search.aspx: <div id=wrap> <div id=menu> <div id=t_menus runat=server>
I have a Gridview with a template for this Hyperlink: <asp:TemplateField HeaderText=Notes ItemStyle-CssClass=NoMargin NoPadding
I thought that this was easier… I have a asp:hyperlink control, with target=_blank ,
The Problem An <asp:TextBox> isn't updating. The Background I have a page called Add_Edit_Drugs.aspx
I have a page called review.asp with a form that produces a list of
I have this block of xaml that allows the text of a hyperlink to
Here's the scenario: I've got a regular hyperlink on my .ascx. (no I have
I have a page that displays a gridview of products. Inside this table is
I have a Word document in the server called (sc + ab) and I
I have a couple of span elements inside a HTML hyperlink like this. <a

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.