473,561 Members | 3,117 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ampersand in attribute

I created an iframe HtmlGenericCont rol that has an ampersand in the "src"
attribute.....

Dim faxFrame As New HtmlGenericCont rol("iframe")
faxFrame.Attrib utes.Add("width ", "100%")
faxFrame.Attrib utes.Add("heigh t", "90%")
faxFrame.Attrib utes.Add("frame border", "no")
faxFrame.Attrib utes.Add("src", "/archive/view.aspx?isPlu gin=" & isPlugin &
"&iDoc=" & Server.UrlEncod e(intDoc))
However when the control is rendered this is how it appears ...
<iframe width="100%" height="90%" frameborder="no "
src="/archive/view.aspx?isPlu gin=false&amp;i Doc=document"></iframe>

It converts the ampersand in my querystring to the entity equiv of &amp;

Is there any way to make it preserve the ampersand... or is their any other
suggestions to accomplish the same thing?

Thanks
Tim Fortney
Nov 18 '05 #1
4 3721
I don't know whether this is right but try putting it as the literal to
start with.
i.e. if you put "abc&def" it might 'convert' this to "abc&amp;de f"
but if you put "abc&amp;de f" it might convert this right back to "abc&def" !
Sounds silly but try it...it might work

"tfortney" <tf******@pdgsi .com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
I created an iframe HtmlGenericCont rol that has an ampersand in the "src"
attribute.....

Dim faxFrame As New HtmlGenericCont rol("iframe")
faxFrame.Attrib utes.Add("width ", "100%")
faxFrame.Attrib utes.Add("heigh t", "90%")
faxFrame.Attrib utes.Add("frame border", "no")
faxFrame.Attrib utes.Add("src", "/archive/view.aspx?isPlu gin=" & isPlugin &
"&iDoc=" & Server.UrlEncod e(intDoc))
However when the control is rendered this is how it appears ...
<iframe width="100%" height="90%" frameborder="no "
src="/archive/view.aspx?isPlu gin=false&amp;i Doc=document"></iframe>

It converts the ampersand in my querystring to the entity equiv of &amp;

Is there any way to make it preserve the ampersand... or is their any other suggestions to accomplish the same thing?

Thanks
Tim Fortney

Nov 18 '05 #2
Yeah i have tried that...
i tried &&, the &, i tried server.urldecod e/encode,
server.urlpathe ncode, etc....but no luck
"Bonj" <a@b.com> wrote in message
news:u8******** ******@TK2MSFTN GP11.phx.gbl...
I don't know whether this is right but try putting it as the literal to
start with.
i.e. if you put "abc&def" it might 'convert' this to "abc&amp;de f"
but if you put "abc&amp;de f" it might convert this right back to "abc&def" ! Sounds silly but try it...it might work

"tfortney" <tf******@pdgsi .com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
I created an iframe HtmlGenericCont rol that has an ampersand in the "src" attribute.....

Dim faxFrame As New HtmlGenericCont rol("iframe")
faxFrame.Attrib utes.Add("width ", "100%")
faxFrame.Attrib utes.Add("heigh t", "90%")
faxFrame.Attrib utes.Add("frame border", "no")
faxFrame.Attrib utes.Add("src", "/archive/view.aspx?isPlu gin=" & isPlugin & "&iDoc=" & Server.UrlEncod e(intDoc))
However when the control is rendered this is how it appears ...
<iframe width="100%" height="90%" frameborder="no "
src="/archive/view.aspx?isPlu gin=false&amp;i Doc=document"></iframe>

It converts the ampersand in my querystring to the entity equiv of &amp;

Is there any way to make it preserve the ampersand... or is their any

other
suggestions to accomplish the same thing?

Thanks
Tim Fortney


Nov 18 '05 #3
Hello Tim,

When the Attribute collection gets rendered, it runs through a Render method on the AttributeCollec tion, which in turn calls WriteAttribute on the HtmlTextWriter.

The WriteAttribute method on HtmlTextWriter calls HttpUtility.Htm lAttributeEncod e, which in turn does the encoding.

The only way around it that I see would be to create a custom control, and override the Render method to output the attribute correctly.
Yeah i have tried that...
i tried &&, the &, i tried server.urldecod e/encode,
server.urlpathe ncode, etc....but no luck
"Bonj" <a@b.com> wrote in message
news:u8******** ******@TK2MSFTN GP11.phx.gbl...
I don't know whether this is right but try putting it as the literal
to
start with.
i.e. if you put "abc&def" it might 'convert' this to "abc&amp;de f"
but if you put "abc&amp;de f" it might convert this right back to
"abc&def"

!
Sounds silly but try it...it might work

"tfortney" <tf******@pdgsi .com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
I created an iframe HtmlGenericCont rol that has an ampersand in the
"src"
attribute.....

Dim faxFrame As New HtmlGenericCont rol("iframe")
faxFrame.Attrib utes.Add("width ", "100%")
faxFrame.Attrib utes.Add("heigh t", "90%")
faxFrame.Attrib utes.Add("frame border", "no")
faxFrame.Attrib utes.Add("src", "/archive/view.aspx?isPlu gin=" &
isPlugin &
"&iDoc=" & Server.UrlEncod e(intDoc))

However when the control is rendered this is how it appears ...
<iframe width="100%" height="90%" frameborder="no "
src="/archive/view.aspx?isPlu gin=false&amp;i Doc=document"></iframe>

It converts the ampersand in my querystring to the entity equiv of
&amp;

Is there any way to make it preserve the ampersand... or is their
any

other
suggestions to accomplish the same thing?


--
Matt Berther
http://www.mattberther.com
Nov 18 '05 #4
Well that is a bunch of poop!!
I was hoping i would not have to do that but all well

Thanks everyone with the input
Tim

"Matt Berther" <mb******@hotma il.com> wrote in message
news:ud******** ********@TK2MSF TNGP10.phx.gbl. ..
Hello Tim,

When the Attribute collection gets rendered, it runs through a Render method on the AttributeCollec tion, which in turn calls WriteAttribute on the
HtmlTextWriter.
The WriteAttribute method on HtmlTextWriter calls HttpUtility.Htm lAttributeEncod e, which in turn does the encoding.
The only way around it that I see would be to create a custom control, and override the Render method to output the attribute correctly.
Yeah i have tried that...
i tried &&, the &, i tried server.urldecod e/encode,
server.urlpathe ncode, etc....but no luck
"Bonj" <a@b.com> wrote in message
news:u8******** ******@TK2MSFTN GP11.phx.gbl...
I don't know whether this is right but try putting it as the literal
to
start with.
i.e. if you put "abc&def" it might 'convert' this to "abc&amp;de f"
but if you put "abc&amp;de f" it might convert this right back to
"abc&def"

!
Sounds silly but try it...it might work

"tfortney" <tf******@pdgsi .com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
I created an iframe HtmlGenericCont rol that has an ampersand in the

"src"
attribute.....

Dim faxFrame As New HtmlGenericCont rol("iframe")
faxFrame.Attrib utes.Add("width ", "100%")
faxFrame.Attrib utes.Add("heigh t", "90%")
faxFrame.Attrib utes.Add("frame border", "no")
faxFrame.Attrib utes.Add("src", "/archive/view.aspx?isPlu gin=" &
isPlugin

&
"&iDoc=" & Server.UrlEncod e(intDoc))

However when the control is rendered this is how it appears ...
<iframe width="100%" height="90%" frameborder="no "
src="/archive/view.aspx?isPlu gin=false&amp;i Doc=document"></iframe>

It converts the ampersand in my querystring to the entity equiv of
&amp;

Is there any way to make it preserve the ampersand... or is their
any

other

suggestions to accomplish the same thing?


--
Matt Berther
http://www.mattberther.com

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4100
by: debk | last post by:
Server.UrlEncode is not longer converting the ampersand in a string to %26 so the value passed in the querystring gets truncated in the following page. Is this a problem with IIS, does anyone know? I can't find this reported anywhere else. I may just have to code around it. Details: link is created by the following code:...
3
26476
by: Eidolon | last post by:
I am wondering how i can put an ampersand character into the value attribute of a key in the appSettings section of my web.config file. If i try to simply type it in, then run my web app, i get the following error: ---------------------------------------------------------------------------- ------------------------------------------------...
18
14732
by: SwordAngel | last post by:
Hello, I'm looking for a program that converts characters of different encodings (such as EUC-JP, Big5, GB-18030, etc.) into HTML ampersand escape sequences. Anybody knows where I can find one? thx.
1
6460
by: Dave | last post by:
XmlTextReader reader = new XmlTextReader ("c:/downloads/somedata.xml"); while (reader.Read()) { ....etc. } I've determined that the problem in the source XML is a node that contains an attribute that doesn't have the
12
6312
by: ~~~ .NET Ed ~~~ | last post by:
Hi, I have a standalone XML file (with the appropriate xml document header) that works fine when I load it using XmlDocument. I can have child elements like this without problems: <SomeChildElement type="c" href="There.aspx?id=5" /> But as soon as I change it to something like this: <SomeChildElement type="c" href="There.aspx?id=5&amp;t=m"...
1
2878
by: Prasanna Padmanabhan | last post by:
I want to process requests to certain image files that have a custom ..icon(32x32) extenstion with a custom .NET HttpHandler in order to be able to tap into Application events. This works fine almost everytime except that I get a 404 error when trying to access a file with an ampersand in its name. The error happens only if I point the...
1
5909
by: klynn | last post by:
I have a web.config key as follows: <add key="DOC_TRAILER" value="&Lib=whatever&File=.pdf&Frameset=Created" /> but I cant run the app with this string. Problems with & I tried putting @ at beginning but that didnt fix it. What am I missing?
2
2348
by: Dan | last post by:
Hi, i want to use character '<' and '>' (without quotes) as text in the listitem of a dropdownlist in the aspx file. <asp:ListItem Text="< or =" Value="2"></asp:ListItem> there is no error, except in the aspx file: Visual Web Dev changes the color "attribute or is not a valid attribute od element ListItem" Any way to do that?
4
4202
by: Kiran Makam | last post by:
I am setting the content of a div dynamically using innerHTML property. If the content contains an ampersand, text after the ampersand is disappearing in IE6. It works properly in Firefox. This is my code: ---------------- <body> <div id='div1'></div> <script>
0
7644
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8085
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7928
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...
0
6206
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...
1
5469
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...
0
5185
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...
0
3615
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3598
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1180
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.