Extract value of <asp:TextBox> using Databinder

Posted on 2004-11-18
Medium Priority
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

lengreen earned 1000 total points
ID: 12618618

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 Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month16 days, 19 hours left to enroll

864 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