Showing posts with label app. Show all posts
Showing posts with label app. Show all posts

Monday, March 26, 2012

Newbie ASP project

Guys,

I have just developed a quite large app in VB.NET that integrates with a SQL dbase. I have now been asked to develop a very simple app in ASP, this would take me a day or so in VB.NET, but I'm gonna struggle in ASP.NET.

This project is a questionnaire that will be completed by users, via a webpage, this will then write back to a SQL database. There are 50 questions, these are always the same, the answers are multi-choice.

I'm thinking this is an easy task, but time is against me ! Has anybody got any code examples, or is there a better way to do this ! If anybody could point out the key differences between coding in ASP.NET and VB.NET it would be appreciated !

Cheers
BobIf you know VB.NET you shouldn't have too much trouble transfering over to ASP.NET. It's all very similar. The thing that ofter confuses people though is the whole client server relationship. Your ASP code will run on the server ONLY, it compiles to HTLM and some Script. So things like mouse over, timers etc don't work. Also your page is reloaded on every postback. Thus global var's don't retain there info, you need to use session var's instead. You also need to reload any buttons etc you've added and addhandler for them again. www.asp.net has a lot of good info.

TPM

Saturday, March 24, 2012

Newbie Deployment question

Hi,

I am building a ASP.NET web app that a compnay is hosting for me, and they
have given me all the FTP info so I can upload files to the virtual
directory, and they have put a default.htm file there, which says the web
site is coming.

This I fear is a lame question but how can I get my default web page to
appear instead of theirs when visitors type in www.mywebsite.com

TIA
Colin BAs long as they have ASP.NET installed, you should be able to just copy over
that default file. (Anyone) Correct me if I'm wrong, but they must have
their server set up to recognize the aspx page as a default page as well.

If they don't have the .NET framework on their server, you might be up the
creek.

"Colin Basterfield" <colinbasterfield@.hotmail.com> wrote in message
news:ext%235jaAEHA.3308@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I am building a ASP.NET web app that a compnay is hosting for me, and they
> have given me all the FTP info so I can upload files to the virtual
> directory, and they have put a default.htm file there, which says the web
> site is coming.
> This I fear is a lame question but how can I get my default web page to
> appear instead of theirs when visitors type in www.mywebsite.com
> TIA
> Colin B
Hi Pat,

> If they don't have the .NET framework on their server, you might be up the
> creek.

They do, that was why I chose them.

>Correct me if I'm wrong, but they must have their server set up to
recognize the aspx page as a default page as well.

I am assuming this to be the case.

many thanks
Colin B

"Pat Lester" <lest3560@.bellsouth.net> wrote in message
news:owz1c.32710$Tn.4372@.bignews5.bellsouth.net...
> As long as they have ASP.NET installed, you should be able to just copy
over
> that default file. (Anyone) Correct me if I'm wrong, but they must have
> their server set up to recognize the aspx page as a default page as well.
> If they don't have the .NET framework on their server, you might be up the
> creek.
>
> "Colin Basterfield" <colinbasterfield@.hotmail.com> wrote in message
> news:ext%235jaAEHA.3308@.TK2MSFTNGP10.phx.gbl...
> > Hi,
> > I am building a ASP.NET web app that a compnay is hosting for me, and
they
> > have given me all the FTP info so I can upload files to the virtual
> > directory, and they have put a default.htm file there, which says the
web
> > site is coming.
> > This I fear is a lame question but how can I get my default web page to
> > appear instead of theirs when visitors type in www.mywebsite.com
> > TIA
> > Colin B
On the document tab of the property of your virtual directory in the IIS
snap shot
they should move default.aspx up front . You should actually make sure they
have done it.
I have had the same problem with my own server especially if they are using
windows 2003 server.

And of course your applicaticon start up page should be deafult.aspx .
The idea here is , that it should what ever .htm or aspx is first listed in
"documents" of
your application property.

"Colin Basterfield" <colinbasterfield@.hotmail.com> wrote in message
news:uPDdVBbAEHA.3248@.TK2MSFTNGP11.phx.gbl...
> Hi Pat,
> > If they don't have the .NET framework on their server, you might be up
the
> > creek.
> They do, that was why I chose them.
> >Correct me if I'm wrong, but they must have their server set up to
> recognize the aspx page as a default page as well.
> I am assuming this to be the case.
> many thanks
> Colin B
> "Pat Lester" <lest3560@.bellsouth.net> wrote in message
> news:owz1c.32710$Tn.4372@.bignews5.bellsouth.net...
> > As long as they have ASP.NET installed, you should be able to just copy
> over
> > that default file. (Anyone) Correct me if I'm wrong, but they must have
> > their server set up to recognize the aspx page as a default page as
well.
> > If they don't have the .NET framework on their server, you might be up
the
> > creek.
> > "Colin Basterfield" <colinbasterfield@.hotmail.com> wrote in message
> > news:ext%235jaAEHA.3308@.TK2MSFTNGP10.phx.gbl...
> > > Hi,
> > > > I am building a ASP.NET web app that a compnay is hosting for me, and
> they
> > > have given me all the FTP info so I can upload files to the virtual
> > > directory, and they have put a default.htm file there, which says the
> web
> > > site is coming.
> > > > This I fear is a lame question but how can I get my default web page
to
> > > appear instead of theirs when visitors type in www.mywebsite.com
> > > > TIA
> > > Colin B
> >

Thursday, March 22, 2012

Newbie Microsoft VS.net Code Behind Problem

Hi!!
I am using ASP.net with Code Behind for the first time on Visual Studio. I had some problems and questions.
When we create a Web App Project in VS do i need to copy the resx file too?
Actually i made a page. It is now a .aspx file, a .aspx.vb and a .aspx.resx file. I also made a new class in a VB file. when i built the project i found the dll in the bin folder.
I uploaded the stuff onto the web page (all three, global.asax, web.config) and the dll into the bin folder of my websites root, but it doesnt work. I made some changes in my project and rebuilt it, but the changes werent reflected (i added a Response.Write in the Page_Load).
I copied the vb file to the sites root too but the thing doesnt work. Its working perfectly on my localhost.
I also wanted to know that i added the class in the file by choosing Add Class in the projects menu. So its automatically compiled to a dll right? Another thing is that in localhost the site was working in a folder and not directly in wwwroot (in a folder called even). So when i was to import my custom made namespace it was referenced as Even.MyNameSpace, but normally i compile it to a dll and do it directly.
Another thing is that i tried compiling it to a dll. Visual Studio tools and then VS.net Command prompt, followed by vbc /t:library myVbFile.vb but it couldnt compile. It couldnt find the namespace i imported. It cant even import namespaces like System.Xml etc.
Someone please help. Please tell me if i am not clear as this is a very basic problem.Lots of problems and possible issues here. To start with, you'd have to explain what "didn't work" means. Have you tested a very simple Hello World! ASPX file, with no code behind, to make sure you understand the basics of working with VS and your web host?
Jeff
Well I uploaded a file which on clicking over a button shows the contents of an XML file.
I made a namespace and added a class in it to access and XML file. In my pages code behind i use this class to return the data. (the xml contains values coupled together). The class has many function like getData1, getData2 etc.
The Class for reading the XML throws a user created exception (that i made) if no data existed, else it threw the usual exception. This is caught by the page in which i have called the xml reader class. If its the user exception it simply writes that no data was found else it writes the exceptions text. So initially as i said when i uploaded it gave a message written "The remote server returned an error: (404) Not Found." as the exception's message. I then uploaded all the files i mentioned alongwith the assemblyinfo. But it still didnt work. Then i uploaded a new file which had a "page loaded" string in its page_load, but the changes were not affected. I rebuilt the project in VS and then uploaded the new resx, aspx.vb and aspx files, but to no avail.
I have worked on Dreamweaver and without code behind. Later i tried to compile the VB file but the VS .net command prompt compiler gave me that error. My VS by default creates page with code behind only. Can this be changed? Actually i want to create my own class and compile it to a dll and then make the page inherit from the class from the dll.
I have another question. I had named my project even in VS and then started working in the folder even in the wwwroot. Now i uploaded the whole folder onto the site in a folder placed in the root with the same name as even. Made it an IIS application but still the code doesnt run. It started workng after i uploaded the aspnet_client to the even folder.
Can anyone tell me how i can deploy this to my root? Moreover when i change any file what all files do i need to upload again? Is there a way to prevent VS to automatically creating a page behind as i would like to put all my classes into a dll and then use them as page behind. Moreover when i build the project are the .vb files automatically compiled to dll?
I have one basic question. How do we deploy our VS projects to our web site? I am not able to get any file to work on the website. I have no problems at my own computer and everything is working fine. I am sure a lot of people here can teach me how to deploy VS projects? What all changes etc have to be done?
Im no expert here but if you compile this as a release instead of a Debug build and then create a "Web Setup Project" under the New Projects and then choose Setup and Deployment Projects. Then you can "install" the website to your webserver.
Cleako
I just noticed another thing in your post. If you are going to want your classes in a DLLs separate from the main project then you need to create a class library and place all of your classes that you would like to keep separate in there and then just create instances of those classes within the library in the other project.
Cleako
As you suggested i created a class library. Then i made a file in some Namespace and put in a class. After building it i copied the dll from the bin folder to my sites bin folder. But still i couldnt use the class in my aspx pages. If i compile the same class through command line
vbc /t:library /out:MyClass.dll SomeClass.vb
then it works.
Moreover one of my classes had Imports System.Xml in it. when i build it, it works but when i use the above command line statement in the VS.net Command prompt i get an error saying the file couldnt be found. I dont know what to do and am stuck.
I tried adding the class library to my project, but still cant use it. How do other people generally implement code behind without using VS? I want to create classes in VS but use them in my aspx pages which i make in Dreamweaver.

Friday, March 16, 2012

Newbie needs a tutorial on reading and writing to nodes in an XML file

I have an ASP.NET app that I am writing using VB.NET and I want to use an
XML file to store configuration settings in sort of like the way I used to
use an .INI file for in Windows apps. When the user opens a page, it needs
to go read certain settings out of the file and fill textboxes and other
form fields with the data from the XML file. If the user makes any changes
on the form, it needs to write back to the XML file to store the new
settings.

Any help with this would be greatly appreciated!you will find everything here
http://msdn.microsoft.com/library/d...Msxslscript.asp

Av.
"David Hearn" <david.hearn@.stagparkway.com> wrote in message
news:%23YQ4ynpXEHA.2940@.TK2MSFTNGP09.phx.gbl...
>I have an ASP.NET app that I am writing using VB.NET and I want to use an
>XML file to store configuration settings in sort of like the way I used to
>use an .INI file for in Windows apps. When the user opens a page, it needs
>to go read certain settings out of the file and fill textboxes and other
>form fields with the data from the XML file. If the user makes any changes
>on the form, it needs to write back to the XML file to store the new
>settings.
> Any help with this would be greatly appreciated!

Newbie needs a tutorial on reading and writing to nodes in an XML file

I have an ASP.NET app that I am writing using VB.NET and I want to use an
XML file to store configuration settings in sort of like the way I used to
use an .INI file for in Windows apps. When the user opens a page, it needs
to go read certain settings out of the file and fill textboxes and other
form fields with the data from the XML file. If the user makes any changes
on the form, it needs to write back to the XML file to store the new
settings.
Any help with this would be greatly appreciated!you will find everything here
http://msdn.microsoft.com/library/d...ript
.asp
Av.
"David Hearn" <david.hearn@.stagparkway.com> wrote in message
news:%23YQ4ynpXEHA.2940@.TK2MSFTNGP09.phx.gbl...
>I have an ASP.NET app that I am writing using VB.NET and I want to use an
>XML file to store configuration settings in sort of like the way I used to
>use an .INI file for in Windows apps. When the user opens a page, it needs
>to go read certain settings out of the file and fill textboxes and other
>form fields with the data from the XML file. If the user makes any changes
>on the form, it needs to write back to the XML file to store the new
>settings.
> Any help with this would be greatly appreciated!
>