|
Code behind allows you to seperate presentation from code. i.e. you don't need to embed asp script with html code. You can also share a code-behind module between pages. If you develop a common rountine it can used by all your pages.
|
|
|
|
|
Thank you Mark
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Anyone run into this problem?
I built a C# web app and then FTP'd it, after building in release, to a hosting server. When I try accessing the page I get an error. "Could not load type namespace.page".
Microsoft Technet says the problem is that C# Web Apps must be built if they contain code-behind modules. I checked again to make sure it was built. Still no luck. Since the article also said it occurs with C# and not VB.NET I created a simple VB.NET webapp and copied it to the deployment server. Same error.
|
|
|
|
|
Found the problem. There was no aspnet_client folder in the web root.
|
|
|
|
|
I just want to make an "Hello World" for ASP.Net. A simple file that displays to the user "Hello World" in C#... With no overhead. In ASP regular, it was easy... I just did <% Response.Write "Hello World" %>
What do I do in aspx??? I don't even know, exactly, how to tell it that I want to use C#. This is a bit overwhelming.
|
|
|
|
|
<%@ Page language="c#" runat="server" %>
<script runat="server" language="c#">
void Page_Load()
{
labelHi.Text = "Hello World";
}
</script>
<html>
<head><title>Hello</title></head>
<body>
<asp:label id="labelHi" runat="server" />
</body>
</html> That should do the trick
HTH,
James
Simplicity Rules!
|
|
|
|
|
Wait... This is how you do it? Forgive me, but that seems like a hack. Isn't there a simple way to do it? I'm looking for "response.write('hello world');"... Does everything have to be done with a control?
|
|
|
|
|
It doesn't have to be, but that is the "ASP.NET way" of doing things.
If you want to use Response.Write just throw in a script block in the body block doing so
James
Simplicity Rules!
|
|
|
|
|
If you make public member variable in your code-behind class it can be used as such:
class CodeBehind
{
public string mymessage = "Hello, World";
other stuff
.
.
.
<@ codebehind=...
<html>
<body>
<p><%=mymessage%></p>
</body>
</html>
|
|
|
|
|
This should work:
<%@ Page language="c#">
<% Response.Write("Hello World."); %>
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
After learning ASP I am now curious how I can create a CD that has a database driven html page on it.
For example, I want a CD that I can give to people that would be the same as if they were visiting my web-site. How can I do this?
Any thoughts would be really helpful,
Tim
---------------------------------------
Tim Booher
|
|
|
|
|
If you want DB access you'd need some kinda web server for the server side scripts.
Though maybe you can try calling ADO from client side VBScript, though I dont know if it will work.
Try it out anyway
Nish
Check out last week's Code Project posting stats presentation from :-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
|
|
|
|
|
In old HTML way I can do this using :
<FORM METHOD="POST" ACTION="email.asp" ENCTYPE="multipart/form-data">
<INPUT TYPE="file" NAME="anexos">
<P>
<INPUT TYPE="submit">
</FORM>
But how can I create an aspx button to perform the same task? and the .cs
part will get that file path like : MailAttachment oAttachment = new
MailAttachment('the path from users choice');
==Ken
|
|
|
|
|
|
I saw a tag parameter that can be used to stop the cacheing of a static web page some time ago. I can't find the reference now . Anyone know it please?
Jeremy Davis
http://www.astad.org
|
|
|
|
|
<%
Response.Expires = 0
Response.AddHeader "Pragma","no-cache"
Response.AddHeader "Cache-Control", "private"
%>
Fernando Finelli
|
|
|
|
|
Thanks, that is what I was thinking of. The problem is is it's for ASPs and in VBScript. I'm being forced to write CGI stuff, and was hoping ther'd be an equivalent parameter for some HTML tag...
Jeremy Davis
http://www.astad.org
|
|
|
|
|
Fernando Finelli
|
|
|
|
|
|
I am a beginner in ASP.
I have installed peer web services on my pc.
wrote a simple script to display current date
Today's date is
<% Response.Write(Date)%>
i am executing the script in browser as http://localhost
It gives me an error called Response object not found.
Do i need to set anything else?
Please help
Thanks in advance
amit
|
|
|
|
|
If you have Windows NT or Windows 2000, goto start/Program Files/Administrative Tools/Internet Service Manager and Run you web server.
Windows 95 or 98, Install the Personal Web Service.
FF
|
|
|
|
|
Thanks for reply
I am using NT.I have installed peer web services from NT workstation CD.Though my web server is running,i am not getting the current date.It just displays the HTML text.Doesnt execute script part.
I am running web server from start\programs\Microsoft peer web services\internet service manager.
Do i need to install ASP ?
I am writing my code in d:\inetpub\wwwroot-->this is the home directory.set permissions as read and execute and d:\inetpub\scripts with execute permission.
Please help
patty
|
|
|
|
|
Oh boy, someone is really taxing my brain late at night I think the asp.dll file is going to be installed when you install IIS.
HTH
Nick Parker
|
|
|
|
|
I am using NT machine.so I cant use IIS.
I downloaded NT option pack 4.0.
I installed PWS. during installation it gave me errors that CreateIISpackage or deleteIISpackage call failed.
server doesnt get started .
please help
thanks a lot
|
|
|
|
|
I write a DLL, in that i create a Word application object for open a Word document. In VB app, it works well. But when i use that DLL in an ASP project. It doesn't work. How can i do that? Use Web service?
I want to write a Web application like Mail Merge in VB. Give me some idea to write it for the Web. Thanks a lot!
|
|
|
|