Tuesday, May 31, 2016

Web Applications in C#: Assignment 06: Managing State Data


Assignment 06: Managing State Data

The Details:

This weeks assignment was about managing state data. Our go was simple to demo the following:

Create (3) ASP.NET pages that show different method of managing state.

In class this week during lecture we review (5) which included:

1. Cookies 
2. Sessions variables 
3. Hidden Inputs
4. View States
5. Send a raw string back and forth

Resources to review:

Just like every week we were given several resources to review. I spent considerable time going through all of these

We also had an additional video we were assigned. This video did a 8 minute overall of JSON 


Demo of Managing State Data

To start the demo I created a master page, and three content pages to demonstrate my knowledge of managing state data. Below is my Solution Explorer for Assignment 6

Besides the pages, I also added a App_Code Folder to keep my customer class in.

Then added a css folder to improve graphics and JQuery viewed in the screenshot below


Demo 1: Creating Cookies - ~/ContactUs


In this demo I used the ContactUs Content page to demo my knowledge of this subject. Here is what the C# looked like 


Next I wrote some code for the ContactUS html buttons


When the program ran this is what it looked like




Demo 2: View State - ~/About

In this demo, I will demonstrate my knowledge of view state. The class I built was Customer and the strings I choice to use was FirstName and LastName. Then I constructed a static string, and created a new object Customer Name Tim Pauley.
 
Then I used a button with the response
 
Screenshot of code Part 1

 

 

Screenshot of code Part 2


Below are the html buttons which relates back to my C# code. An extra I did was to add the class="c-button"



Here is the .c-button css folder styles class
 
 

Below is the program running
 
 
 
Demo 3: Using Hidden Inputs - ~/home
 
This demo is still a work in progress. I started by attempting to demo Reading a Secession Variable with a separate class named Customer. However, after spending time on this, I realized a better demo would be to demo hidden inputs. Below is some of the work I did on this demo
 

Original Demo 3

This is the C# I was using 
 
 
This is the class the html I used

 

This is what I was able to get running


Update to come shortly

Tuesday, May 24, 2016

Web Applications in C# : Assignment 5 Utilizing JQuery

Getting started

Reading / Review


This week we had an exercise utilizing JQuery. Beside lecture I also did a watched this youtube video:
 
jQuery Tutorial for Beginners (Only first hour!)



Then review the following resources

jQuery Tutorial

·         jQuery HOME
·         jQuery Intro
·         jQuery Get Started
·         jQuery Syntax
·         jQuery Selectors
·         jQuery Events
 
 

Assignment

  • Create 3 ASP.NET pages that use jQuery
 

Creating the Visual Studio Project

To get started I created a new web project in Visual Studio. Next I created the following
I included the following files

  1. Master Page
  2. Content Pages
  • Home
  • About
  • Contact Us
   3. Then I added the JQuery file I downloaded from below


Website
 
**Note I used the uncompressed option so it would be easier to read. Compressed = production version.

After adding the files I made the Home Page my Start Up Page. Then I dragged and dropped the JQuery file into my Solution Folder.


Adding JQuery and  JavaScript

The first thing I did was create a reference to JQuery Library



<script src="Scripts/jquery-1.12.3.min.js" type="text/javascript"></script>


My first task was to show a label change using JQuery. Here is the code on the home page


This is what it look like after you hit the submit button


 Next I want to change the color of the page when the button is pressed

IMPORTANT - you must the label to static to get this to work




Next I want to change the back ground of the text color to "yellow" using JQuery

Here is the code



This is what happened when I ran it


 The last demo I want to show how to hide the text

Here is code


 
Now you see it! Now you don't

 
See you next week!


Tuesday, May 17, 2016

Web Applications in C# : Assignment 4 ASP.NET Debugging

This week in class we were taught how to integrate ASP.NET with a database using SQL. At first it was a challenge finding my SQL Server Instance. Below is a screenshot of it.


 



 Our homework this week was to create a new web project, master page, web page that had a login screen and connect it to a database. Screenshot of Solution Explorer below:



We were give SQL Code ato run nd create a database named "ASPNetHomework". This database included one table "Logins", 4 attributes listed below, and one store procedure.



   Next I hooked up the database using ASP.Net Buttons



Wrote some C# code and tested


Here is what the UI looks like



Besides the HW I had to research several sites to learn more about Debugging and Error Handling in ASP.NET. My assignment included researching the following:

1) ASP.NET debugging
2) Walkthrough: Client Side debugging with F12 tools
3) Walkthrough: Using ASP.NET Trace
4) Walkthrough: Using SQL Profiler
 
I enjoyed watching the YouTube videos the most. It has always been easier for me to learn while watching and video (including coding).
 
The F12 Tools video was awesome. Chris Love reviewed a webpage that he saw on Shark tank. The webpage was a single page application. During the video he pointed out several things the developer did wrong. The biggest thing errors was the site had a couple of bugs and loaded slowly. The slow website speed was due to running to excessive JavaScript. Chris said, he teaches a class to improve this and I would like to look it up. I will definitely review this video in the future when debugging my projects
 
Screenshot from video
 
 
 
 
      
 
Next I reviewed Venkat video on tracing ASP.NET. I was going to include more about tracing and watched the entire video, but ran out of time. I will update this portion of my blog at a later date.