• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/9

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

9 Cards in this Set

  • Front
  • Back

CausesValidation = true by default



Validation controls:


RequiredFieldValidator(server runat, ControlToValidate, ErrorMessage)


CompareValidator(ControlToCompare)


RegularExpressionValidator(ValidationExpression)


RangeValidator(Type, MaximumValue)


CustomValidator(OnServerValidate/ClientValidationFunction - write JS inside <script>)



ValidationGroup for all inputs and validators

ServerSide:


System.Web.UI.WebControls


inherit BaseValidator class


IsValid: validation failed or suceeded?


EnableClientScript



asp:ValidationSummary runat server id="errors" - rails like validation.



3 manual validation: own code, disable EnableClientScript, CausesValidation = false for all controls.


Frame targets: _parent, _blank, _self, _blank, _top(full window)



Ads: ImageUrl, NavigateUrl, Impressions, Keyword, AlternateText



Wizard: Title, StepType(start, step, finish), AllowReturn

3 style types: internal, external, inline


To add Classes to ASP controls, CssClass



Themes: App_Themes folder - .skin extension(set of control tags), each theme is a directory with .skin files. In Page Language header, Theme = "Funky" if you want controls to override, use StyleSheetTheme or EnableTheming = "False"

To apply theme to whole website,


<configuration>


<System.web>


<pages theme ="funky"/styleSheetTheme="funky">



MultipleSkins for same control = "SkinID"


MasterPage .master, frames, content pages


ContentPlaceHolder and in pages, ContentPlaceHolderID



The directive is "Master" instead of "Page"


<asp:ContentPlaceholder>



In pages, set Master as MasterPageFile="~/Masterpage" Title="yolo"



In .aspx you can do master.something


Databases :SQLServerExpress


sqlcmd -S xxx -i xxxx


S=location


i=script file with sql commands



ADO.NET DataProvider: DataSet(container for rdmbs), DataTable, DataRow, DataRelation



Connection, Command, DataReader

Imports System.Data


Imports System.Data.SQLClient



SQLConnection


SQLCommand


DataReader - retrieve and display


close



you--->command-->connection--->db -->connection--->command--->DataReader--->you

ConnectionString = @Data Source: "localhost:3000" + Initial Catalogs="pubs" + Integrated Security = SSPI" ConnectionTimeOut



<add name="pubs" connectionString="xxx"



WebConfigurationManager.ConnectionString["pubs"].ConnectionString

SQLConnection myConnection = new SQLConnection(ConnectionString)



myConnection.Open()


SqlCommand myCommand = new SQLCommand("SELECT * FROM ALL", myConnection)


SQLDataReader myReader;


myReader = myCommand.ExecuteReader()


x = myReader.Read()


myReader.Close()


myConnection.Close()



.Replace("'", """)




Disconnected DataSets


SQLDataAdapter


DataSet dsPubs = new DataSet();


adapter.Fill(dsPubs, "Authors");



foreach (DataRow in dsPubs.Tables["Authors"].Rows


{


x.Text = row["name"]


}

Parametrized command:


INSERT into TABLE ("authors") VALUES ("@x")


cmd.Parameters.AddWithValue("@x", yolo.Text)



DataBinding:


Direct contact between data source and control


nothing happens automatically



Single Value/Simple DataBinding


protected int TransactionCount = 10;


this.DataBind();


<%# TransactionCount %>

Multiple Databinding


List<string> fruit = new List<string>();


fruit.Add("Something")



For any control, DataSource = fruit


this.DataBind();


MyListBox.DataSource = fruit



Dictionary: collections, keys, Hastable, Dictionary

Dictionary<int, string> fruit = new Dictionary<int, string>();


fruit.Add(1, "Something");



MyListBox.DataSource = fruit


MyListBox.DataTextField = "Value"


MyListBox.DataValueField = "Key"


this.DataBind();



SelectedItem.Value;


SessionState - Session Tracking 120 bit, client has a sessionID, places into collection


-Using cookies(ASP.NET_SessionId)


-Using modified urls(munged)



System.Web.SessionState.HttpSessionState


Session["InfoDataset] = dsinfo


dsinfo = (DataSet)Session["InfoDataSet"]

-global


lost by: close, different browser, restart, timeout, sessionAbandon()


<sessionState cookieliess="usecookies/useuri/usedeviceprofile/autodetect" cookieName timeout


-cant use absolute links for useuri

Session.Timeout


Application State - HttpApplicationState


global.asax


Page_Load(Object Sender, EventArgs e)


Application["x"] = 1


x = (int)Application["x"]


-no timeout


-restart/refresh


- inefficient


- its global, so a count on one is a count on another client. Application.Lock(); Application.Unlock();