Solved

variable output in ASP.NET

Posted on 2002-05-28
6
238 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
ID: 7039800
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
ID: 7039813
ok... the other option would be to build a custom control, right?

thanks...
0
 
LVL 23

Expert Comment

by:naveenkohli
ID: 7039848
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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 1

Author Comment

by:loyaliser
ID: 7039871
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
ID: 7039908
Yeah... emit the right tag from server side.

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

Naveen
0
 
LVL 1

Author Comment

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

thanks.
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Classic ASP - SQL Server connection problem Part 2! 3 60
SQL Server Web Traffic Limitations 4 61
Time/Date Query 11 41
age from date of birth 4 42
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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

773 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