Solved

variable output in ASP.NET

Posted on 2002-05-28
6
234 Views
Last Modified: 2008-03-06
it seems that using <%=strSomeVar%>, including any form of <% %>, is now not recommended with ASP.NET... they suggest using <script> tags etc.

if that's the case, how would i handle a situation with an <object> html tag that needs to have it's attributes and inner tags modified at runtime?

is there a <asp:> like control for <object> tags?

or should i use the <asp:label> control and setup 2 different forms of the <object> tag then use a codebehind to choose which one to display?

thanks...
0
Comment
Question by:loyaliser
  • 3
  • 3
6 Comments
 
LVL 23

Accepted Solution

by:
naveenkohli earned 100 total points
Comment Utility
there is no equivalent of <object> tag. Use the label control if need be and render it in codebehind.
0
 
LVL 1

Author Comment

by:loyaliser
Comment Utility
ok... the other option would be to build a custom control, right?

thanks...
0
 
LVL 23

Expert Comment

by:naveenkohli
Comment Utility
What exactly are you trying to do? Are you trying to embed an activeX control in your page? If thats the case, then you will be better off using that approach because if you develop a client side control in .Net, then your client browsers will need to have framework installed.

Naveen
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 1

Author Comment

by:loyaliser
Comment Utility
yes... actually, it is an embed of a flash file. and i want to be able to change the flash file that loads depending on URL variables.

i have it working with the <% %> technique, but i would rather change it so it would be done the right/prefered way.

so i guess it will have to be done w/ <asp:label>.

thanks...
0
 
LVL 23

Expert Comment

by:naveenkohli
Comment Utility
Yeah... emit the right tag from server side.

if (useFoo)
{
  myLabel.Text = "<.....>";
}
else
{
  myLebel.Text = "<....>";
}

Naveen
0
 
LVL 1

Author Comment

by:loyaliser
Comment Utility
ok... i'll use the <asp:label> tag then.

thanks.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

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 information …
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 discusses moving either the default database or any database to a new volume.
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…

772 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

10 Experts available now in Live!

Get 1:1 Help Now