Monday, March 26, 2012

Working with ASP.NET

Hi everyone

Im starting to work with ASP.NET as follow.

1. First setup IIS 5.1 on Windows XP Professional
2. I have already installed VB.NET 2003 and .NET framework is there.
3. Create virtual directory as follows.
* Right click on Default Web Site on IIS
* Chose New -> Virtual Directory
* Click Next to start Wizard
* Set WebDocs as alias
* Set content directory on E:\ASPWorks

After doing all the setup test the following application. Save it as test.aspx

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

<script runat="server">
sub Page_Load(obj as object, e as eventargs)
lblMessage.Text="Welcome to ASP"
end sub
</script>

<html><body>
<asp:Label id="lblMessage" runat="server"/>
</body></html>

Then to test this type URL as http://localhost/WebDocs/test.aspx

But browser not gives any output or any error message. Only display a blank page with title http://localhost/WebDocs/test.aspx. In the status bar gives a message Done with some errors

Is it a problem with browser? I setup windows explorer and test it. It doesnt work.

Im making sure that IIS is running when the application is test.

I cannot find that whats wrong with me. If you know what happened here please let me know that what should I do. I need your help.Did you compile the application first? What are you using to create your pages?
to mendhak,

what did you mean compile. i've never heard about compilation of a ASP application. please explain about it.
It works fine on my computer, you don't need to compile anything. The only difference is I have IIS 6.0 - but I don't know why that would make a difference.
Seeing you first installed VS, then IIS, and not mentionining it, i got to ask...did you register asp.net in iis?

Secondly...did you add the line lblMessage.Text="Welcome to ASP" then build your project? Or did you jsut type it in, then typed in http://localhost/WebDocs/test.aspx in your browser? That wont do of course...If you make changes in the code behind, you got to build it first, something that happens anyhow when you "run" from VS. (Build...compile...same thing)
Ctrl+Shift+B

Then run it by pressing F5.
Seeing you first installed VS, then IIS, and not mentionining it, i got to ask...did you register asp.net in iis?

Secondly...did you add the line lblMessage.Text="Welcome to ASP" then build your project? Or did you jsut type it in, then typed in http://localhost/WebDocs/test.aspx in your browser? That wont do of course...If you make changes in the code behind, you got to build it first, something that happens anyhow when you "run" from VS. (Build...compile...same thing)

Dear friend StrangerInBeijing,

In this case i used notepad for coding. I allready installed VS(Actually AB.NEt) and also IIS 5.1. As you mentioned that line "lblMessage.Text="Welcome to ASP" is there. But still it not work. Only blank page will displayed.

What should i do?
Ctrl+Shift+B

Then run it by pressing F5.

I used notepad for coding. Then what should i do? Still not work.
Oyi...you gonna be a good coder if you stick to notepad mate...most of us just dont had time for that.

you will have to compile from the command line..just google it will you?
Oyi...you gonna be a good coder if you stick to notepad mate...most of us just dont had time for that.

you will have to compile from the command line..just google it will you?

Hey...

Can you explain how should I do that.

Thanks for your help.
1) in the command prompt, go to the directory where your file is kept.
2) to compile your vb file type:
vbc /t:library /r:System.dll /r:System.Web.dll YourVBProgram.vb

That should create a new .dll file to stick in your bin directory.

so, in your virtual directory where you store your applicaion files, create a folder called "bin", and put the dll in there.
1) in the command prompt, go to the directory where your file is kept.
2) to compile your vb file type:
vbc /t:library /r:System.dll /r:System.Web.dll YourVBProgram.vb

That should create a new .dll file to stick in your bin directory.

so, in your virtual directory where you store your applicaion files, create a folder called "bin", and put the dll in there.

Thanks for your response. I'll try it and put my result.
Remember...VBForums is your friend.
....Google is your best friend!
A real friend is one you love, but not his wife...so these two are my only friends
Remember...VBForums is your friend.
....Google is your best friend!
A real friend is one you love, but not his wife...so these two are my only friends

Its a nice word.

Thanks
Remember...VBForums is your friend.
....Google is your best friend!
A real friend is one you love, but not his wife...so these two are my only friends
Unless your best friend is your wife.
Hey evryone...

Still my application is not working. What should I do. Please help ...

I think somthing wrong with Virtual Directry setup or IIS. Check that how I do it and try to give me a solution.
Did you get an error message when you tried to compile?

Do you get an error message when you try to access the application?

Have you checked the lockdowns in IIS?
Did you get an error message when you tried to compile?

Do you get an error message when you try to access the application?

Have you checked the lockdowns in IIS?

Still I haven't no idea what you mean Compile. I used Notepad for coding.

First i create a virtual directory. Then save the application in that directory.

Then on the browser enter the yru http://localhost/webdoc/test.aspx

webdoc is the virtual directory name, test.aspx is the application name.

I write the application to display text "Welcome to ASP", but diplay a blank page. Does not give any error.
When I say compile, I mean what StrangerInBeijing/Shanghai told you:

vbc /t:library /r:System.dll /r:System.Web.dll YourVBProgram.vb

You said "It did not work." Explain that, elaborate on it, use more words.
When I say compile, I mean what StrangerInBeijing/Shanghai told you:

vbc /t:library /r:System.dll /r:System.Web.dll YourVBProgram.vb

You said "It did not work." Explain that, elaborate on it, use more words.

Ok i'll try on that. Thanks for your help.

0 comments:

Post a Comment