Showing posts with label code. Show all posts
Showing posts with label code. Show all posts

Thursday, March 29, 2012

Html in Asp.Net variable causeing errors

I am using this code:

Dim strPopup as String = "<script>alert('hello world');</script>"

The closing script tag is screwing up the vb code. I don't know why..This is a protection to avoid script tags in asp.net code which can break the server-side scripts in ASP.NET (when a </script> is detected). Use this little workaround to solve the problem:

Dim strPopup as String = "<script>alert('hello world');</script"+">"
.
Another solution is to avoid the direct use of <script> tags by using the properties of, for example, the <body> section of the page:

<body onload="alert('hello world');">
...

html header/library file

I wanted to create something like C library but for html code to be included in html or aspx html portion. How do I do that? Thanks in advance.Write the code in .inc file and include those where ever u want

Devendra Naik.
what's the exact command to include the .inc file?
I used <!--#include virtual="topnav.inc"--
but it doesn't seems to work.
Anyone??

HTML from code behind

Hi,
A hopefully simple question for someone to answer. I wish to dynamically change the HTML code from VB code behind. For example I have a table setup in the HTML code and what I want to do is display formatted text within this table that has been placed dynamically by code behind, depending on a querystring. See example below

<td width="300" rowspan="13" valign="top"><p></p
(CODE TO PLACED HERE BY CODE BEHIND)
</td
Above a table is defined in HTML, but I want the below code to be placed into this table by using code behind (this will be dependent on a querystring so that different text will be displayed depending on what link was used)

<p align="right"><font face="Arial, Helvetica, sans-serif">This
is a test
</font></p>
<p align="justify"><font face="Arial, Helvetica, sans-serif">Want
this sample to be sent from the code behind. How can it be done?</font></p
Can anyone please help?
ThanksYou may use <asp:table/> control and add tablerow and tablecell at run time.
Thanks for that, I had a look in MSDN and that will work fine for creating the tables, rows and cells but what about the formatted text. I noticed that there is innerhtml, could you please explain how I could use this. Would I be able to create a static table, that is written in HTML but add "runat = server" in the table definition. Then add HTML from code behind using innerHTML. I have tried getting it to work but I keep getting syntax errors. Any thoughts would be great.

Thanks
James
The easiest way (I think) is to put a placeholder where you want your dynamic text to go:

<table>
<tr>
<td>
<asp:Placeholder id="TableCellPlaceholder" runat='server" />
</td>
</tr>
</table>

In your codebehind, you of course define this placeholder:

Protected TableCellPlaceholder As System.Web.UI.WebControls.Placeholder

Then, when you get to adding the dynamic text, you just add it as a LiteralControl:

Dim HtmlTtoInject As String
If Request.Params( "s" ) = "Google" Then
HtmlToInject = "< b>Thanks for choosing Google</b>"
Else
HtmlToInject = "< i>It's time you tried Google</i>"
End If
TableCellPlaceholder.Controls.Add( New LiteralControl( HtmlToInject ) )

This is admittedly a quick and dirty approach ... however, it's also perhaps the easiest.

Hope this helps.
Great, that works just how I wanted. Thank you :)

You did say:
"This is admittedly a quick and dirty approach ... however, it's also perhaps the easiest."

What other way may you do this? Just for future reference.

Thanks again
Well, it's more "object-oriented" to do what JimmyM said, and create TableRow objects, which contain TableCell objects, which in turn contain Label objects or Literal objects ... and then attach the TableRow objects to your Table object.

But, you can do that later when you need a more structured approach to dynamically building a table.

For the simple purpose you said, using a Placeholder is nice and easy.
Just put in an <asp:label> control and use this code:

label1.InnerHtml="Here is some HTML code <bthis is in bold</b> this is a link

Hope this helps

Colin Cameron

Monday, March 26, 2012

HTML formatted memorystream.. how to return it in its own browser window ?

I have some code in my codebehind page which formats an html file into a
System.IO.MemoryStream ojbect, how can I use the Response object of my aspx
page to return this result to the user, and in a new window ?
Thanks for any pointers.
MartinHi, Martin
The Response object will only stream back to the window that sends out reque
st. You cannot write to another window.
I would suggest 2 solutions to get around:
1. Save the stream to the session, retrieve it from the new page.
or
2. move the code behind function to the new page, stream to the Response obj
ect.
Bin Song, MCP

HTML formatted memorystream.. how to return it in its own browser window ?

I have some code in my codebehind page which formats an html file into a
System.IO.MemoryStream ojbect, how can I use the Response object of my aspx
page to return this result to the user, and in a new window ?

Thanks for any pointers.

MartinHi, Marti

The Response object will only stream back to the window that sends out request. You cannot write to another window.
I would suggest 2 solutions to get around
1. Save the stream to the session, retrieve it from the new page
o
2. move the code behind function to the new page, stream to the Response object

Bin Song, MCP

Html formatted email

Can anyone advise me on how to amend the following code to send Html formatted emails? It works perfectly in normal text format - I am a novice programmer.

<%@dotnet.itags.org.PageExplicit="true"Language="VB"Debug="True" %>

<html>

<head>

</head>

<body>

<%

Dim EMailFromAsString = Session("eMailFrom")

Dim EMailToAsString = Request.Form("txtTo")

Dim EMailSubjectAsString ="Your Report"

Dim EMailBodyAsString = Request.Form("txtNewBody")

Dim MySmtpClientAsNew System.Net.Mail.SmtpClient

MySmtpClient.Send(EMailFrom, EMailTo, EMailSubject, EMailBody)%>

Any help appreciated

Anything and everything email and .NET related can be found at:

If you are dealing with 1.1:
http://www.systemwebmail.com

Or 2.0 framework
http://www.systemnetmail.com

Both sites have working examples, diagnostic solutions, and setup


I put together a FAQ in the FAQ Forum:HOW TO: Send using System.Net.Mail

HTH,
Ryan

Html Form Help!

Hi,

I have an .aspx page that contains an html form. Below is the code used for the form:

<form id="Shoes" method="post" runat="server">
<label for="q">Search:</label><br />
<asp:textbox id="q" maxlength="100" runat="server"/><br />
<label for="sz">Shoe Size (US):</label><br />
<asp:dropdownlist id="sz" runat="server"/><br /> <!-- this control is populated programmatically -->
<label for="tp">Type:</label><br />
<asp:dropdownlist id="tp" runat="server">
<asp:listitem value="24">Any</asp:listitem>
<asp:listitem value="2293">Athletic</asp:listitem>
<asp:listitem value="31920">Athletic-Inspired</asp:listitem>
</asp:dropdownlist><br />
<label for="cd">Condition:</label><br />
<asp:dropdownlist id="cd" runat="server">
<asp:listitem value="24">Any</asp:listitem>
<asp:listitem value="31919">New</asp:listitem>
</asp:dropdownlist><br />
<input type="submit" value="Search"/>
</form
All is good here.

But should I specify any form variables and perform a postback, I can't access any of the form
controls using either the Request.Form collection or using Request.Querystring collection.

I have no idea why this is happening. Can anyone help this newbie?

Thanks,
RoshawnI don't see anything particularly wrong with your form ASPX tag code.
You have not shown how you expect to access these values on a postback.

The typicaly pattern is:

Page_Load( ...)
{
if(IsPostBack)
{
//get values here

}

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

"Roshawn Dawson" wrote:

> Hi,
> I have an .aspx page that contains an html form. Below is the code used for the form:
>
> <form id="Shoes" method="post" runat="server">
> <label for="q">Search:</label><br />
> <asp:textbox id="q" maxlength="100" runat="server"/><br />
> <label for="sz">Shoe Size (US):</label><br />
> <asp:dropdownlist id="sz" runat="server"/><br /> <!-- this control is populated programmatically -->
> <label for="tp">Type:</label><br />
> <asp:dropdownlist id="tp" runat="server">
> <asp:listitem value="24">Any</asp:listitem>
> <asp:listitem value="2293">Athletic</asp:listitem>
> <asp:listitem value="31920">Athletic-Inspired</asp:listitem>
> </asp:dropdownlist><br />
> <label for="cd">Condition:</label><br />
> <asp:dropdownlist id="cd" runat="server">
> <asp:listitem value="24">Any</asp:listitem>
> <asp:listitem value="31919">New</asp:listitem>
> </asp:dropdownlist><br />
> <input type="submit" value="Search"/>
> </form>
>
> All is good here.
> But should I specify any form variables and perform a postback, I can't access any of the form
> controls using either the Request.Form collection or using Request.Querystring collection.
> I have no idea why this is happening. Can anyone help this newbie?
> Thanks,
> Roshawn
Hmm...

Your suggestion is simple enough. I though that you don't always have to check if the page was
posted back. I thought that I could slap some code onto the page and simply use the Request object.
Seems I was wrong.

Thanks for the tip, Peter. :-)

Peter Bromberg [C# MVP] wrote:
> I don't see anything particularly wrong with your form ASPX tag code.
> You have not shown how you expect to access these values on a postback.
> The typicaly pattern is:
> Page_Load( ...)
> {
> if(IsPostBack)
> {
> //get values here
> }
> Peter
I appreciate your suggestion, but unfortunately nothing works. I still cannot use the Request.Form
collection or the Request.QueryString collection.

Thanks anyway,
Roshawn
If you want to post a "Short but complete" code sample, sombody will review
it. How about your AutoEventWireup directive, how is that set? Have you set a
breakpont on the code line that you expect to see executed, to see if it is
actually reached? Have you tried using the locals window to look at values?
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

"Roshawn Dawson" wrote:

> I appreciate your suggestion, but unfortunately nothing works. I still cannot use the Request.Form
> collection or the Request.QueryString collection.
> Thanks anyway,
> Roshawn
Hi, Roshawn.

What you are looking for is the Request.Params collection.

See example usage at :
http://www.informit.com/articles/ar...2&seqNum=4&rl=1

http://www.hanselman.com/blog/ASPNE...leDecoding.aspx

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Roshawn Dawson" <udrago@.bellsouth.net> wrote in message
news:uxxSlDzcGHA.4072@.TK2MSFTNGP05.phx.gbl...
>I appreciate your suggestion, but unfortunately nothing works. I still cannot use the Request.Form
>collection or the Request.QueryString collection.
> Thanks anyway,
> Roshawn
Hi Juan,

I've done some more testing, and what I found is strange. Both the Request.Params and the
Request.QueryString collections are empty.

I have no idea why this is. Could setting the EnableViewState property to true have an effect on
these collections?

Thanks,
Roshawn

Juan T. Llibre wrote:
> Hi, Roshawn.
> What you are looking for is the Request.Params collection.
> See example usage at :
> http://www.informit.com/articles/ar...2&seqNum=4&rl=1
> http://www.hanselman.com/blog/ASPNE...leDecoding.aspx
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
Never mind; I figured it out. Silly me, I didn't supply a name attribute for any of the form's
controls. That's why I couldn't get any data.

And to think that I need a hairpiece for nothing (I pulled all of it out). :-(

Thanks gang,
Roshawn
heh, heh...
Been there, done that!

I bet it felt good to finally figure it out!

:-)

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Roshawn Dawson" <udrago@.bellsouth.net> wrote in message
news:%23WISox%23cGHA.536@.TK2MSFTNGP02.phx.gbl...
> Never mind; I figured it out. Silly me, I didn't supply a name attribute for any of the form's
> controls. That's why I couldn't get any data.
> And to think that I need a hairpiece for nothing (I pulled all of it out). :-(
> Thanks gang,
> Roshawn

Html Form Help!

Hi,
I have an .aspx page that contains an html form. Below is the code used for
the form:
<form id="Shoes" method="post" runat="server">
<label for="q">Search:</label><br />
<asp:textbox id="q" maxlength="100" runat="server"/><br />
<label for="sz">Shoe Size (US):</label><br />
<asp:dropdownlist id="sz" runat="server"/><br /> <!-- this control is popu
lated programmatically -->
<label for="tp">Type:</label><br />
<asp:dropdownlist id="tp" runat="server">
<asp:listitem value="24">Any</asp:listitem>
<asp:listitem value="2293">Athletic</asp:listitem>
<asp:listitem value="31920">Athletic-Inspired</asp:listitem>
</asp:dropdownlist><br />
<label for="cd">Condition:</label><br />
<asp:dropdownlist id="cd" runat="server">
<asp:listitem value="24">Any</asp:listitem>
<asp:listitem value="31919">New</asp:listitem>
</asp:dropdownlist><br />
<input type="submit" value="Search"/>
</form>
All is good here.
But should I specify any form variables and perform a postback, I can't acce
ss any of the form
controls using either the Request.Form collection or using Request.Querystri
ng collection.
I have no idea why this is happening. Can anyone help this newbie?
Thanks,
RoshawnI don't see anything particularly wrong with your form ASPX tag code.
You have not shown how you expect to access these values on a postback.
The typicaly pattern is:
Page_Load( ...)
{
if(IsPostBack)
{
//get values here
}
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Roshawn Dawson" wrote:

> Hi,
> I have an .aspx page that contains an html form. Below is the code used f
or the form:
>
> <form id="Shoes" method="post" runat="server">
> <label for="q">Search:</label><br />
> <asp:textbox id="q" maxlength="100" runat="server"/><br />
> <label for="sz">Shoe Size (US):</label><br />
> <asp:dropdownlist id="sz" runat="server"/><br /> <!-- this control is
populated programmatically -->
> <label for="tp">Type:</label><br />
> <asp:dropdownlist id="tp" runat="server">
> <asp:listitem value="24">Any</asp:listitem>
> <asp:listitem value="2293">Athletic</asp:listitem>
> <asp:listitem value="31920">Athletic-Inspired</asp:listitem>
> </asp:dropdownlist><br />
> <label for="cd">Condition:</label><br />
> <asp:dropdownlist id="cd" runat="server">
> <asp:listitem value="24">Any</asp:listitem>
> <asp:listitem value="31919">New</asp:listitem>
> </asp:dropdownlist><br />
> <input type="submit" value="Search"/>
> </form>
>
> All is good here.
> But should I specify any form variables and perform a postback, I can't ac
cess any of the form
> controls using either the Request.Form collection or using Request.Queryst
ring collection.
> I have no idea why this is happening. Can anyone help this newbie?
> Thanks,
> Roshawn
>
Hmm...
Your suggestion is simple enough. I though that you don't always have to ch
eck if the page was
posted back. I thought that I could slap some code onto the page and simply
use the Request object.
Seems I was wrong.
Thanks for the tip, Peter. :-)
Peter Bromberg [C# MVP] wrote:
> I don't see anything particularly wrong with your form ASPX tag code.
> You have not shown how you expect to access these values on a postback.
> The typicaly pattern is:
> Page_Load( ...)
> {
> if(IsPostBack)
> {
> //get values here
> }
> Peter
I appreciate your suggestion, but unfortunately nothing works. I still cann
ot use the Request.Form
collection or the Request.QueryString collection.
Thanks anyway,
Roshawn
If you want to post a "Short but complete" code sample, sombody will review
it. How about your AutoEventWireup directive, how is that set? Have you set
a
breakpont on the code line that you expect to see executed, to see if it is
actually reached? Have you tried using the locals window to look at values?
Peter
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Roshawn Dawson" wrote:

> I appreciate your suggestion, but unfortunately nothing works. I still ca
nnot use the Request.Form
> collection or the Request.QueryString collection.
> Thanks anyway,
> Roshawn
>
Hi, Roshawn.
What you are looking for is the Request.Params collection.
See example usage at :
http://www.informit.com/articles/ar...2&seqNum=4&rl=1
http://www.hanselman.com/blog/ ASPN...leDecoding.aspx
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Roshawn Dawson" <udrago@.bellsouth.net> wrote in message
news:uxxSlDzcGHA.4072@.TK2MSFTNGP05.phx.gbl...
>I appreciate your suggestion, but unfortunately nothing works. I still can
not use the Request.Form
>collection or the Request.QueryString collection.
> Thanks anyway,
> Roshawn
Hi Juan,
I've done some more testing, and what I found is strange. Both the Request.
Params and the
Request.QueryString collections are empty.
I have no idea why this is. Could setting the EnableViewState property to t
rue have an effect on
these collections?
Thanks,
Roshawn
Juan T. Llibre wrote:
> Hi, Roshawn.
> What you are looking for is the Request.Params collection.
> See example usage at :
> http://www.informit.com/articles/ar...2&seqNum=4&rl=1
> http://www.hanselman.com/blog/ ASPN...leDecoding.aspx
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
Never mind; I figured it out. Silly me, I didn't supply a name attribute fo
r any of the form's
controls. That's why I couldn't get any data.
And to think that I need a hairpiece for nothing (I pulled all of it out).
:-(
Thanks gang,
Roshawn
heh, heh...
Been there, done that!
I bet it felt good to finally figure it out!
:-)
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Roshawn Dawson" <udrago@.bellsouth.net> wrote in message
news:%23WISox%23cGHA.536@.TK2MSFTNGP02.phx.gbl...
> Never mind; I figured it out. Silly me, I didn't supply a name attribute
for any of the form's
> controls. That's why I couldn't get any data.
> And to think that I need a hairpiece for nothing (I pulled all of it out).
:-(
> Thanks gang,
> Roshawn

HTML first, Page_Load later

In the following aspx file the output from Page_Load code is rendered first
and HTML later. I want the other way round.
How can I do that?
<%@dotnet.itags.org. Page Language="C#" %>
<%@dotnet.itags.org. Import Namespace="System.IO" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server"><title>Welcome to my Project</title></head>
<body>
<form id="form1" runat="server"><div>
<h3>Below are the files in my Project</h3>
</div></form>
</body></html>
<script runat="server">
protected void Page_Load(object sender, EventArgs e) {
DirectoryInfo dir = new DirectoryInfo(this.MapPath("~"));
foreach (FileInfo f in dir.GetFiles("*.as*x"))
if (f.Name.ToLower() != "default.aspx") Response.Write("<a href='./" +
f.Name + "'>" + f.Name + "</a>" + "<br>");
}
</script>Instead of doing raw Response.Write's to the output stream, try databinding
your "stuff" to a control defined on the Page that is suitable for rendering
such a list - a Repeater, DataList, or Gridview.
Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"dotNET learner" wrote:

> In the following aspx file the output from Page_Load code is rendered firs
t
> and HTML later. I want the other way round.
> How can I do that?
>
> <%@. Page Language="C#" %>
> <%@. Import Namespace="System.IO" %>
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head runat="server"><title>Welcome to my Project</title></head>
> <body>
> <form id="form1" runat="server"><div>
> <h3>Below are the files in my Project</h3>
> </div></form>
> </body></html>
>
> <script runat="server">
> protected void Page_Load(object sender, EventArgs e) {
>
> DirectoryInfo dir = new DirectoryInfo(this.MapPath("~"));
> foreach (FileInfo f in dir.GetFiles("*.as*x"))
> if (f.Name.ToLower() != "default.aspx") Response.Write("<a href='./" +
> f.Name + "'>" + f.Name + "</a>" + "<br>");
> }
> </script>
>
>
On Mar 19, 4:07 pm, Peter Bromberg [C# MVP]
<pbromb...@.yahoo.yabbadabbadoo.com> wrote:
> Instead of doing raw Response.Write's to the output stream, try databindin
g
> your "stuff" to a control defined on the Page that is suitable for renderi
ng
> such a list - a Repeater, DataList, or Gridview.
> Peter
> --
> Site: http://www.eggheadcafe.com
> UnBlog: http://petesbloggerama.blogspot.com
> Short urls & more: http://ittyurl.net
> "dotNET learner" wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
I would also suggest using code behind files instead of including the
C# logic in the ASPX page itself. This separates the code from the
design which is always a good direction to go.
Following your suggestion, I used simple Label control instead of
"Response.Write". It worked. Thank you :) The modified code is below:
protected void Page_Load(object sender, EventArgs e) {
string fileList = "";
DirectoryInfo dir = new DirectoryInfo(this.MapPath("~"));
foreach (FileInfo f in dir.GetFiles("*.as*x"))
if (f.Name.ToLower() != "default.aspx") {
fileList = fileList + "<a href='./" + f.Name + "'>" + f.Name + "</a>" +
"<br>";
}
lblFileList.Text = fileList;
}
"Peter Bromberg [C# MVP]" <pbromberg@.yahoo.yabbadabbadoo.com> wrote in
message news:5435FFC5-B40B-4AEB-8773-7E5C377AE71F@.microsoft.com...
> Instead of doing raw Response.Write's to the output stream, try
> databinding
> your "stuff" to a control defined on the Page that is suitable for
> rendering
> such a list - a Repeater, DataList, or Gridview.
> Peter
> --
> Site: http://www.eggheadcafe.com
> UnBlog: http://petesbloggerama.blogspot.com
> Short urls & more: http://ittyurl.net
>
>
> "dotNET learner" wrote:
>

HTML first, Page_Load later

In the following aspx file the output from Page_Load code is rendered first
and HTML later. I want the other way round.

How can I do that?

<%@dotnet.itags.org. Page Language="C#" %>

<%@dotnet.itags.org. Import Namespace="System.IO" %>

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server"><title>Welcome to my Project</title></head>

<body>

<form id="form1" runat="server"><div>

<h3>Below are the files in my Project</h3>

</div></form>

</body></html>

<script runat="server">

protected void Page_Load(object sender, EventArgs e) {

DirectoryInfo dir = new DirectoryInfo(this.MapPath("~"));

foreach (FileInfo f in dir.GetFiles("*.as*x"))

if (f.Name.ToLower() != "default.aspx") Response.Write("<a href='http://links.10026.com/?link=./" +
f.Name + "'>" + f.Name + "</a>" + "<br>");

}

</script>Instead of doing raw Response.Write's to the output stream, try databinding
your "stuff" to a control defined on the Page that is suitable for rendering
such a list - a Repeater, DataList, or Gridview.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"dotNET learner" wrote:

Quote:

Originally Posted by

In the following aspx file the output from Page_Load code is rendered first
and HTML later. I want the other way round.
>
How can I do that?
>
>
>
<%@. Page Language="C#" %>
>
<%@. Import Namespace="System.IO" %>
>
<html xmlns="http://www.w3.org/1999/xhtml">
>
<head runat="server"><title>Welcome to my Project</title></head>
>
<body>
>
<form id="form1" runat="server"><div>
>
<h3>Below are the files in my Project</h3>
>
</div></form>
>
</body></html>
>
>
>
<script runat="server">
>
protected void Page_Load(object sender, EventArgs e) {
>
>
DirectoryInfo dir = new DirectoryInfo(this.MapPath("~"));
>
foreach (FileInfo f in dir.GetFiles("*.as*x"))
>
if (f.Name.ToLower() != "default.aspx") Response.Write("<a href='http://links.10026.com/?link=./" +
f.Name + "'>" + f.Name + "</a>" + "<br>");
>
}
>
</script>
>
>
>


On Mar 19, 4:07 pm, Peter Bromberg [C# MVP]
<pbromb...@.yahoo.yabbadabbadoo.comwrote:

Quote:

Originally Posted by

Instead of doing raw Response.Write's to the output stream, try databinding
your "stuff" to a control defined on the Page that is suitable for rendering
such a list - a Repeater, DataList, or Gridview.
Peter
>
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
>
"dotNET learner" wrote:

Quote:

Originally Posted by

In the following aspx file the output from Page_Load code is rendered first
and HTML later. I want the other way round.


>

Quote:

Originally Posted by

How can I do that?


>

Quote:

Originally Posted by

<%@. Page Language="C#" %>


>

Quote:

Originally Posted by

<%@. Import Namespace="System.IO" %>


>

Quote:

Originally Posted by

<html xmlns="http://www.w3.org/1999/xhtml">


>

Quote:

Originally Posted by

<head runat="server"><title>Welcome to my Project</title></head>


>

Quote:

Originally Posted by

<body>


>

Quote:

Originally Posted by

<form id="form1" runat="server"><div>


>

Quote:

Originally Posted by

<h3>Below are the files in my Project</h3>


>

Quote:

Originally Posted by

</div></form>


>

Quote:

Originally Posted by

</body></html>


>

Quote:

Originally Posted by

<script runat="server">


>

Quote:

Originally Posted by

protected void Page_Load(object sender, EventArgs e) {


>

Quote:

Originally Posted by

DirectoryInfo dir = new DirectoryInfo(this.MapPath("~"));


>

Quote:

Originally Posted by

foreach (FileInfo f in dir.GetFiles("*.as*x"))


>

Quote:

Originally Posted by

if (f.Name.ToLower() != "default.aspx") Response.Write("<a href='http://links.10026.com/?link=./" +
f.Name + "'>" + f.Name + "</a>" + "<br>");


>

Quote:

Originally Posted by

}


>

Quote:

Originally Posted by

</script>


I would also suggest using code behind files instead of including the
C# logic in the ASPX page itself. This separates the code from the
design which is always a good direction to go.
Following your suggestion, I used simple Label control instead of
"Response.Write". It worked. Thank you :) The modified code is below:

protected void Page_Load(object sender, EventArgs e) {
string fileList = "";

DirectoryInfo dir = new DirectoryInfo(this.MapPath("~"));

foreach (FileInfo f in dir.GetFiles("*.as*x"))

if (f.Name.ToLower() != "default.aspx") {

fileList = fileList + "<a href='http://links.10026.com/?link=./" + f.Name + "'>" + f.Name + "</a>" +
"<br>";

}

lblFileList.Text = fileList;

}

"Peter Bromberg [C# MVP]" <pbromberg@.yahoo.yabbadabbadoo.comwrote in
message news:5435FFC5-B40B-4AEB-8773-7E5C377AE71F@.microsoft.com...

Quote:

Originally Posted by

Instead of doing raw Response.Write's to the output stream, try
databinding
your "stuff" to a control defined on the Page that is suitable for
rendering
such a list - a Repeater, DataList, or Gridview.
Peter
>
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
>
>
>
>
"dotNET learner" wrote:
>

Quote:

Originally Posted by

>In the following aspx file the output from Page_Load code is rendered
>first
>and HTML later. I want the other way round.
>>
> How can I do that?
>>
>>
>>
><%@. Page Language="C#" %>
>>
><%@. Import Namespace="System.IO" %>
>>
><html xmlns="http://www.w3.org/1999/xhtml">
>>
><head runat="server"><title>Welcome to my Project</title></head>
>>
><body>
>>
><form id="form1" runat="server"><div>
>>
><h3>Below are the files in my Project</h3>
>>
></div></form>
>>
></body></html>
>>
>>
>>
><script runat="server">
>>
> protected void Page_Load(object sender, EventArgs e) {
>>
>>
> DirectoryInfo dir = new DirectoryInfo(this.MapPath("~"));
>>
> foreach (FileInfo f in dir.GetFiles("*.as*x"))
>>
> if (f.Name.ToLower() != "default.aspx") Response.Write("<a href='http://links.10026.com/?link=./" +
>f.Name + "'>" + f.Name + "</a>" + "<br>");
>>
>}
>>
></script>
>>
>>
>>

HTML file from database to user interface

Here is some sample/psuedo code. This should give you a good idea of
how to implement this.

<%@dotnet.itags.org. Control ClassName="DataBaseHtmlLiteral" %>

<script runat="server">
Public DataBaseID as integer

Sub OnPreRender
' create sql connection and command
SqlCmd = "Select TOP 1 [Table].[html] from [Table] WHERE [Table].
[IDField] = @dotnet.itags.org.ID"
SqlCmd.Parameters.add("@dotnet.itags.org.ID",DatabaseID)

HTML.Text = DirectCast(SqlCmd.ExecuteScalar(),String)
' clean up (close connection etc.)
End Sub
</script>

<asp:Literal ID="HTML" runat="server" />

Each instance requires the DataBaseID to be set.
This assumes a single instance of the html, if you are looping through
the table, do not use this. Don't want
Also, error catching is needed (row doesn't exist, column is null,
DataBaseID is null, etc)

Hope this helps!

html encoding?

Hi,
I am trying to add a "src" attribute to an iframe by code as follows:
this.MyWin.Attribute.Add("src","page1.aspx?par1=1&par2=2");

But the output page always convert the '&" into &
How can I avoid this convertion?ThanksTry eitherHtmlEncode orHtmlDecode

Saturday, March 24, 2012

html editor recommendations?

I am/was using FCKeditor to allow users to submit HTML, however I am coming
accross a serious bug which removes all style code blocks when a user
submits html using Firefox 2.0.x .
So, can anyone recommend any other html editors than can easily be used on a
asp.net 2.0 website (and are free/opensource).
Thanks,
JJ"JJ" <abc@.xyz.com> wrote in message
news:upc0RncrHHA.4828@.TK2MSFTNGP04.phx.gbl...

> So, can anyone recommend any other html editors than can easily be used on
> a asp.net 2.0 website (and are free/opensource).
I've never needed anything other than this:
http://freetextbox.com/default.aspx
http://www.markrae.net
Hi Mark,
I saw that one. I think maybe my expectations are wrong...
Are these editors capable of editing a full html document with (for example)
a <style> code block in the header?
When I try pasting a full html document with a header (including a style
block), a body, and a footer, the editors convert the whole lot to a table,
ignoring and deleting the entire style block.
Is it perhaps that these editors are only designed to format small chunks of
HTML and won't do an entire page?
Thanks in advance,
JJ
"Mark Rae" <mark@.markNOSPAMrae.net> wrote in message
news:u74yu3crHHA.5032@.TK2MSFTNGP02.phx.gbl...
> "JJ" <abc@.xyz.com> wrote in message
> news:upc0RncrHHA.4828@.TK2MSFTNGP04.phx.gbl...
>
> I've never needed anything other than this:
> http://freetextbox.com/default.aspx
>
> --
> http://www.markrae.net
"JJ" <abc@.xyz.com> wrote in message
news:u6E7NDdrHHA.1848@.TK2MSFTNGP03.phx.gbl...

> Hi Mark,
> I saw that one. I think maybe my expectations are wrong...
> Are these editors capable of editing a full html document with (for
> example) a <style> code block in the header?
> When I try pasting a full html document with a header (including a style
> block), a body, and a footer, the editors convert the whole lot to a
> table, ignoring and deleting the entire style block.
> Is it perhaps that these editors are only designed to format small chunks
> of HTML and won't do an entire page?
Hmm - I'll admit to not having tried to use FreeTextBox to edit an entire
page, but I think if that is what you require, then maybe you need something
like SharePoint...
http://www.markrae.net
I do hope there's another solution - its too late to adopt sharepoint in
this case.
Thanks,
JJ
"Mark Rae" <mark@.markNOSPAMrae.net> wrote in message
news:e6NRVGdrHHA.4300@.TK2MSFTNGP05.phx.gbl...
> "JJ" <abc@.xyz.com> wrote in message
> news:u6E7NDdrHHA.1848@.TK2MSFTNGP03.phx.gbl...
>
> Hmm - I'll admit to not having tried to use FreeTextBox to edit an entire
> page, but I think if that is what you require, then maybe you need
> something like SharePoint...
>
> --
> http://www.markrae.net
re:
!> Is it perhaps that these editors are only designed to format
!> small chunks of HTML and won't do an entire page?
Exactly. You can't build a whole page with freetextbox *or* FCK.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"JJ" <abc@.xyz.com> wrote in message news:u6E7NDdrHHA.1848@.TK2MSFTNGP03.phx.gbl...kred">
> Hi Mark,
> I saw that one. I think maybe my expectations are wrong...
> Are these editors capable of editing a full html document with (for exampl
e) a <style> code block
> in the header?
> When I try pasting a full html document with a header (including a style b
lock), a body, and a
> footer, the editors convert the whole lot to a table, ignoring and deletin
g the entire style
> block.
> Is it perhaps that these editors are only designed to format small chunks
of HTML and won't do an
> entire page?
> Thanks in advance,
> JJ
> "Mark Rae" <mark@.markNOSPAMrae.net> wrote in message news:u74yu3crHHA.5032
@.TK2MSFTNGP02.phx.gbl...
>
Actually it does work ok with FCK - but only in IE. Firefox somehow acts
completely differently.
Do you know of any editors that will do the header section as well in both
browsers?
JJ
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:e2acu5drHHA.1380@.TK2MSFTNGP04.phx.gbl...
> re:
> !> Is it perhaps that these editors are only designed to format
> !> small chunks of HTML and won't do an entire page?
> Exactly. You can't build a whole page with freetextbox *or* FCK.
>
>
> Juan T. Llibre, asp.net MVP
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
> ======================================
> "JJ" <abc@.xyz.com> wrote in message
> news:u6E7NDdrHHA.1848@.TK2MSFTNGP03.phx.gbl...
>
re:
!> Actually it does work ok with FCK - but only in IE.
!> Firefox somehow acts completely differently.
IE is very lenient when it comes to ignoring superfluous html tags.
Think of it this way :
When you use an online editor, what you edit is meant to be embedded in an h
tml page.
If you include double html/head/body tags, would you expect a browser to hon
or them ?
I wouldn't.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"JJ" <abc@.xyz.com> wrote in message news:uQKVbEerHHA.1404@.TK2MSFTNGP03.phx.gbl...kred">
> Actually it does work ok with FCK - but only in IE. Firefox somehow acts c
ompletely differently.
> Do you know of any editors that will do the header section as well in both
browsers?
> JJ
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:e2acu5drHHA.1380@.TK2MSFTNGP04.phx.gbl...
>
try posting this question in an FCKeditor forum, you may have better luck
"JJ" <abc@.xyz.com> wrote in message news:upc0RncrHHA.4828@.TK2MSFTNGP04.phx.gbl...kred">
>I am/was using FCKeditor to allow users to submit HTML, however I am coming
accross a serious bug which removes all style code
>blocks when a user submits html using Firefox 2.0.x .
> So, can anyone recommend any other html editors than can easily be used on
a asp.net 2.0 website (and are free/opensource).
> Thanks,
> JJ
>
Check out Macromedia's HomeSite. I used that way back for HTML coding and
now it has support of .aspx file extensions.
http://www.adobe.com/products/homesite/
Mike
'IGotYourDotNet'
http://igotyourdotnet.blogspot.com/
"JJ" <abc@.xyz.com> wrote in message
news:upc0RncrHHA.4828@.TK2MSFTNGP04.phx.gbl...
>I am/was using FCKeditor to allow users to submit HTML, however I am coming
>accross a serious bug which removes all style code blocks when a user
>submits html using Firefox 2.0.x .
> So, can anyone recommend any other html editors than can easily be used on
> a asp.net 2.0 website (and are free/opensource).
> Thanks,
> JJ
>

html editor recommendations?

I am/was using FCKeditor to allow users to submit HTML, however I am coming
accross a serious bug which removes all style code blocks when a user
submits html using Firefox 2.0.x .

So, can anyone recommend any other html editors than can easily be used on a
asp.net 2.0 website (and are free/opensource).

Thanks,

JJ"JJ" <abc@.xyz.comwrote in message
news:upc0RncrHHA.4828@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

So, can anyone recommend any other html editors than can easily be used on
a asp.net 2.0 website (and are free/opensource).


I've never needed anything other than this:
http://freetextbox.com/default.aspx
--
http://www.markrae.net
Hi Mark,

I saw that one. I think maybe my expectations are wrong...

Are these editors capable of editing a full html document with (for example)
a <stylecode block in the header?

When I try pasting a full html document with a header (including a style
block), a body, and a footer, the editors convert the whole lot to a table,
ignoring and deleting the entire style block.

Is it perhaps that these editors are only designed to format small chunks of
HTML and won't do an entire page?

Thanks in advance,
JJ

"Mark Rae" <mark@.markNOSPAMrae.netwrote in message
news:u74yu3crHHA.5032@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

"JJ" <abc@.xyz.comwrote in message
news:upc0RncrHHA.4828@.TK2MSFTNGP04.phx.gbl...
>

Quote:

Originally Posted by

>So, can anyone recommend any other html editors than can easily be used
>on a asp.net 2.0 website (and are free/opensource).


>
I've never needed anything other than this:
http://freetextbox.com/default.aspx
>
>
--
http://www.markrae.net


"JJ" <abc@.xyz.comwrote in message
news:u6E7NDdrHHA.1848@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

Hi Mark,
>
I saw that one. I think maybe my expectations are wrong...
>
Are these editors capable of editing a full html document with (for
example) a <stylecode block in the header?
>
When I try pasting a full html document with a header (including a style
block), a body, and a footer, the editors convert the whole lot to a
table, ignoring and deleting the entire style block.
>
Is it perhaps that these editors are only designed to format small chunks
of HTML and won't do an entire page?


Hmm - I'll admit to not having tried to use FreeTextBox to edit an entire
page, but I think if that is what you require, then maybe you need something
like SharePoint...

--
http://www.markrae.net
re:
!Is it perhaps that these editors are only designed to format
!small chunks of HTML and won't do an entire page?

Exactly. You can't build a whole page with freetextbox *or* FCK.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"JJ" <abc@.xyz.comwrote in message news:u6E7NDdrHHA.1848@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

Hi Mark,
>
I saw that one. I think maybe my expectations are wrong...
>
Are these editors capable of editing a full html document with (for example) a <stylecode block
in the header?
>
When I try pasting a full html document with a header (including a style block), a body, and a
footer, the editors convert the whole lot to a table, ignoring and deleting the entire style
block.
>
Is it perhaps that these editors are only designed to format small chunks of HTML and won't do an
entire page?
>
Thanks in advance,
JJ
>
"Mark Rae" <mark@.markNOSPAMrae.netwrote in message news:u74yu3crHHA.5032@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

>"JJ" <abc@.xyz.comwrote in message news:upc0RncrHHA.4828@.TK2MSFTNGP04.phx.gbl...
>>

Quote:

Originally Posted by

>>So, can anyone recommend any other html editors than can easily be used on a asp.net 2.0 website
>>(and are free/opensource).


>>
>I've never needed anything other than this:
>http://freetextbox.com/default.aspx
>>
>>
>--
>http://www.markrae.net


>
>


I do hope there's another solution - its too late to adopt sharepoint in
this case.
Thanks,
JJ

"Mark Rae" <mark@.markNOSPAMrae.netwrote in message
news:e6NRVGdrHHA.4300@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

"JJ" <abc@.xyz.comwrote in message
news:u6E7NDdrHHA.1848@.TK2MSFTNGP03.phx.gbl...
>

Quote:

Originally Posted by

>Hi Mark,
>>
>I saw that one. I think maybe my expectations are wrong...
>>
>Are these editors capable of editing a full html document with (for
>example) a <stylecode block in the header?
>>
>When I try pasting a full html document with a header (including a style
>block), a body, and a footer, the editors convert the whole lot to a
>table, ignoring and deleting the entire style block.
>>
>Is it perhaps that these editors are only designed to format small chunks
>of HTML and won't do an entire page?


>
Hmm - I'll admit to not having tried to use FreeTextBox to edit an entire
page, but I think if that is what you require, then maybe you need
something like SharePoint...
>
>
--
http://www.markrae.net


Actually it does work ok with FCK - but only in IE. Firefox somehow acts
completely differently.
Do you know of any editors that will do the header section as well in both
browsers?

JJ

"Juan T. Llibre" <nomailreplies@.nowhere.comwrote in message
news:e2acu5drHHA.1380@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

re:
!Is it perhaps that these editors are only designed to format
!small chunks of HTML and won't do an entire page?
>
Exactly. You can't build a whole page with freetextbox *or* FCK.
>
>
>
>
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"JJ" <abc@.xyz.comwrote in message
news:u6E7NDdrHHA.1848@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

>Hi Mark,
>>
>I saw that one. I think maybe my expectations are wrong...
>>
>Are these editors capable of editing a full html document with (for
>example) a <stylecode block in the header?
>>
>When I try pasting a full html document with a header (including a style
>block), a body, and a footer, the editors convert the whole lot to a
>table, ignoring and deleting the entire style block.
>>
>Is it perhaps that these editors are only designed to format small chunks
>of HTML and won't do an entire page?
>>
>Thanks in advance,
>JJ
>>
>"Mark Rae" <mark@.markNOSPAMrae.netwrote in message
>news:u74yu3crHHA.5032@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

>>"JJ" <abc@.xyz.comwrote in message
>>news:upc0RncrHHA.4828@.TK2MSFTNGP04.phx.gbl...
>>>
>>>So, can anyone recommend any other html editors than can easily be used
>>>on a asp.net 2.0 website (and are free/opensource).
>>>
>>I've never needed anything other than this:
>>http://freetextbox.com/default.aspx
>>>
>>>
>>--
>>http://www.markrae.net


>>
>>


>
>


re:
!Actually it does work ok with FCK - but only in IE.
!Firefox somehow acts completely differently.

IE is very lenient when it comes to ignoring superfluous html tags.

Think of it this way :

When you use an online editor, what you edit is meant to be embedded in an html page.
If you include double html/head/body tags, would you expect a browser to honor them ?

I wouldn't.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"JJ" <abc@.xyz.comwrote in message news:uQKVbEerHHA.1404@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

Actually it does work ok with FCK - but only in IE. Firefox somehow acts completely differently.
Do you know of any editors that will do the header section as well in both browsers?
>
JJ
>
"Juan T. Llibre" <nomailreplies@.nowhere.comwrote in message
news:e2acu5drHHA.1380@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

>re:
>!Is it perhaps that these editors are only designed to format
>!small chunks of HTML and won't do an entire page?
>>
>Exactly. You can't build a whole page with freetextbox *or* FCK.
>>
>>
>>
>>
>Juan T. Llibre, asp.net MVP
>asp.net faq : http://asp.net.do/faq/
>foros de asp.net, en espaol : http://asp.net.do/foros/
>======================================
>"JJ" <abc@.xyz.comwrote in message news:u6E7NDdrHHA.1848@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

>>Hi Mark,
>>>
>>I saw that one. I think maybe my expectations are wrong...
>>>
>>Are these editors capable of editing a full html document with (for example) a <stylecode
>>block in the header?
>>>
>>When I try pasting a full html document with a header (including a style block), a body, and a
>>footer, the editors convert the whole lot to a table, ignoring and deleting the entire style
>>block.
>>>
>>Is it perhaps that these editors are only designed to format small chunks of HTML and won't do
>>an entire page?
>>>
>>Thanks in advance,
>>JJ
>>>
>>"Mark Rae" <mark@.markNOSPAMrae.netwrote in message
>>news:u74yu3crHHA.5032@.TK2MSFTNGP02.phx.gbl...
>>>"JJ" <abc@.xyz.comwrote in message news:upc0RncrHHA.4828@.TK2MSFTNGP04.phx.gbl...
>>
>>So, can anyone recommend any other html editors than can easily be used on a asp.net 2.0
>>website (and are free/opensource).
>>
>>>I've never needed anything other than this:
>>>http://freetextbox.com/default.aspx
>>
>>
>>>--
>>>http://www.markrae.net
>>>
>>>


>>
>>


>
>


try posting this question in an FCKeditor forum, you may have better luck

"JJ" <abc@.xyz.comwrote in message news:upc0RncrHHA.4828@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

>I am/was using FCKeditor to allow users to submit HTML, however I am coming accross a serious bug which removes all style code
>blocks when a user submits html using Firefox 2.0.x .
>
So, can anyone recommend any other html editors than can easily be used on a asp.net 2.0 website (and are free/opensource).
>
Thanks,
>
JJ
>


Try this one : http://www.obout.com/editor_new/
Stan
That looks like a seriously good component. It worked with full page html in
both IE and Firefox. Its a shame its not a (free) opensource component
though - I guess I can't have it all can I...(!)
JJ
"Stan SR" <stan@.pasdepam.netsunset.comwrote in message
news:uBY44qerHHA.1172@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

Try this one : http://www.obout.com/editor_new/
>
Stan


Check out Macromedia's HomeSite. I used that way back for HTML coding and
now it has support of .aspx file extensions.
http://www.adobe.com/products/homesite/
Mike
'IGotYourDotNet'
http://igotyourdotnet.blogspot.com/
"JJ" <abc@.xyz.comwrote in message
news:upc0RncrHHA.4828@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

>I am/was using FCKeditor to allow users to submit HTML, however I am coming
>accross a serious bug which removes all style code blocks when a user
>submits html using Firefox 2.0.x .
>
So, can anyone recommend any other html editors than can easily be used on
a asp.net 2.0 website (and are free/opensource).
>
Thanks,
>
JJ
>


In article <eOdwS1erHHA.1208@.TK2MSFTNGP05.phx.gbl>, JJ <abc@.xyz.com>
writes

Quote:

Originally Posted by

>That looks like a seriously good component. It worked with full page html in
>both IE and Firefox. Its a shame its not a (free) opensource component
>though - I guess I can't have it all can I...(!)


It looks free to me. If it's as good as it looks, why do you need open
source? There's no need to change it.

Quote:

Originally Posted by

>JJ
>"Stan SR" <stan@.pasdepam.netsunset.comwrote in message
>news:uBY44qerHHA.1172@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

>Try this one : http://www.obout.com/editor_new/
>>
>Stan


>
>


--
Alan Silver
(anything added below this line is nothing to do with me)
In article <u74yu3crHHA.5032@.TK2MSFTNGP02.phx.gbl>, Mark Rae
<mark@.markNOSPAMrae.netwrites

Quote:

Originally Posted by

>"JJ" <abc@.xyz.comwrote in message
>news:upc0RncrHHA.4828@.TK2MSFTNGP04.phx.gbl...
>

Quote:

Originally Posted by

>So, can anyone recommend any other html editors than can easily be
>>used on a asp.net 2.0 website (and are free/opensource).


>
>I've never needed anything other than this:
>http://freetextbox.com/default.aspx


Depends what you want. I regularly get "script unresponsive" errors with
FTB, not to mention the appalling rubbish HTML that it generates. Add to
that the complete lack of any decent documentation and no support and,
well, I guess there's little to recommend it!

Just my 2c. I am in no way affiliated with FTB, just a frustrated
developer who has wasted too much time trying to get it work.

--
Alan Silver
(anything added below this line is nothing to do with me)
Hi Alan,

I'd presumed the downloads were somehow time limited as the costs are listed
next to each component (including the html editor).
Does it say it is free to use somewhere?

Thanks,

JJ

"Alan Silver" <alan-silver@.nospam.thanx.invalidwrote in message
news:6aC5Ayf4HZcGFw0Y@.nospamthankyou.spam...

Quote:

Originally Posted by

In article <eOdwS1erHHA.1208@.TK2MSFTNGP05.phx.gbl>, JJ <abc@.xyz.com>
writes

Quote:

Originally Posted by

>>That looks like a seriously good component. It worked with full page html
>>in
>>both IE and Firefox. Its a shame its not a (free) opensource component
>>though - I guess I can't have it all can I...(!)


>
It looks free to me. If it's as good as it looks, why do you need open
source? There's no need to change it.
>

Quote:

Originally Posted by

>>JJ
>>"Stan SR" <stan@.pasdepam.netsunset.comwrote in message
>>news:uBY44qerHHA.1172@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

>>Try this one : http://www.obout.com/editor_new/
>>>
>>Stan


>>
>>


>
--
Alan Silver
(anything added below this line is nothing to do with me)


In article <ud9mCLzrHHA.3448@.TK2MSFTNGP05.phx.gbl>, JJ <abc@.xyz.com>
writes

Quote:

Originally Posted by

>Hi Alan,
>
>I'd presumed the downloads were somehow time limited as the costs are listed
>next to each component (including the html editor).
>Does it say it is free to use somewhere?


My mistake. I looked at the info about the components, and couldn't see
anything about pricing. The download page didn't mention it either, so I
naively assumed it was free! I hadn't seen a pricing page anywhere.
Looking again I spotted one linked from the "quick links" at the top
right.

Shame, it looked like a good component.

So, I'm also looking for a decent (X)HTML editor for ASP.NET. None of
the free or cheap ones I've seen so far produce anything like decent
(X)HTML, they all produce outdated junk.

If you find anything, please post back.

--
Alan Silver
(anything added below this line is nothing to do with me)
LOXWel Hey, there is what you need.
LOXWel Hey, there is what you need.

HTML document in aspx page

Hi friends,
I am using .NET 1.1 and write my code in VB. I want to place a HTML or XML document in an aspx page using a frame or a component like that which will let the user go up and down with scroll bars.
Thanks in advance
Regards...You could use an iFrame (http://www.w3schools.com/tags/tag_iframe.asp)
Firstly,
Thank you for your quick response. But i have a strange problem. I added an iframe to my aspx page. It looks very nice. The problem is when i click on "view in browser" it works but F5 does not. I could not solve the problem. (i write my code in vb.net 2003)
thanks for your time.
Regards...
More detail would be good, in what way doesn't it work?
When i press F5 to run the app, i can see iframe on page but there is no data in it. It is blank.
Show your iframe code, and however you are assigning its src attribute.
Hi friends,
Thanks for your time and support. It works fine.
Regards...

Thursday, March 22, 2012

HTML control value to an ASP.NET value

Hi. I have the following HTML Control and I want to access the value in my asp.net code.

<INPUT ID="hdnFPrintNA" runat=server STYLE="Z-INDEX: 163; LEFT: 165px; WIDTH: 38px; POSITION: absolute; TOP: 5px; HEIGHT: 22px" TYPE="hidden" SIZE="1">
--------------
When the user presses my Server control button to clear the screen, I would like to clear the hidden text field as well. The below doesn't work.

Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click

hdnFPrintNA.Text = ""

End Sub
-------------
I have been searching this site to try and find the answer but I am only getting confused. Can any one point me in the right direction and tell me how to solve this problem?

ThanksI think it should read

hdnFPrintNA.value =""
Try using "hdnFPrintNA.Value" instead. And also remember to define your Html Control as:

'System.Web.UI.HtmlControls.HtmlInputHidden'
Thank you both for your help. It works now. :)

HTML code warnings in asp.net html code view

Hi,
This is a silly question. I'm relatively new to asp.net and asp at all. But
I always had this doubt.
I'm working with Visual Studio and while exploring the ASPCommerce starter
kit, when I switch from design view to html code view, I see many keywords
underlied, like if they were invalid, however, they're not, they display
fine and the project runs fine.
Example, the next, the "link" keyword is underlied and it popups to : "the
active scheme does not support element link"
<link rel="stylesheet" type="text/css" href="http://links.10026.com/?link=ASPNETCommerce.css">
More, all the margin related attribute, are marked as : Could not find any
attribute "leftmargin" of element body
<body background="images/sitebkgrdnogray.gif" leftmargin="0" topmargin="0"
rightmargin="0"
bottommargin="0" marginheight="0" marginwidth="0">
And so on ...
So, could someone explain, what are all these warnings and where they are
comming from ?
Regards,Hi,
It's the VS internal html validation, which by default (with no meta header
"vs_targetSchema" in the head) validates against IE 3/NN 3. If you set the
document property targetSchema to Internet Explorer 5 most, if not all, of
these "errors" will disappear.
Greetings
Martin
"Craig Kenisston" <craigkenisston@.hotmail.com> wrote in message
news:OUcqF5HrEHA.3408@.TK2MSFTNGP10.phx.gbl...
> Hi,
> This is a silly question. I'm relatively new to asp.net and asp at all.
But
> I always had this doubt.
> I'm working with Visual Studio and while exploring the ASPCommerce starter
> kit, when I switch from design view to html code view, I see many keywords
> underlied, like if they were invalid, however, they're not, they display
> fine and the project runs fine.
> Example, the next, the "link" keyword is underlied and it popups to : "the
> active scheme does not support element link"
> <link rel="stylesheet" type="text/css" href="http://links.10026.com/?link=ASPNETCommerce.css">
> More, all the margin related attribute, are marked as : Could not find any
> attribute "leftmargin" of element body
> <body background="images/sitebkgrdnogray.gif" leftmargin="0"
topmargin="0"
> rightmargin="0"
> bottommargin="0" marginheight="0" marginwidth="0">
> And so on ...
> So, could someone explain, what are all these warnings and where they are
> comming from ?
>
> Regards,
>
>
Martin :
Thanks, I did it, set it to Internet Explorer 5.0 (the higher option
available there), and in fact it disappeared almost all.
However, these still there warning:
marginheight="0" marginwidth="0"
What does this have as special ?
Regards,
"Martin Dechev" <detcheff_@.hotmail.com> wrote in message
news:Oga7WOIrEHA.1900@.TK2MSFTNGP10.phx.gbl...
> Hi,
> It's the VS internal html validation, which by default (with no meta
> header
> "vs_targetSchema" in the head) validates against IE 3/NN 3. If you set the
> document property targetSchema to Internet Explorer 5 most, if not all, of
> these "errors" will disappear.
> Greetings
> Martin
> "Craig Kenisston" <craigkenisston@.hotmail.com> wrote in message
> news:OUcqF5HrEHA.3408@.TK2MSFTNGP10.phx.gbl...
> But
> topmargin="0"
>
Hi,
These are not in the w3c standards (they are in fact, but apply only for
frame and iframe) and will be ignored by browsers. I prefer setting the
margins of the body of the document using the style attribute:
<body style="margin: 0px;">
or assigning it a css class alternatively.
Greetings
Martin
"Craig Kenisston" <craigkenisston@.hotmail.com> wrote in message
news:OC1TqVIrEHA.3288@.TK2MSFTNGP12.phx.gbl...
> Martin :
> Thanks, I did it, set it to Internet Explorer 5.0 (the higher option
> available there), and in fact it disappeared almost all.
> However, these still there warning:
> marginheight="0" marginwidth="0"
> What does this have as special ?
> Regards,
>
> "Martin Dechev" <detcheff_@.hotmail.com> wrote in message
> news:Oga7WOIrEHA.1900@.TK2MSFTNGP10.phx.gbl...
the
of
display
are
>

HTML code warnings in asp.net html code view

Hi,

This is a silly question. I'm relatively new to asp.net and asp at all. But
I always had this doubt.

I'm working with Visual Studio and while exploring the ASPCommerce starter
kit, when I switch from design view to html code view, I see many keywords
underlied, like if they were invalid, however, they're not, they display
fine and the project runs fine.

Example, the next, the "link" keyword is underlied and it popups to : "the
active scheme does not support element link"

<link rel="stylesheet" type="text/css" href="http://links.10026.com/?link=ASPNETCommerce.css"
More, all the margin related attribute, are marked as : Could not find any
attribute "leftmargin" of element body

<body background="images/sitebkgrdnogray.gif" leftmargin="0" topmargin="0"
rightmargin="0"
bottommargin="0" marginheight="0" marginwidth="0"
And so on ...

So, could someone explain, what are all these warnings and where they are
comming from ?

Regards,Hi,

It's the VS internal html validation, which by default (with no meta header
"vs_targetSchema" in the head) validates against IE 3/NN 3. If you set the
document property targetSchema to Internet Explorer 5 most, if not all, of
these "errors" will disappear.

Greetings
Martin
"Craig Kenisston" <craigkenisston@.hotmail.com> wrote in message
news:OUcqF5HrEHA.3408@.TK2MSFTNGP10.phx.gbl...
> Hi,
> This is a silly question. I'm relatively new to asp.net and asp at all.
But
> I always had this doubt.
> I'm working with Visual Studio and while exploring the ASPCommerce starter
> kit, when I switch from design view to html code view, I see many keywords
> underlied, like if they were invalid, however, they're not, they display
> fine and the project runs fine.
> Example, the next, the "link" keyword is underlied and it popups to : "the
> active scheme does not support element link"
> <link rel="stylesheet" type="text/css" href="http://links.10026.com/?link=ASPNETCommerce.css">
> More, all the margin related attribute, are marked as : Could not find any
> attribute "leftmargin" of element body
> <body background="images/sitebkgrdnogray.gif" leftmargin="0"
topmargin="0"
> rightmargin="0"
> bottommargin="0" marginheight="0" marginwidth="0">
> And so on ...
> So, could someone explain, what are all these warnings and where they are
> comming from ?
>
> Regards,
>
Martin :

Thanks, I did it, set it to Internet Explorer 5.0 (the higher option
available there), and in fact it disappeared almost all.
However, these still there warning:

marginheight="0" marginwidth="0"

What does this have as special ?

Regards,

"Martin Dechev" <detcheff_@.hotmail.com> wrote in message
news:Oga7WOIrEHA.1900@.TK2MSFTNGP10.phx.gbl...
> Hi,
> It's the VS internal html validation, which by default (with no meta
> header
> "vs_targetSchema" in the head) validates against IE 3/NN 3. If you set the
> document property targetSchema to Internet Explorer 5 most, if not all, of
> these "errors" will disappear.
> Greetings
> Martin
> "Craig Kenisston" <craigkenisston@.hotmail.com> wrote in message
> news:OUcqF5HrEHA.3408@.TK2MSFTNGP10.phx.gbl...
>> Hi,
>>
>> This is a silly question. I'm relatively new to asp.net and asp at all.
> But
>> I always had this doubt.
>>
>> I'm working with Visual Studio and while exploring the ASPCommerce
>> starter
>> kit, when I switch from design view to html code view, I see many
>> keywords
>> underlied, like if they were invalid, however, they're not, they display
>> fine and the project runs fine.
>>
>> Example, the next, the "link" keyword is underlied and it popups to :
>> "the
>> active scheme does not support element link"
>>
>> <link rel="stylesheet" type="text/css" href="http://links.10026.com/?link=ASPNETCommerce.css">
>>
>> More, all the margin related attribute, are marked as : Could not find
>> any
>> attribute "leftmargin" of element body
>>
>> <body background="images/sitebkgrdnogray.gif" leftmargin="0"
> topmargin="0"
>> rightmargin="0"
>> bottommargin="0" marginheight="0" marginwidth="0">
>>
>> And so on ...
>>
>> So, could someone explain, what are all these warnings and where they are
>> comming from ?
>>
>>
>> Regards,
>>
>>
>>
>>
Hi,

These are not in the w3c standards (they are in fact, but apply only for
frame and iframe) and will be ignored by browsers. I prefer setting the
margins of the body of the document using the style attribute:

<body style="margin: 0px;"
or assigning it a css class alternatively.

Greetings
Martin
"Craig Kenisston" <craigkenisston@.hotmail.com> wrote in message
news:OC1TqVIrEHA.3288@.TK2MSFTNGP12.phx.gbl...
> Martin :
> Thanks, I did it, set it to Internet Explorer 5.0 (the higher option
> available there), and in fact it disappeared almost all.
> However, these still there warning:
> marginheight="0" marginwidth="0"
> What does this have as special ?
> Regards,
>
> "Martin Dechev" <detcheff_@.hotmail.com> wrote in message
> news:Oga7WOIrEHA.1900@.TK2MSFTNGP10.phx.gbl...
> > Hi,
> > It's the VS internal html validation, which by default (with no meta
> > header
> > "vs_targetSchema" in the head) validates against IE 3/NN 3. If you set
the
> > document property targetSchema to Internet Explorer 5 most, if not all,
of
> > these "errors" will disappear.
> > Greetings
> > Martin
> > "Craig Kenisston" <craigkenisston@.hotmail.com> wrote in message
> > news:OUcqF5HrEHA.3408@.TK2MSFTNGP10.phx.gbl...
> >> Hi,
> >>
> >> This is a silly question. I'm relatively new to asp.net and asp at all.
> > But
> >> I always had this doubt.
> >>
> >> I'm working with Visual Studio and while exploring the ASPCommerce
> >> starter
> >> kit, when I switch from design view to html code view, I see many
> >> keywords
> >> underlied, like if they were invalid, however, they're not, they
display
> >> fine and the project runs fine.
> >>
> >> Example, the next, the "link" keyword is underlied and it popups to :
> >> "the
> >> active scheme does not support element link"
> >>
> >> <link rel="stylesheet" type="text/css" href="http://links.10026.com/?link=ASPNETCommerce.css">
> >>
> >> More, all the margin related attribute, are marked as : Could not find
> >> any
> >> attribute "leftmargin" of element body
> >>
> >> <body background="images/sitebkgrdnogray.gif" leftmargin="0"
> > topmargin="0"
> >> rightmargin="0"
> >> bottommargin="0" marginheight="0" marginwidth="0">
> >>
> >> And so on ...
> >>
> >> So, could someone explain, what are all these warnings and where they
are
> >> comming from ?
> >>
> >>
> >> Regards,
> >>
> >>
> >>
> >>

html code of web controls

is there any way i can get the corresponding HTML code of a web control?

For example, i have an asp.net table with w/ one row and one cell with the text "sample". I want to get this string:

"<table><tr><td>sample</td></tr></table>"

Is this possible?i guess you could put the web control on your page, press the run button,then right click on the webbrowser,nd in the context menu click view source, you can find the html code for you control there
Yeah, but I need to retrieve the html code from the program. Anyway, I have already solved it. Here's the code I used:

//returns the html code of the specified web control
public static string RenderHTML(System.Web.UI.WebControls.WebControl control)
{

StringBuilder SB = new StringBuilder();
System.IO.StringWriter SW = new System.IO.StringWriter(SB);
System.Web.UI.Html32TextWriter htmlTW = new Html32TextWriter(SW);
control.RenderControl(htmlTW);
string html = SB.ToString();
return html;
}

html code of repeater

I have <asp:Repeater runat="server"> control in my page.
How can I get(read) HTML code of <asp:repeater> which is render to the page?
Thank you,
SHi,
this article helps you
Enhancing the 'Email the Rendered Output of an ASP.NET Web Control' Code
http://aspnet.4guysfromrolla.com/articles/102203-1.aspx
The mechanism presented is general to all controls.
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU