Extract value of <asp:TextBox> using Databinder

Posted on 2004-11-18
Last Modified: 2010-05-19
Within an .aspx form there is a table.
Inside the table is a <td> which contains an <a href>
The URL for the <a href> is part static and part dynamic.
The beginning of the URL is <a href="LinkDetail.aspx?LC=" and then I need to extract
the value of an <asp:TextBox> to complete the URL.

My question is, from within the .aspx form, how can I extract the value of the
<asp:TextBox> and add it to the <a href> using Databinder?

The value of the textbox is not known until the user types a value in, after the page load.

   <td class="Content" align="center" width="20%">Link Category #3</td>
   <td class="Content" align="center" width="25%"><asp:TextBox ID="LinkCat3" Width="300" Runat="server"></asp:TextBox></td>
   <td class="Content" align="center" width="25%"><asp:TextBox id="LinkCatDescr3" Width="300" runat="server"></asp:TextBox></td>
   <td class="Content" align="center" width="25%"><asp:TextBox id="LinkCatSrt3" Width="25" runat="server"></asp:TextBox></td>
   <td class="Content" align="center" width="5%"><a href="ELinksDetail.aspx?LID=3&CName=" + <%# DataBinder.Eval("LinkCat3") %>>Detail</a></td>

The above is a snippet of html from the .aspx page.  What I want to do is complete the <a href> based upon the value of <asp:TextBox id="LinkCat3">
Question by:gsmithaaa
    1 Comment
    LVL 10

    Accepted Solution


    You will need to use client side script to achieve this

    <A HREF="#" onclick="window.location = 'ELinksDetail.aspx?LID=3&CName=' +document.getElementById('LinkCat3').value">Detail</A>



    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now