Thursday, August 21, 2014

Dot Net Web Forms Project and Web Site

I have been doing Java development since 2001, and lately i have been taking in new languages such as Objective C, Swift, etc.  Recently, on a project I was working on used a Microsoft product called HealtVault. I figured its about time to learn the other flavor of web development, the one that using the Microsoft stack called Dot Net.

This page gave me the link to install the free version (called Express) of the Microsoft IDE called Visual Studio. So, I am off to races using Microsoft.

They say the Express Visual Studio is perfect for a single developer . Likewise, web world team foundation server is for enterprise ms.


  • The web matrix - easy for websites, publish, for a designer
  •  IIS - manage web server asp.net - 
  • msft families technologies to enable web development .net framework 4.0 - web forms. mvc, web forms dynamic data C# or VB 
  • web forms : greatest maturaity in asp.net, inhetritence model, page/controls , wysiwig, tool 
  • visual studio - web app project, web site 
  •  asp.net MVC - code intensive, razor syntax, unit test support 
  •  asp.net web pages - page rendering

--
web forms

visual studio
new project/open project
server explorer window on left sidebar
toolbox

debug pulldown
create new site - create web app proj
aspx config asax

file new project
under installed templates
web category

asp net web application or empty one

give it name i.e. DemoWAP

on right is solution explorer

web pages in aspx extension

Site.master

file -> close solution 

recent projects

create new page (web form with master page)

right click project -> add new item

web from with master page (i.e. template )

give it name TestPage.aspx asks which master (Site.master)

can  click on site master to see markup

<asp:Content>

build->  DemoWAP (creates DLL under bun , pdb file also)

right click view in browser

or start debug session

toolbox (server side controls) -> drag text box in code

add button  and a label 

use ids in code

TestPage.aspx.cs

database

App_Data folder - database file

Web.xonfig file estatblish conneection

DemDBConn

server control to bind to

<ul

asp:listView ID="ListOfTasks" runat= "server  


<%#Eval('taskName' %>

Page_Load in DEmoWAP file

WebConfigurationManager.ConnectionSTrings["DEmoDBConn"].ConnectionString;

using (var conn= new SqlConnection(connString)

using (var cmd conn.createCommand

cmd.CommandTest = "Select * from Taks";

conn.Open()
ListOfTasks.DataSource = cmd.EWxcecuteReader
ListOfTasks.Databind

web forms - instead now web sites
create new web site

view pulldown -> start page

Server explorer

toolbox 

create new site

file -> new -> web site

create new web form with master page
add new item -> web form with master page

uncheck seperate file

testPage : System.Web.Ui.Page

Label1.Text = 
also .cs files
Web.config

No comments:

Post a Comment