CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 CCS/ASP/Changing Text

Print topic Send  topic

Author Message
shanon
Posted: 07/14/2002, 9:06 AM

I'm new to CCS, and I'm sure that this is a pretty basic question, but I'm having trouble with it and hoping that someone can point me in the right direction; it probably stems from the fact that I don't really understand templates yet..

Anyway - I'm trying to change the text of a message (not an error, just text) on the same page with a search form and a grid based on whether records are returned from the search to the grid. If no records are returned, you get one message and the grid isn't shown, and if records are returned, you get another message and the grid is shown. So, in the BeforeShow event of the grid, I'm determining the number of records returned from the recordset, and I want to change the message accordingly. I could just use Response.Write to get it on the screen, but I'd like an example of changing the value within a control (text box, label, whatever) based on code within an event.

First, I'm not sure I understand the syntax for doing this in ASP - is it using SetVar with the main template object? Does it depend on where the control is placed (i.e within the main page or inside a form on the page)? Can I still change it in the above scenario, or has the template already been processed? Or maybe I'm headed in entirely the wrong direction, and there's a much more straightforward way to accomplish the above.

Any suggestions, pointers, or links to previous submissions that I haven't found would be greatly appreciated!
Chris K.
Posted: 07/14/2002, 2:59 PM

My advice would be to put a Label control either inside static grid area, or outside the grid, on the page level. You don't have to use template operations to show its value, only assign a text:

If in grid:
YourGridName.LabelName.Value = "Message to write"

If outside the grid:
LabelName.Value = "Message to write"

(Replace those names with particular names you assigned to controls)
shanon
Posted: 07/15/2002, 10:58 AM

Thanks a lot Chris.

I had actually done that before, and it wasn't working, so I went down the template path. Of course, it was one of those idiot mistakes where I somehow lost my label identifiers, and it was just plain text, so it wasn't working. After I saw your post, I looked at it again and immediately saw the problem.

Thanks for the help.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.