• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

variable output in ASP.NET

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
loyaliser
Asked:
loyaliser
  • 3
  • 3
1 Solution
 
naveenkohliCommented:
there is no equivalent of <object> tag. Use the label control if need be and render it in codebehind.
0
 
loyaliserAuthor Commented:
ok... the other option would be to build a custom control, right?

thanks...
0
 
naveenkohliCommented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
loyaliserAuthor Commented:
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
 
naveenkohliCommented:
Yeah... emit the right tag from server side.

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

Naveen
0
 
loyaliserAuthor Commented:
ok... i'll use the <asp:label> tag then.

thanks.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now