Introducere in ASP.NET Controale Web Pagina in ... - Profs.info.uaic.ro
Introducere in ASP.NET Controale Web Pagina in ... - Profs.info.uaic.ro
Introducere in ASP.NET Controale Web Pagina in ... - Profs.info.uaic.ro
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<st<strong>ro</strong>ng>ASP</st<strong>ro</strong>ng>.<st<strong>ro</strong>ng>NET</st<strong>ro</strong>ng> 03.03.2014 13/30<br />
{<br />
}<br />
lblInfo.Text += "Page.PreRender event handled.";<br />
private void Page_Unload(object sender, System.EventArgs e)<br />
{<br />
// This text never appears because the HTML is already<br />
// rendered for the page at this po<st<strong>ro</strong>ng>in</st<strong>ro</strong>ng>t.<br />
lblInfo.Text += "Page.Unload event handled.";<br />
}<br />
Codul pentru evenimentul click al butonului:<br />
p<strong>ro</strong>tected void Button1_Click(object sender, System.EventArgs e)<br />
{<br />
lblInfo.Text += "Button1.Click event handled.";<br />
}<br />
Pag<st<strong>ro</strong>ng>in</st<strong>ro</strong>ng>a este un conta<st<strong>ro</strong>ng>in</st<strong>ro</strong>ng>er pentru cont<strong>ro</strong>alele pe care le cont<st<strong>ro</strong>ng>in</st<strong>ro</strong>ng>e. Putem vizualiza cont<strong>ro</strong>alele<br />
d<st<strong>ro</strong>ng>in</st<strong>ro</strong>ng>tr-o pag<st<strong>ro</strong>ng>in</st<strong>ro</strong>ng>a folos<st<strong>ro</strong>ng>in</st<strong>ro</strong>ng>d urmatorul cod (<st<strong>ro</strong>ng>in</st<strong>ro</strong>ng> Page_Load):<br />
foreach (Cont<strong>ro</strong>l cont<strong>ro</strong>l <st<strong>ro</strong>ng>in</st<strong>ro</strong>ng> Page.Cont<strong>ro</strong>ls)<br />
{<br />
Response.Write(cont<strong>ro</strong>l.GetType().ToStr<st<strong>ro</strong>ng>in</st<strong>ro</strong>ng>g() + " - " +<br />
cont<strong>ro</strong>l.ID + "");<br />
}<br />
Response.Write("");<br />
Clasa Page<br />
Observatie<br />
Toate formularele web sunt <st<strong>ro</strong>ng>in</st<strong>ro</strong>ng>stante ale clasei Page.<br />
Cateva p<strong>ro</strong>prietati importante ale acestei clase:<br />
Session<br />
Application<br />
Cache<br />
Request ; Request.QueryStr<st<strong>ro</strong>ng>in</st<strong>ro</strong>ng>g["id"] ;<br />
Response ; Response.Write() ; Response.Redirect("page.aspx") ;<br />
Response.Redirect(http://...)<br />
Server ; Server.Transfer() ; HtmlEncode ; HtmlDecode ;<br />
UrlEncode ; UrlDecode ; MapPath ;<br />
User<br />
Trace<br />
Ioan Asim<st<strong>ro</strong>ng>in</st<strong>ro</strong>ng>oaei