Showing posts with label WEB. Show all posts
Showing posts with label WEB. Show all posts

Friday 24 July 2015

HTML

How to display Progress bar while page is loading


<pre>
<code>
protected void Page_Load(object sender, EventArgs e)
{
showPageLoad();
//do somthing
    }
private void showPageLoad()
{
int i=0;
Response.Write(“<div=’divTitle’>Loading(<span id=’message’>0%</span>)</div>”);
Response.Flush();
for(i=5;i<=100;i=i+5)
{
System.Threading.Thread.Sleep(200);// any codes can be typed here
outputflash(i.ToString() + “%”);
Response.Flush();
}
}
private void removePageLoad()
{
ScriptManager.RegisterStartupScript(Page, this.GetType(), “deleteLoading”, “var d = document.getElementById(‘divTitle’);d.parentNode.removeChild(d);”, true);
    }
private void outputflash(string value)
{
Response.Write(“<scriptpe=’text/javascript’>document.getElementById(‘message’).innerHTML='” + value + “‘;</script>”);
    }
</code>
</pre>

Wednesday 4 February 2015

Post 2 Regarding Part 1 of HTML

Now I will let you put something before your opening <html> tag. Didn't take me long did it? I also won't tell you to put anything else here at all!
To tell your browser, the browsers of people reading your page and W3C that your page will have standards, we need to add a special line in:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
All you need to know for now is that there are varying levels of "standards" from quite lenient to very strict. We will be going "Middle-ground" for now and using the "Transitional" standards.
The other thing to explain is that HTML itself is updated and changed over time so the "4.01" is the standards we are using. If it is deemed necessary, as the standards and capabilities of HTML change, these tutorials will also be updated.

So place that line above your <html> tag. Always have this line when you start any new HTML page.

<html><head>
<script language="JavaScript">
function bgChange(bg)
{    document.body.style.background=bg; }
</script></head>
<body><b>Mouse over these table cells, and the background color will change</b>
<table width="300" height="100">
 <tr>
  <td onmouseover="bgChange('red')"
    onmouseout="bgChange('transparent')" bgcolor="red">
  </td>
  <td onmouseover="bgChange('blue')"
    onmouseout="bgChange('transparent')" bgcolor="blue">
  </td>
  <td onmouseover="bgChange('green')"
    onmouseout="bgChange('transparent')" bgcolor=green>
  </td>
</tr>
</table>
</body></html>
With Java Script
Output:

Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title>My first HTML page</title>
 </head>
 <body>
  <h1>Hello World!</h1>
  <p>
   Welcome to my first web page!
  </p>
  <p>
   I will add more stuff when I know how - thanks for stopping by!
  </p>
 </body>
</html>