:: ASP.NET FAQ ::
Where can I find sample code? Check out GotDotNet for some QuickStart tutorials. Another useful reference is IBuySpy where they have a fully-documented sample store web site. Why does Internet Explorer ask to download a file when I try to view my aspx page? This is because IIS does not recognize aspx pages yet. To fix this: How do I create my first project? Under new projects, Visual C# Projects, select Web Application and type:
http://localhost/my-project-name where my-project-name is whatever name you
want. How do I create index.html in my root folder using Visual Studio? If you followed the instructions above, you project will be in a folder under the root directory but won't the root directory itself. So in short you can't really do it in Visual Studio. However, you can easily make an index.html in notepad or any other text editor and create a link to a index page in your project directory. Why aren't my files in my project? Did I lose them? If you created a file outside of Visual Studio, you will need to add the file to your project in VS so that it can be built and used (applies only to aspx & C# files). To see all the files in your project directory, just click on the Show All Files button in your Solution Explorer. If the file is grayed out then it is not included in the project. To include the files, right click on them and select Include in Project. Remember to build to see it work! How do I add new files to my project? Right click on your project name in Solution Explorer and then select Add. Generally you will want to create a new Web Form (.aspx) and remember to name it something. Do all my files have to have .aspx extensions? If your file has asp tags then your pages will need to have a .aspx extension. Where is my error log? You can find your log file here:
c:\winnt\system\logfiles\w3svc\date.txt How do I get the current date and time? .NET has a DateTime object. To see how it is used, check out the .NET reference documentation that can be found from your start menu. How do I pass form data between pages? There are quite a
number of ways to do this and depending on the task at hand, you would probably
want to use a different method. If you are thinking of passing form data to
another page for Ex 3 it's actually not necessary, you can place it all in one
page. In the button onclick event, you can Response.Redirect to another page placing the variables in the URL. e.g. Then on your results.aspx page you can call Request.Params["name"] to get the name and Request.Params["age"] to get the parameters. Session - Save it a for awhile In the button onclick event, you can save all your variables into the Session and then call Response.Redirect to another page that extracts the values from the Session again. e.g. Then on your results.aspx page you can create variables to retreive the value
of the Session variables like: Server.Execute - Fake a page change You can see an example of this at testform.aspx. How do I screen scrape? For Ex 4 you will need to rip stuff off some other pages. HttpWebRequest hwr = (HttpWebRequest)
WebRequestFactory.Create(strUrl); You can then parse the stream using a Regular Expression. |
|
|||
|
||||
|
Copyright
©
2003 All rights reserved
Created by Shubhankar Dey
(Click here to
get real font)