Download presentation
Presentation is loading. Please wait.
Published byShannon Nelson Modified over 9 years ago
1
1.NET Web Forms Visual Studio © 2002 by Jerry Post
2
2 Visual Studio is a Text Editor Intellisense Indents automatically Pops up object choices Shows you function and subroutine values Me.In C# it is this.
3
3 Useful Tricks Get a video screen with really high resolution. It is possible to open files in separate windows. Use Format Alignment: Note that the first clicked item is the one adjusted (e.g., Bottoms). In a list, the one with the unfilled box marks is the reference item, others will move. Vertical and Horizontal Spacing Use drag-and-drop to auto-size items on a form. Use Ctrl-K + Ctrl-C to comment an entire block, Ctrl-K + Ctrl-U to uncomment a block. Drag-and-drop a style sheet file to link it easily. But it usually will not take effect until you run the program. To generate a dataset, right-click on the adapter to set most of the default values automatically. Do not put numbers after a DataSet name. The generator does it for you. Choose one language and stick with it. You cannot mix and match.
4
4 Solutions and Projects Ignore “Solutions.” They are supposed to let you combine projects but it does not work properly. Yes, you can compile multiple projects. But the projects remain completely separate. You can call a form from one project to another. But the session variables are completely different. If you really want to combine multiple projects Compile outside of Visual Studio and use command-line to build an assembly. Compile the first one separately, and copy the.aspx and.DLL files into the main project root and \bin directories respectively. Then add a reference to the first’s DLL. Then compile main. Also, just try getting rid of earlier projects. Delete files manually (be careful, they are in several places). Edit the registry!
5
5 Creating Event Functions Events trigger calls to functions The functions must have the proper parameters. The functions must be registered or linked to the event. For buttons: double-click on the button on the form. For other events: Select the object in the top-left select box Select the event in the top-right select box You can programmatically create links from events to event- handlers; usually in Page_Init (which must itself be linked as an event-handler).
6
6 Help You need the MSDN Library DVD Organization choices ContentsHierarchical structure SearchLimited text searching IndexKey words To find anything, make sure you set Filtered By Visual BasicLanguage questions .NET Framework SDKWeb issues
7
7 Debug and Trace For.NET, best to debug on a workstation not the server Set breakpoints in code, Start with F5 or Debug + Start Useful Windows (View + …) BreakpointsSet properties to enable conditional breaks Variables: Locals, Me, Autos (also roll over the variable) Exceptions (errors) Call Stack (see where you came from) CommandIssue commands, but lots of typing ImmediateFrom command: Debug.Immediate ?VariableDisplays value CommandsAny acceptable VB command (useful to test) Debug and Trace (same thing but Trace statements remain in compiled code) Debug.WriteLine(“Program has reached point A”) Debug.WriteLineIf(ID > 100, “ID is too large”) Trace.Listeners.Add(…) You can route the output to almost anywhere, including e-mail!
8
8 Visual Studio Form Design Toolbars Menu Save all Controls Design/Layout form HTML/ASPX Solution Explorer ReferenceProperties Additional windows (help, output, debug, …)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.