|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
stringbuilder helpDim sbRegX As New StringBuilder(HttpUtility.HtmlEncode(txtComments.Text))
sbRegX.Replace("<a>", "<a>") sbRegX.Replace("</a>", "")How do I get the attributes of href and target to be encoded? "Aaron" <fromthe***@aaronminoo.com> schrieb: Encoded as what?>Dim sbRegX As New StringBuilder(HttpUtility.HtmlEncode(txtComments.Text)) >sbRegX.Replace("<a>", "<a>") >sbRegX.Replace("</a>", "") > >How do I get the attributes of href and target to be encoded? -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Herfried,
I have a text box that could have <a href="yahoo.com" target="_new">yahoo</a> With just sbRegX.Replace("<a>", "<a>") sbRegX.Replace("</a>", ""</a>)The output is <a href="yahoo.com" target="_blank">Yahoo and the data looks like this &lt;a href=&quot;yahoo.com&quot; target=&quot;_blank&quot;&gt;Yahoo</a>, I need it to look like http://www.yahoo.com with it in a new window. TIA Aaron Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:uEsaI%23CIGHA.3944@tk2msftngp13.phx.gbl... > "Aaron" <fromthe***@aaronminoo.com> schrieb: > >Dim sbRegX As New StringBuilder(HttpUtility.HtmlEncode(txtComments.Text)) > >sbRegX.Replace("<a>", "<a>") > >sbRegX.Replace("</a>", "") > > > >How do I get the attributes of href and target to be encoded? > > Encoded as what? > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> Aaron,
You'll be looking for Server.HtmlEncode and Server.HtmlDecode. You may also want to experiment (depending on all the uses of the input text) with Sever.UrlEncode and Server.UrlDecode. -- Show quoteHide quoteSincerely, S. Justin Gengo, MCP Web Developer / Programmer www.aboutfortunate.com "Out of chaos comes order." Nietzsche "Aaron" <fromthe***@aaronminoo.com> wrote in message news:eGhc$WDIGHA.3728@tk2msftngp13.phx.gbl... > Herfried, > > I have a text box that could have <a href="yahoo.com" > target="_new">yahoo</a> > > With just > sbRegX.Replace("<a>", "<a>") > sbRegX.Replace("</a>", ""</a>) > > The output is > <a href="yahoo.com" target="_blank">Yahoo > and the data looks like this > &lt;a href=&quot;yahoo.com&quot; > target=&quot;_blank&quot;&gt;Yahoo</a>, > > > > I need it to look like http://www.yahoo.com with it in a new window. > > TIA > > Aaron > > "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message > news:uEsaI%23CIGHA.3944@tk2msftngp13.phx.gbl... >> "Aaron" <fromthe***@aaronminoo.com> schrieb: >> >Dim sbRegX As New >> >StringBuilder(HttpUtility.HtmlEncode(txtComments.Text)) >> >sbRegX.Replace("<a>", "<a>") >> >sbRegX.Replace("</a>", "") >> > >> >How do I get the attributes of href and target to be encoded? >> >> Encoded as what? >> >> -- >> M S Herfried K. Wagner >> M V P <URL:http://dotnet.mvps.org/> >> V B <URL:http://classicvb.org/petition/> > >
AMD/Dual-Core/64 bit: influence on compiled files? - Clients?
Can I hide base class properties in a derived class? disable Close button (X) Application doesn't close on Shut Down - Please help! change IFRAME src Using pulldownlist in datagridview .. can it be done! Inserting text at the beginning of an existing text file Update error Intern Strings - am I using them right? Please help! Marking a changed row |
|||||||||||||||||||||||