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??
Thursday, March 29, 2012
html header/library file
HTML Generation from XML
I have a XMl and a XSL file. And i am generating HTML file using the XXML
and XSL file using the following code
Dim xslt As New XslTransform
Dim mydata As New XmlDocument
mydata.Load("PrintId.xml")
xslt.Load("PrintID.xslt")
Dim writer As XmlTextWriter = New
XmlTextWriter("C:\Inetpub\wwwroot\VBPDFDemo\PrintID15.html", Nothing)
xslt.Transform(mydata, Nothing, writer, Nothing)
xslt = Nothing
mydata = Nothing
writer = Nothing
The code excutes fine, But it's taking a ot of time to generate the HTML.
and the process continues even if I closed my browser and generates the file
.
How do i solve the problem. how do i minimize the time?
Can anyone help me out
Thanks in advance
Baren
HTML Generation from XML
I have a XMl and a XSL file. And i am generating HTML file using the XXML
and XSL file using the following code
Dim xslt As New XslTransform
Dim mydata As New XmlDocument
mydata.Load("PrintId.xml")
xslt.Load("PrintID.xslt")
Dim writer As XmlTextWriter = New
XmlTextWriter("C:\Inetpub\wwwroot\VBPDFDemo\PrintID15.html", Nothing)
xslt.Transform(mydata, Nothing, writer, Nothing)
xslt = Nothing
mydata = Nothing
writer = Nothing
The code excutes fine, But it's taking a ot of time to generate the HTML.
and the process continues even if I closed my browser and generates the file.
How do i solve the problem. how do i minimize the time?
Can anyone help me out
Thanks in advance
Baren
HTML Generation from XML
I have a XMl and a XSL file. And i am generating HTML file using the XXML
and XSL file using the following code
Dim xslt As New XslTransform
Dim mydata As New XmlDocument
mydata.Load("PrintId.xml")
xslt.Load("PrintID.xslt")
Dim writer As XmlTextWriter = New
XmlTextWriter("C:\Inetpub\wwwroot\VBPDFDemo\PrintID15.html", Nothing)
xslt.Transform(mydata, Nothing, writer, Nothing)
xslt = Nothing
mydata = Nothing
writer = Nothing
The code excutes fine, But it's taking a ot of time to generate the HTML.
and the process continues even if I closed my browser and generates the file.
Can anyone help me out
Thanks in advance
Baren
HTML from Codebehind file
unclear how to accomplish this. For example:
<INPUT TYPE="hidden" NAME="amount" VALUE="xx">
How do I populate the value field with the value of a variable from my
codebehind file?Add Runat=server and Id="<control id>" attibutes to your HTML or ASP.NET
server control tag. And from the code behhind, access it using <control
id>.Value (or any attribute/property). Eg:
On .aspx page: <input type=hidden id="hidX" value="xx" RunAt=server>
From code-behind:
hidX.Value = "My Value"
(After adding server control to the .aspx page from 'HTML View', you may
have to switch to Designer view come back so that the designer generates
appropriate control declarations in the code-behind file; of course, you can
declare controls manually also in the code-behind.)
HTH.
"tma" <tma@.allisconfusing.net> wrote in message
news:ub9py6VeEHA.1692@.tk2msftngp13.phx.gbl...
I'm trying to retrieve values for my HTML from the Codebehind file and I'm
unclear how to accomplish this. For example:
<INPUT TYPE="hidden" NAME="amount" VALUE="xx">
How do I populate the value field with the value of a variable from my
codebehind file?
Perhaps I should provide more code. When I implemented your suggestions the
values were not posted back. Here's a larger snippet.
<form action="https://www.somesite.com/webscr" method="post">
<input type="hidden" name="amount" runat=server id="totalamount">
The codebehind totalamount.value = 80 does not appear to be working.
"Shiva" <shiva_sm@.online.excite.com> wrote in message
news:OMMy5GWeEHA.2784@.TK2MSFTNGP10.phx.gbl...
> Add Runat=server and Id="<control id>" attibutes to your HTML or ASP.NET
> server control tag. And from the code behhind, access it using <control
> id>.Value (or any attribute/property). Eg:
> On .aspx page: <input type=hidden id="hidX" value="xx" RunAt=server>
> From code-behind:
> hidX.Value = "My Value"
> (After adding server control to the .aspx page from 'HTML View', you may
> have to switch to Designer view come back so that the designer generates
> appropriate control declarations in the code-behind file; of course, you
can
> declare controls manually also in the code-behind.)
> HTH.
> "tma" <tma@.allisconfusing.net> wrote in message
> news:ub9py6VeEHA.1692@.tk2msftngp13.phx.gbl...
> I'm trying to retrieve values for my HTML from the Codebehind file and I'm
> unclear how to accomplish this. For example:
> <INPUT TYPE="hidden" NAME="amount" VALUE="xx">
> How do I populate the value field with the value of a variable from my
> codebehind file?
>
>
In your example, the only way to do it would be to get the value of the
hidden form field from the request object:
dim val as string = Request(amount)
For other, non-form data, you will need to use Server Controls (a.k.a. Web
Form Controls) or you can transform a regular HTML element into an HTML
Server Control by adding: runat="server" into its markup.
"tma" <tma@.allisconfusing.net> wrote in message
news:ub9py6VeEHA.1692@.tk2msftngp13.phx.gbl...
> I'm trying to retrieve values for my HTML from the Codebehind file and I'm
> unclear how to accomplish this. For example:
> <INPUT TYPE="hidden" NAME="amount" VALUE="xx">
> How do I populate the value field with the value of a variable from my
> codebehind file?
>
You should add RunAt=server for the <form> tag as well. Forgot to mention
about this, sorry about that.
Make sure your code-begind has this declaration (at page level):
protected System.Web.UI.HtmlControls.HtmlInputHidden totalamount;
"tma" <tma@.allisconfusing.net> wrote in message
news:#KalCrWeEHA.3428@.TK2MSFTNGP11.phx.gbl...
Perhaps I should provide more code. When I implemented your suggestions the
values were not posted back. Here's a larger snippet.
<form action="https://www.somesite.com/webscr" method="post">
<input type="hidden" name="amount" runat=server id="totalamount">
The codebehind totalamount.value = 80 does not appear to be working.
"Shiva" <shiva_sm@.online.excite.com> wrote in message
news:OMMy5GWeEHA.2784@.TK2MSFTNGP10.phx.gbl...
> Add Runat=server and Id="<control id>" attibutes to your HTML or ASP.NET
> server control tag. And from the code behhind, access it using <control
> id>.Value (or any attribute/property). Eg:
> On .aspx page: <input type=hidden id="hidX" value="xx" RunAt=server>
> From code-behind:
> hidX.Value = "My Value"
> (After adding server control to the .aspx page from 'HTML View', you may
> have to switch to Designer view come back so that the designer generates
> appropriate control declarations in the code-behind file; of course, you
can
> declare controls manually also in the code-behind.)
> HTH.
> "tma" <tma@.allisconfusing.net> wrote in message
> news:ub9py6VeEHA.1692@.tk2msftngp13.phx.gbl...
> I'm trying to retrieve values for my HTML from the Codebehind file and I'm
> unclear how to accomplish this. For example:
> <INPUT TYPE="hidden" NAME="amount" VALUE="xx">
> How do I populate the value field with the value of a variable from my
> codebehind file?
>
>
HTML from Codebehind file
unclear how to accomplish this. For example:
<INPUT TYPE="hidden" NAME="amount" VALUE="xx"
How do I populate the value field with the value of a variable from my
codebehind file?Add Runat=server and Id="<control id>" attibutes to your HTML or ASP.NET
server control tag. And from the code behhind, access it using <control
id>.Value (or any attribute/property). Eg:
On .aspx page: <input type=hidden id="hidX" value="xx" RunAt=server
From code-behind:
hidX.Value = "My Value"
(After adding server control to the .aspx page from 'HTML View', you may
have to switch to Designer view come back so that the designer generates
appropriate control declarations in the code-behind file; of course, you can
declare controls manually also in the code-behind.)
HTH.
"tma" <tma@.allisconfusing.net> wrote in message
news:ub9py6VeEHA.1692@.tk2msftngp13.phx.gbl...
I'm trying to retrieve values for my HTML from the Codebehind file and I'm
unclear how to accomplish this. For example:
<INPUT TYPE="hidden" NAME="amount" VALUE="xx"
How do I populate the value field with the value of a variable from my
codebehind file?
Perhaps I should provide more code. When I implemented your suggestions the
values were not posted back. Here's a larger snippet.
<form action="https://www.somesite.com/webscr" method="post">
<input type="hidden" name="amount" runat=server id="totalamount"
The codebehind totalamount.value = 80 does not appear to be working.
"Shiva" <shiva_sm@.online.excite.com> wrote in message
news:OMMy5GWeEHA.2784@.TK2MSFTNGP10.phx.gbl...
> Add Runat=server and Id="<control id>" attibutes to your HTML or ASP.NET
> server control tag. And from the code behhind, access it using <control
> id>.Value (or any attribute/property). Eg:
> On .aspx page: <input type=hidden id="hidX" value="xx" RunAt=server>
> From code-behind:
> hidX.Value = "My Value"
> (After adding server control to the .aspx page from 'HTML View', you may
> have to switch to Designer view come back so that the designer generates
> appropriate control declarations in the code-behind file; of course, you
can
> declare controls manually also in the code-behind.)
> HTH.
> "tma" <tma@.allisconfusing.net> wrote in message
> news:ub9py6VeEHA.1692@.tk2msftngp13.phx.gbl...
> I'm trying to retrieve values for my HTML from the Codebehind file and I'm
> unclear how to accomplish this. For example:
> <INPUT TYPE="hidden" NAME="amount" VALUE="xx">
> How do I populate the value field with the value of a variable from my
> codebehind file?
In your example, the only way to do it would be to get the value of the
hidden form field from the request object:
dim val as string = Request(amount)
For other, non-form data, you will need to use Server Controls (a.k.a. Web
Form Controls) or you can transform a regular HTML element into an HTML
Server Control by adding: runat="server" into its markup.
"tma" <tma@.allisconfusing.net> wrote in message
news:ub9py6VeEHA.1692@.tk2msftngp13.phx.gbl...
> I'm trying to retrieve values for my HTML from the Codebehind file and I'm
> unclear how to accomplish this. For example:
> <INPUT TYPE="hidden" NAME="amount" VALUE="xx">
> How do I populate the value field with the value of a variable from my
> codebehind file?
You should add RunAt=server for the <form> tag as well. Forgot to mention
about this, sorry about that.
Make sure your code-begind has this declaration (at page level):
protected System.Web.UI.HtmlControls.HtmlInputHidden totalamount;
"tma" <tma@.allisconfusing.net> wrote in message
news:#KalCrWeEHA.3428@.TK2MSFTNGP11.phx.gbl...
Perhaps I should provide more code. When I implemented your suggestions the
values were not posted back. Here's a larger snippet.
<form action="https://www.somesite.com/webscr" method="post">
<input type="hidden" name="amount" runat=server id="totalamount"
The codebehind totalamount.value = 80 does not appear to be working.
"Shiva" <shiva_sm@.online.excite.com> wrote in message
news:OMMy5GWeEHA.2784@.TK2MSFTNGP10.phx.gbl...
> Add Runat=server and Id="<control id>" attibutes to your HTML or ASP.NET
> server control tag. And from the code behhind, access it using <control
> id>.Value (or any attribute/property). Eg:
> On .aspx page: <input type=hidden id="hidX" value="xx" RunAt=server>
> From code-behind:
> hidX.Value = "My Value"
> (After adding server control to the .aspx page from 'HTML View', you may
> have to switch to Designer view come back so that the designer generates
> appropriate control declarations in the code-behind file; of course, you
can
> declare controls manually also in the code-behind.)
> HTH.
> "tma" <tma@.allisconfusing.net> wrote in message
> news:ub9py6VeEHA.1692@.tk2msftngp13.phx.gbl...
> I'm trying to retrieve values for my HTML from the Codebehind file and I'm
> unclear how to accomplish this. For example:
> <INPUT TYPE="hidden" NAME="amount" VALUE="xx">
> How do I populate the value field with the value of a variable from my
> codebehind file?
Monday, March 26, 2012
HTML formatting from VB.NET
I have a line in my VB.NET codebehind file that populates a textbox when loaded:
tbEmailContent.Text = record.job_number & "<br>" & record.completed_by & "<br>" & record.ssigned_to
The problem is that it actually shows <br> and does not use differerent lines.
Please advise how I can get the various record parts to show on different lines.
Cheers
John
Textbox control doesnt use HTML
1) set the Textbox control to MultiLine
2) for a linebreak use VbCrLf instead of "<br>"...text & VbCrLf & moretext & VbCrLf...
That should do it.
HTML formatted memorystream.. how to return it in its own browser window ?
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 ?
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 format
if text is "bold"
i want show
text "bold" who is boldI don't think you can do this unless you are viewing some type of source. As you know, you have < b > tags in html to represent something in bold. You need to have this in your source txt file, or you need a way to find the bold item code in the source file and replace it with the html counterpart. You can always then post the resulting HTML code in a literal or something to that effect. I am a bit confused on this because in a basic text file, the font is all or nothing for the entire file. I cannot open notepad and have one letter or word in bold.
HTML first, Page_Load later
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
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 Files from IE
Why i cannot see the content of a HTML file, when i open it directly from
IE, it shows "canceled action"Hi Laurahn,
What HTML file is it? Does it it contain script? By default, IE will block
script executing if the file is opened locally.
Please post the html file or some of its code here so that we can help
further. Thanks.
By the way, not sure if it applies but if you're using <script> block in
the html file, remember IE doesn't support <script />, you must use
<script></script>.
Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
Hi Laurahn,
If you see this, would you please reply here to let me know the status of
this post? Thanks.
Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
HTML Files from IE
Why i cannot see the content of a HTML file, when i open it directly from
IE, it shows "canceled action"Hi Laurahn,
What HTML file is it? Does it it contain script? By default, IE will block
script executing if the file is opened locally.
Please post the html file or some of its code here so that we can help
further. Thanks.
By the way, not sure if it applies but if you're using <scriptblock in
the html file, remember IE doesn't support <script />, you must use
<script></script>.
Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Hi Laurahn,
If you see this, would you please reply here to let me know the status of
this post? Thanks.
Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
HTML File Uploader
I have recently developed a few sites with an uploader
facility for images and all has worked perfectly, until
now?
I re-installed .NET due to an unrelated problem and since
then if I use a WebServer Button control to submit the
form I have nothing within the Html uploader component
it's 'null'??
If I use a HTML submit button things work ok, this never
happended before does anyone have any ideas whats
happended, or what I'm doing wrong??
Regards
AndyHi Andy,
Thank you for posting to the MSDN newsgroups.
Based on my research and experience, please test the sample in the
following articles on your side.
HOW TO: Upload a File to a Web Server in ASP.NET by Using Visual C# .NET
http://support.microsoft.com/defaul...kb;EN-US;323246
HOW TO: Upload a File to a Web Server in ASP.NET by Using Visual Basic .NET
http://support.microsoft.com/defaul...kb;EN-US;323245
If you can reproduce the same problem, please tell me how to reproduce the
problem step by step on my side. I certainly appreciate your time.
If I have misunderstood your concern, please feel free to let me know.
Best regards,
Jacob Yang
Microsoft Online Partner Support
Get Secure! C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Hi thanks
I will review that article, I have made my code work by
using a normal image and putting some JavaScript behind
it to submit the form by code.
Incidentally the sites all work perfectly in their old
guise on my website!!!
Regards
Andy
>--Original Message--
>Hi Andy,
>Thank you for posting to the MSDN newsgroups.
>Based on my research and experience, please test the
sample in the
>following articles on your side.
>HOW TO: Upload a File to a Web Server in ASP.NET by
Using Visual C# .NET
>http://support.microsoft.com/default.aspx?scid=kb;EN-
US;323246
>HOW TO: Upload a File to a Web Server in ASP.NET by
Using Visual Basic .NET
>http://support.microsoft.com/default.aspx?scid=kb;EN-
US;323245
>If you can reproduce the same problem, please tell me
how to reproduce the
>problem step by step on my side. I certainly appreciate
your time.
>If I have misunderstood your concern, please feel free
to let me know.
>Best regards,
>Jacob Yang
>Microsoft Online Partner Support
>Get Secure! C www.microsoft.com/security
>This posting is provided "as is" with no warranties and
confers no rights.
>.
HTML file server side includes plus forms authentication
massive dll written in C++ that produces most of the output from a SQL 7.0
data base on NT4 onto IIS on Windows 2003 Server with SQL 2000. All new
code is being written in C# using ASP.NET and we are using forms
authentication to control access to particular directories/applications.
We are having a hard time figuring out how to configure the thing so that
existing html files both a) have access controlled through ASP.NET forms
authentication and b) render server side includes correctly. If we
configure the htm/html files for the application on IIS to be handled by
ssinc.dll the includes are rendered correctly, but access is not restricted
by forms authentication. If we configure them to be handled by
aspnet_isapi.dll we get forms authentication control, but the includes are
ignored.
Oddly, simply renaming a file from *.html to *.aspx with no other changes
results in aspnet_isapi.dll handling it correctly -- providing forms
authentication access control and also rendering includes correctly. But if
the file name is *.htm or *.html, aspnet_isapi.dll fails to include the
includes. It almost seems like this is a bug! I cannot, at any rate, see
any reason why it would do this by design.
So, in theory, we could solve the problem by just re-naming all our htm/html
files with an aspx extension instead. Unfortunately this is not so easily
done in practice since the old C++ .dll that creates most pages and fills
them with stuff from the data base has hyperlinks to the *.html files hard
coded into it all over the place. It is not impossible to change this, but
we'd like to find a simpler way.
Can anyone offer a suggestion for a way to resolve this problem? Is it
simply a bug that aspnet_isapi.dll renders includes for *.aspx files but
fails to do so for an otherwise identical files with a .htm or .html
extension?
All the best,
will
William F. Zachmann, President
Canopus Research Inc.
http://www.canopusresearch.comHi William!
> Is it
> simply a bug that aspnet_isapi.dll renders includes for *.aspx files but
> fails to do so for an otherwise identical files with a .htm or .html
> extension?
I don't think it's a bug. Probably your IIS is configured in way that
*.aspx files are handled by aspnet_isapi.dll, but .htm/.html are not. To
change this mapping (for IIS 6) go to "Application settings" (tab "Home
directory" or "Virtual directory")
"Application settings", click "Configuration". On the "Mapping" tab, have a
look at the "Application extension", especially the ".aspx" mapping. Create
a similar extension mapping for ".htm" and ".html".
Now IIS will handle your .htm files using aspnet_isapi.dll. If you still
need more control you will need a custom http handler.
Alex
http://www.DotNet42.com - The Answer to Your DotNet Question
"William F. Zachmann" wrote:
> We've got a project going that involves moving an old web site with a
> massive dll written in C++ that produces most of the output from a SQL 7.0
> data base on NT4 onto IIS on Windows 2003 Server with SQL 2000. All new
> code is being written in C# using ASP.NET and we are using forms
> authentication to control access to particular directories/applications.
> We are having a hard time figuring out how to configure the thing so that
> existing html files both a) have access controlled through ASP.NET forms
> authentication and b) render server side includes correctly. If we
> configure the htm/html files for the application on IIS to be handled by
> ssinc.dll the includes are rendered correctly, but access is not restricte
d
> by forms authentication. If we configure them to be handled by
> aspnet_isapi.dll we get forms authentication control, but the includes are
> ignored.
> Oddly, simply renaming a file from *.html to *.aspx with no other changes
> results in aspnet_isapi.dll handling it correctly -- providing forms
> authentication access control and also rendering includes correctly. But
if
> the file name is *.htm or *.html, aspnet_isapi.dll fails to include the
> includes. It almost seems like this is a bug! I cannot, at any rate, see
> any reason why it would do this by design.
> So, in theory, we could solve the problem by just re-naming all our htm/ht
ml
> files with an aspx extension instead. Unfortunately this is not so easily
> done in practice since the old C++ .dll that creates most pages and fills
> them with stuff from the data base has hyperlinks to the *.html files hard
> coded into it all over the place. It is not impossible to change this, bu
t
> we'd like to find a simpler way.
> Can anyone offer a suggestion for a way to resolve this problem? Is it
> simply a bug that aspnet_isapi.dll renders includes for *.aspx files but
> fails to do so for an otherwise identical files with a .htm or .html
> extension?
> All the best,
> will
> William F. Zachmann, President
> Canopus Research Inc.
> http://www.canopusresearch.com
>
>
Alex,
Apparently I was not clear enough. I had already done that. IIS is already
handling my htm/html files through aspnet_isapi.dll. That brings them under
forms control access, but the includes are not rendered correctly. If I
re-name them to *.aspx, then they are handled correctly. Named *.htm/html
(with those extensions mapped to aspnet_isapi.dll) forms control works, but
includes are not rendered. If I map them to ssinc.dll, then includes are
rendered but I get no forms based access control.
All the best,
will
"Alex" <Alex@.discussions.microsoft.com> wrote in message
news:F8316EA5-66A5-493A-BFE3-93334F741F13@.microsoft.com...
> Hi William!
>
> I don't think it's a bug. Probably your IIS is configured in way that
> *.aspx files are handled by aspnet_isapi.dll, but .htm/.html are not. To
> change this mapping (for IIS 6) go to "Application settings" (tab "Home
> directory" or "Virtual directory")
> "Application settings", click "Configuration". On the "Mapping" tab, have
> a
> look at the "Application extension", especially the ".aspx" mapping.
> Create
> a similar extension mapping for ".htm" and ".html".
> Now IIS will handle your .htm files using aspnet_isapi.dll. If you still
> need more control you will need a custom http handler.
> Alex
> http://www.DotNet42.com - The Answer to Your DotNet Question
>
>
>
> "William F. Zachmann" wrote:
>
Will,
how about this:
1. Rename your .html files to .aspx
2. For the .html hyperlinks generated by your DLL you write an HTTP Handler
that does an URL rewrite from .html to .aspx.
For example this is what happens when you click on
http://www.dotnet42.com/NG_microsof...drawing/A_605/T
hreadDetail.htm
Alex
http://www.DotNet42.com - The Answer to Your DotNet Question
"William F. Zachmann" wrote:
> We've got a project going that involves moving an old web site with a
> massive dll written in C++ that produces most of the output from a SQL 7.0
> data base on NT4 onto IIS on Windows 2003 Server with SQL 2000. All new
> code is being written in C# using ASP.NET and we are using forms
> authentication to control access to particular directories/applications.
> We are having a hard time figuring out how to configure the thing so that
> existing html files both a) have access controlled through ASP.NET forms
> authentication and b) render server side includes correctly. If we
> configure the htm/html files for the application on IIS to be handled by
> ssinc.dll the includes are rendered correctly, but access is not restricte
d
> by forms authentication. If we configure them to be handled by
> aspnet_isapi.dll we get forms authentication control, but the includes are
> ignored.
> Oddly, simply renaming a file from *.html to *.aspx with no other changes
> results in aspnet_isapi.dll handling it correctly -- providing forms
> authentication access control and also rendering includes correctly. But
if
> the file name is *.htm or *.html, aspnet_isapi.dll fails to include the
> includes. It almost seems like this is a bug! I cannot, at any rate, see
> any reason why it would do this by design.
> So, in theory, we could solve the problem by just re-naming all our htm/ht
ml
> files with an aspx extension instead. Unfortunately this is not so easily
> done in practice since the old C++ .dll that creates most pages and fills
> them with stuff from the data base has hyperlinks to the *.html files hard
> coded into it all over the place. It is not impossible to change this, bu
t
> we'd like to find a simpler way.
> Can anyone offer a suggestion for a way to resolve this problem? Is it
> simply a bug that aspnet_isapi.dll renders includes for *.aspx files but
> fails to do so for an otherwise identical files with a .htm or .html
> extension?
> All the best,
> will
> William F. Zachmann, President
> Canopus Research Inc.
> http://www.canopusresearch.com
>
>
asp.net processing is a two part
1) map file extension to asp.net dll - this enables form authenication
2) <@. page > directive is found, this causes the page to processed as an
asp.net page and implements the include logic.
you can just add the <@.page> directive to your html pages and you're good to
go.
-- bruce (sqlwork.com)
"William F. Zachmann" <wfz@.NOcanopusresearchSPAM.com> wrote in message
news:e9bNSyE2FHA.2540@.TK2MSFTNGP09.phx.gbl...
> We've got a project going that involves moving an old web site with a
> massive dll written in C++ that produces most of the output from a SQL 7.0
> data base on NT4 onto IIS on Windows 2003 Server with SQL 2000. All new
> code is being written in C# using ASP.NET and we are using forms
> authentication to control access to particular directories/applications.
> We are having a hard time figuring out how to configure the thing so that
> existing html files both a) have access controlled through ASP.NET forms
> authentication and b) render server side includes correctly. If we
> configure the htm/html files for the application on IIS to be handled by
> ssinc.dll the includes are rendered correctly, but access is not
> restricted by forms authentication. If we configure them to be handled by
> aspnet_isapi.dll we get forms authentication control, but the includes are
> ignored.
> Oddly, simply renaming a file from *.html to *.aspx with no other changes
> results in aspnet_isapi.dll handling it correctly -- providing forms
> authentication access control and also rendering includes correctly. But
> if the file name is *.htm or *.html, aspnet_isapi.dll fails to include the
> includes. It almost seems like this is a bug! I cannot, at any rate, see
> any reason why it would do this by design.
> So, in theory, we could solve the problem by just re-naming all our
> htm/html files with an aspx extension instead. Unfortunately this is not
> so easily done in practice since the old C++ .dll that creates most pages
> and fills them with stuff from the data base has hyperlinks to the *.html
> files hard coded into it all over the place. It is not impossible to
> change this, but we'd like to find a simpler way.
> Can anyone offer a suggestion for a way to resolve this problem? Is it
> simply a bug that aspnet_isapi.dll renders includes for *.aspx files but
> fails to do so for an otherwise identical files with a .htm or .html
> extension?
> All the best,
> will
> William F. Zachmann, President
> Canopus Research Inc.
> http://www.canopusresearch.com
>
Bruce,
Sounds like you have provided the specific information I needed. I will try
that out to confirm that it works. Thanks very much!
All the best,
will
"Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
news:%23CYQWpL2FHA.3568@.TK2MSFTNGP15.phx.gbl...
> asp.net processing is a two part
> 1) map file extension to asp.net dll - this enables form authenication
> 2) <@. page > directive is found, this causes the page to processed as an
> asp.net page and implements the include logic.
> you can just add the <@.page> directive to your html pages and you're good
> to go.
> -- bruce (sqlwork.com)
>
> "William F. Zachmann" <wfz@.NOcanopusresearchSPAM.com> wrote in message
> news:e9bNSyE2FHA.2540@.TK2MSFTNGP09.phx.gbl...
>
Alex,
Thanks for your intention to help however, if you read through my original
message, you will see that I have already considered the possibility of
simply re-naming the htm/html files with aspx extensions but that this is
not a very good option since the old (massive) C++ dll has many hard-coded
dependencies tied to the file (and, for that matter, directory) names. I
quite explicitly said that I was looking for another alternative.
All the best,
will
"Alex" <Alex@.discussions.microsoft.com> wrote in message
news:7CA1CE05-59A9-4107-BCAF-8675AB75E4BE@.microsoft.com...
> Will,
> how about this:
> 1. Rename your .html files to .aspx
> 2. For the .html hyperlinks generated by your DLL you write an HTTP
> Handler
> that does an URL rewrite from .html to .aspx.
> For example this is what happens when you click on
> http://www.dotnet42.com/NG_microsof...ww.DotNet42.com - The Answer to Your DotNet Question
>
> "William F. Zachmann" wrote:
>
HTML File Parsing
like xml dom and xmlreader used for working with xml files.
how can i do this with html files.
i want find all the hyperlink tags <a> and change the href
attribute to my own value.
Thanks & Regards
Raja Balaji RI've used regular expressions to parse HTML. The .NET Regular Expression
classes are very powerful.
--
John Saunders
Internet Engineer
john.saunders@.surfcontrol.com
"Raja Balaji R" <rajabalaji_r@.hotmail.com> wrote in message
news:065301c358fc$b88ee040$a501280a@.phx.gbl...
> hi,
> like xml dom and xmlreader used for working with xml files.
> how can i do this with html files.
> i want find all the hyperlink tags <a> and change the href
> attribute to my own value.
> Thanks & Regards
> Raja Balaji R
HTML file from database to user interface
I have a html document in a sql server table with tags and elements. I need
to read it from table field and show it in a web page. Is there any
component that I can use to show this html file in the browsed with
interpreting the html tags.Couldn't you just select the rows from the data and write out each raw line
with response.write(<data> )?
"JIM.H." <JIMH@.discussions.microsoft.com> wrote in message
news:10BCEEB4-E71E-43B2-849B-19E71953C348@.microsoft.com...
> HTML file from database to user interface
> I have a html document in a sql server table with tags and elements. I
> need
> to read it from table field and show it in a web page. Is there any
> component that I can use to show this html file in the browsed with
> interpreting the html tags.
>
This page has other components and I need to show this html in the middle
section, I probably need a component that does that.
"bill" wrote:
> Couldn't you just select the rows from the data and write out each raw lin
e
> with response.write(<data> )?
> "JIM.H." <JIMH@.discussions.microsoft.com> wrote in message
> news:10BCEEB4-E71E-43B2-849B-19E71953C348@.microsoft.com...
>
>
You could put this in a literal control making this html fragment appears at
the exact location you want...
Patrice
"JIM.H." <JIMH@.discussions.microsoft.com> a crit dans le message de news:
AF276C5B-8F44-4D1E-B124-33AA23223736@.microsoft.com...
> This page has other components and I need to show this html in the middle
> section, I probably need a component that does that.
> "bill" wrote:
>
I am quite new, can you give me an example pelase?
"Patrice" wrote:
> You could put this in a literal control making this html fragment appears
at
> the exact location you want...
> --
> Patrice
> "JIM.H." <JIMH@.discussions.microsoft.com> a écrit dans le message de news
:
> AF276C5B-8F44-4D1E-B124-33AA23223736@.microsoft.com...
>
>
An example of which part? You just select the data from the database, loop
through the result set, and for each loop you simply put
"response.write(<yourdata> )"...
"JIM.H." <JIMH@.discussions.microsoft.com> wrote in message
news:56642F77-1368-4BFE-82E9-17E35DAD1473@.microsoft.com...
>I am quite new, can you give me an example pelase?
> "Patrice" wrote:
>
Here is some sample/psuedo code. This should give you a good idea of
how to implement this.
<%@. 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] = @.ID"
SqlCmd.Parameters.add("@.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!
I guess you meant Literal?
JIM. H. wrote:
> HTML file from database to user interface
> I have a html document in a sql server table with tags and elements. I ne
ed
> to read it from table field and show it in a web page. Is there any
> component that I can use to show this html file in the browsed with
> interpreting the html tags.
HTML file from database to user interface
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!
Saturday, March 24, 2012
HTML data from a WinHTTP call to an ASPX page
he application will use
WinHTTP to send requests to an ASPX file running IIS 6.0
My problem is that I do not know how to prevent IIS from returning the HTTP
code of the ASPX page.
The client side use something like this to initiate the request:
set obj1 = createobject("WinHttp.WinHttpRequest.5.1")
obj1.SetProxy HTTPREQUEST_PROXYSETTING_DIRECT
obj1.Open "GET", "http://192.168.5.12/poc/winhttp.aspx", vbfalse
And in IIS, the WinHTTP ASPX page has the following
<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="winhttp.aspx.cs" Inh
erits="winhttp" %>
<html>
<body />
</html>
The C# code for now only has this;
public partial class winhttp : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Clear();
Response.Write("Data from winhttp.aspx");
}
}
What I receive from the client end is this:
Data from winhttp.aspx
<html>
<body />
</html>
I want to prevent IIS from returning the HTML data of the ASPX page. Can thi
s be done? How?
Regards,
GaetanI posted the original question because VS 2005 was producing the following e
rror message when I
removed all the HTML tags;
Validation(): Element 'html' occurs too few times.
Since then, I found out that I can turning off validations under : Tools ->
Options -> Text Editor
-> HTML -> Validation
Now, if only there were some sort of "#pragma" like feature in VS2005 to tur
n off validations on a
per file basis.