473,789 Members | 2,514 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Putting a server side control inside an html element attribute

Hello,

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

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

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

<link rel="stylesheet " href="<SomePlac eholderControl 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
4 2190
Why would you want to do this?

"John Lau" <jo*****@olc.ub c.ca> wrote in message
news:#2******** ******@TK2MSFTN GP09.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="<%=SomeVa riableName%>" type="text/css">

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

<link rel="stylesheet " href="<SomePlac eholderControl 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
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.r illing.net> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Why would you want to do this?

"John Lau" <jo*****@olc.ub c.ca> wrote in message
news:#2******** ******@TK2MSFTN GP09.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="<%=SomeVa riableName%>" type="text/css">

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

<link rel="stylesheet " href="<SomePlac eholderControl 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
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.ub c.ca> wrote in message
news:e$******** ******@TK2MSFTN GP12.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.r illing.net> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Why would you want to do this?

"John Lau" <jo*****@olc.ub c.ca> wrote in message
news:#2******** ******@TK2MSFTN GP09.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="<%=SomeVa riableName%>" type="text/css">

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

<link rel="stylesheet " href="<SomePlac eholderControl 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
Yes, I noticed it still supports inline code.

Thanks, John
"Peter Rilling" <pe***@nospam.r illing.net> wrote in message
news:%2******** ********@TK2MSF TNGP12.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.ub c.ca> wrote in message
news:e$******** ******@TK2MSFTN GP12.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.r illing.net> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Why would you want to do this?

"John Lau" <jo*****@olc.ub c.ca> wrote in message
news:#2******** ******@TK2MSFTN GP09.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="<%=SomeVa riableName%>" type="text/css">
>
> I'm trying to do something similar in Asp.Net:
>
> <link rel="stylesheet " href="<SomePlac eholderControl 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
7206
by: OJ | last post by:
Hey, I'm trying to make a right justified, bullet on the right, list. The only way that I've found is to use the "direction" attribute: <style> ul.rtl { direction: rtl; } </style> <ul class="rtl">
2
8404
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when submitting the form to update the database. The server doesn't have the client side value any more. It seems to me that as I begin to write the client side javacript code for form validation and client side editing capabilities in order to save...
15
2897
by: Sue | last post by:
Is there such an animal as a frameset/frames server-side webcontrol or htmlcontrol? I have a frameset with two frames - one contains an aspx page with asp buttons that has to do some updating, then change the aspx in the second frame to another aspx. I've been trying various ideas without success. Is there no way to do this on the server side? Perplexed and wanting to drop kick this darn app into orbit elsewhere.... tia, Sue
7
6399
by: Tom wilson | last post by:
I'm trying to create dynamic controls in ASP.Net. It's driving me nuts. I keep getting the error: Control '16' of type 'RadioButton' must be placed inside a form tag with runat=server. Dim Place1 As New PlaceHolder Controls.Add(Place1) For y = 1 To Choices.RecordCount Choices.MoveTo(y)
3
3538
by: The Developer | last post by:
Hi All, I have a web application where I am adding a custom attribute to my ASP.NET text box control and changing value of that attribute at client side using JavaScript. My problem is that changed value of that custom attribute is not reflecting back at server side. Any ideas about this problem? Server side code: private void Page_Load(object sender, EventArgs e) { if (this.IsPostBack == false)
5
3597
by: serge calderara | last post by:
Dear all, I am new in asp.net and prepare myself for exam I still have dificulties to understand the difference between server control and HTML control. Okey things whcih are clear are the fact that for server control component , code is running on the server side. But if I take as example a Label. I place on a webform an HTM label control and a WebForm label control, I could see that properties are different for
2
6969
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
3
3534
by: pbd22 | last post by:
Hi. How do I add the runat=server attribute on a buttonfield link dynamically? thanks!
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10404
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9016
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6765
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4090
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.