Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to update text in a control???

Status
Not open for further replies.

baden

Programmer
Feb 6, 2002
125
US
This clarifies a previous question I had:

Here's the situation:

I have a control that I load on a page that has 3 LinkButton links.

What I want to do is change the text that is displayed in the control, based on which link is pressed:

ie:
Link 1: "This is link 1"
Link 2: "This is Link 2"
...etc.

With Javascript, I could simply give a table cell an ID, and change the text of that cell - not having to reload the page.

That's what I would like to accomplish here - not having to reload the page - simply update the text in a text Label.

Can anyone give me a clear example of how to accomplish this please?


Thank you.
 
Oh... I have tried it with creating a property and updating that, ie:

Code:
<uc1:UCImageButton texttoupdate="This is some new text" id="UCImageButton1" runat="server"></uc1:UCImageButton>

I could change texttoupdate to read a Request.QueryString value based on the button pressed, however, that would reload the page - not what I'm looking for.

Recommendations please?!
 
If you want to do it without reloading the page, then you'll have to use javascript as ASP.NET is a server-side language and therefore needs to go to the server to do anything.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Or you could use ajax...


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Yeah, that's what I figured... simply done by creating a Javascript function inside the control, then calling it from the aspx:

<A href="javascript: setCellText('Check out this updated message');">Change Message</A>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top