By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,188 Members | 844 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,188 IT Pros & Developers. It's quick & easy.

Putting a server side control inside an html element attribute

P: n/a
Hello,

In Asp, you can render a server side variable inside the quotes in an html
element attribute. For example:

<link rel="stylesheet" href="<%=SomeVariableName%>" type="text/css">

I'm trying to do something similar in Asp.Net:

<link rel="stylesheet" href="<SomePlaceholderControl runat=server>"
type="text/css">

However, Asp.Net sees the characters inside the quotes as literal text. Is
there a way to put a server side control inside the quotes?

Thanks,
John
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Why would you want to do this?

"John Lau" <jo*****@olc.ubc.ca> wrote in message
news:#2**************@TK2MSFTNGP09.phx.gbl...
Hello,

In Asp, you can render a server side variable inside the quotes in an html
element attribute. For example:

<link rel="stylesheet" href="<%=SomeVariableName%>" type="text/css">

I'm trying to do something similar in Asp.Net:

<link rel="stylesheet" href="<SomePlaceholderControl runat=server>"
type="text/css">

However, Asp.Net sees the characters inside the quotes as literal text. Is there a way to put a server side control inside the quotes?

Thanks,
John

Nov 18 '05 #2

P: n/a
We're migrating our Asp websites to Asp.net. Most of our designers and
developers have never seen Asp.net, so phase one is just a port. Phase two
will be a rewrite.

John

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Why would you want to do this?

"John Lau" <jo*****@olc.ubc.ca> wrote in message
news:#2**************@TK2MSFTNGP09.phx.gbl...
Hello,

In Asp, you can render a server side variable inside the quotes in an html element attribute. For example:

<link rel="stylesheet" href="<%=SomeVariableName%>" type="text/css">

I'm trying to do something similar in Asp.Net:

<link rel="stylesheet" href="<SomePlaceholderControl runat=server>"
type="text/css">

However, Asp.Net sees the characters inside the quotes as literal text.

Is
there a way to put a server side control inside the quotes?

Thanks,
John


Nov 18 '05 #3

P: n/a
ASP.NET still supports inline code.

But as for your original questions, probably not. I have never seen this
done, simply because server-side controls are tags and attributes are only
constant values.

"John Lau" <jo*****@olc.ubc.ca> wrote in message
news:e$**************@TK2MSFTNGP12.phx.gbl...
We're migrating our Asp websites to Asp.net. Most of our designers and
developers have never seen Asp.net, so phase one is just a port. Phase two will be a rewrite.

John

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Why would you want to do this?

"John Lau" <jo*****@olc.ubc.ca> wrote in message
news:#2**************@TK2MSFTNGP09.phx.gbl...
Hello,

In Asp, you can render a server side variable inside the quotes in an html element attribute. For example:

<link rel="stylesheet" href="<%=SomeVariableName%>" type="text/css">

I'm trying to do something similar in Asp.Net:

<link rel="stylesheet" href="<SomePlaceholderControl runat=server>"
type="text/css">

However, Asp.Net sees the characters inside the quotes as literal
text. Is
there a way to put a server side control inside the quotes?

Thanks,
John



Nov 18 '05 #4

P: n/a
Yes, I noticed it still supports inline code.

Thanks, John
"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
ASP.NET still supports inline code.

But as for your original questions, probably not. I have never seen this
done, simply because server-side controls are tags and attributes are only
constant values.

"John Lau" <jo*****@olc.ubc.ca> wrote in message
news:e$**************@TK2MSFTNGP12.phx.gbl...
We're migrating our Asp websites to Asp.net. Most of our designers and
developers have never seen Asp.net, so phase one is just a port. Phase

two
will be a rewrite.

John

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Why would you want to do this?

"John Lau" <jo*****@olc.ubc.ca> wrote in message
news:#2**************@TK2MSFTNGP09.phx.gbl...
> Hello,
>
> In Asp, you can render a server side variable inside the quotes in
an
html
> element attribute. For example:
>
> <link rel="stylesheet" href="<%=SomeVariableName%>" type="text/css">
>
> I'm trying to do something similar in Asp.Net:
>
> <link rel="stylesheet" href="<SomePlaceholderControl runat=server>"
> type="text/css">
>
> However, Asp.Net sees the characters inside the quotes as literal

text. Is
> there a way to put a server side control inside the quotes?
>
> Thanks,
> John
>
>



Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.