i got nice article about AJAX. This article discuss how AJAX can make some different on process web development. here to read this article, enjoy.....
Saturday, May 31, 2008
AJAX Article
Friday, May 30, 2008
Using RadioButtonList Control
The RadioButtonList control, like the DropDownList control, enables a user to select only one list item at a time. The RadioButttonList control displays a list of radio buttons that can be arranged either horizontally or vertically.
The RadioButtonList control includes three properties that have an effect on its layout:
RepeatColumns The number of columns of radio buttons to display.
RepeatDirection The direction that the radio buttons are repeated. Possible values are Horizontal and Vertical.
RepeatLayout Determines whether the radio buttons are displayed in an HTML table. Possible values are Table and Flow.
By default, the radio buttons rendered by the RadioButtonList control are rendered in an HTML table. If you set the RepeatLayout property to the value Flow, then the radio buttons are not rendered in a table. Even when the RadioButtonList renders its items in Flow layout mode, you can specify multiple columns
Code Example :
< %@ Page Language="VB" %>
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
< runat="server">
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs)
lblStudent.Text = rblStudent.SelectedItem.Text
End Sub
< /script>
< xmlns="http://www.w3.org/1999/xhtml">
< id="Head1" runat="server">
<>Show RadioButtonList< /title>
< /head>
< body>
< id="form1" runat="server">
< form id="form1" runat="server">
< div>
< asp:RadioButtonList
id="rblStudent"
DataSourceID="srcStudent"
DataTextField="name"
DataValueField="id"
RepeatColumns="3"
Runat="server" />
< id="btnSubmit" text="Submit" runat="server" onclick="btnSubmit_Click">
< id="lblStudent" runat="server">
< id="srcStudent" selectcommand="SELECT id, name FROM student" connectionstring="">"
Runat="server" />
< /div>
< /form>
< /body>
< /html>
Wednesday, May 28, 2008
Create simple upload file in PHP
This simple code for upload in php. this need two files, form.html and upload.php.
Form.html
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< xmlns="http://www.w3.org/1999/xhtml">
<>
< equiv="Content-Type" content="text/html; charset=utf-8">
<>Untitled Document< /title>
< /head>
<>
< action="upload.php" method="post" enctype="multipart/form-data">
Browse File : < type="file" name="filename">
<><>
< type="submit" value="Submit">
< /form>
< /body>
< /html>
and this code for upload.php for handling upload process to server.
< ? $directory="E:/myweb/public_html/example_blog/upload/data";
if(@copy($_FILES[filename][tmp_name],$directory."/".$_FILES[filename][name])):
print "upload success";
else:
print "upload failed";
endif;
exit;
? >
Tuesday, May 27, 2008
Using Drop Down List in ASP.NET
The DropDownList control enables you to display a list of options while requiring a minimum of screen real estate. A user can select only one option at a time when using this control
Code example :
< %@ Page Language="VB" %>
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
< script runat="server">
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs)
lblStudent.Text = ddlStudent.SelectedItem.Text
End Sub
< /script>
< html xmlns="http://www.w3.org/1999/xhtml" >
< head id="Head1" runat="server">
< title>Show DropDownList< /title>
< /head>
< body>
< form id="form1" runat="server">
< div>
< asp:DropDownList
id="ddlStudent"
DataSourceID="srcstudent"
DataTextField=name"
DataValueField="id"
Runat="server" />
< asp:Button
id="btnSubmit"
Text="Submit"
OnClick="btnSubmit_Click"
Runat="server" />
< hr />
< asp:Label
id="lblStudent"
Runat="server" />
< asp:SqlDataSource
id="srcstudent"
SelectCommand="SELECT id,name FROM student"
ConnectionString="<%$ ConnectionStrings:student %>"
Runat="server" />
< /div>
< /form>
< /body>
< /html>
The DropDownList control renders an HTML <> tag. One problem with the HTML <> tag is that it has an infinite z index. In other words, you can't place other objects, such as an absolutely positioned <> tag, in front of a DropDownList control in a page.
Sunday, May 25, 2008
Web 2.0 Tools
Thursday, May 22, 2008
Using Outline in CSS
An outline is sort of a like a border, but there are some very important differences.
- outlines do not participate in the flow of the document like borders do, and thus don't trigger document reflow as they appear and disappear.
- outlines can be nonrectangular
Outlines are considered to be part of user interface styling because they are most often used to indicate the current focus.
Outline Property :
Values
[ <> || <> || <> ] | inherit
Initial value
not defined
Applies to
all elements
Wednesday, May 21, 2008
Templates in Data Bound Control
Every DataBound control included in the ASP.NET 2.0 Framework supports templates with the sole exception of the treeView control. The Repeater, DataList, and FormView controls all require you to use templates. If you don't supply a template, then these controls display nothing. The GridView, DetailsView, and Menu controls also support templates, but they do not require a template. A template can contain HTML, DataBinding expressions, and other controls.
Example :
< %@ Page Language="VB" %>
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
< html xmlns="http://www.w3.org/1999/xhtml" >
< head id="Head1" runat="server">
< title>Show Links< /title>
< /head>
< body>
< form id="form1" runat="server">
< div>
< asp:Repeater
id="Repeater1"
DataSourceId="srcStudent"
Runat="server">
< ItemTemplate>
< asp:HyperLink
id="HyperLink1"
Text='<%# Eval("name") %>'
NavigateUrl='<%# Eval("id", "Details.aspx?id={0}") %>'
runat="server" />
< br />
< /ItemTemplate>
< /asp:Repeater>
< asp:SqlDataSource
id="srcStudent"
ConnectionString="Data Source=.\SQLExpress;
AttachDbFilename=|DataDirectory|Data.mdf;
Integrated Security=True;User Instance=True"
SelectCommand="SELECT id, name FROM student"
Runat="server" />
< /div>
< /form>
< /body>
< /html>
Tuesday, May 20, 2008
Top Web 2.0 Apps
here are top Web 2.0 apps :
Reflect.com : Reflect is a hosted website solution that allows web designers and their clients to easily create and manage websites.
designmyroom.com : is easiest for design interior spaces
ajaxlookup.com : free service to check domain availability
Sunday, May 18, 2008
How to : Image Validator In PHP
This simple source to create image validator function :
function generate_image_validator(){
global $app;
// Create an image where width=155 pixels and height=35 pixels
$val_img = imagecreate(155, 35);
// Allocate 2 colors to the image
$color1 = imagecolorallocate($val_img, 46,60,31);
$color2 = imagecolorallocate($val_img, 238,239,239);
// Create a seed to generate a random number
srand((double)microtime()*1000000);
// Run the random number seed through the MD5 function
$seed_string = md5(rand(0,9999));
// Chop the random string down to 5 characters
// This is the validation code we will use
$val_string = substr($seed_string, 17, 5);
// Set the background of the image to color2
imagefill($val_img, 0, 0, $color2);
// Print the validation code on the image in color1
imagestring($val_img, 4, 75, 10, $val_string, $color1);
// Write the image file to the current directory
imagejpeg($val_img, "img.jpg");
imagedestroy($val_img);
$app[val_string]=$val_string;
return;
}
Saturday, May 17, 2008
Using FindControl and PreviousPage with Master Pages
PreviousPage promises a lot: You transfer to a target page using either Server.Transfer on the server or cross-page posting from the browser.
Once you arrive at the target page, you can use its PreviousPage property to reach back to a control on the previous page and retrieve its data.
For more complete article click here
Using Database Commands in ASP.NET
Example
asp:SqlDataSource
id="srcStudent"
SelectCommand="SELECT * FROM student"
ConnectionString="<%$ ConnectionStrings:Student %>"
Runat="server"
Friday, May 16, 2008
Overview of XML
Monday, May 12, 2008
Using Cursor in CSS
CSS2 lets you change the cursor icon, which means that it's much easier to create web-based applications that function in a manner similar to desktop applications in the operating system.
Cursor property
Values : [[
Initial Value : auto
Example:
a{ cursor:pointer}
Saturday, May 10, 2008
Another Web 2.0 Resource
Wednesday, May 7, 2008
Storing Connection Strings in the Web Configuration File
There are three reason for why storing connection strings is a bad idea.first, it is not good from perspective of security.in this case, no one should ever be able to view the source code of your ASP.NET pages, but in practice,hackers have discovered security flaws in the ASP.NET framework.so you should store your connection strings in a separate file.
second, adding a connection string to every page makes it difficult to manage a website,in other hand if you need change connection string, you only modifying the single file.
last, storing a connection string in a page can, potentially, hurt the performance of your application.
for these reason, you should always put your connection string in the web configuration file.
eXAMPLE
Web.Config
< ?xml version="1.0"?>
<>
<>
< name="student" connectionstring="Data Source=.\SQLEXPRESS; AttachDbFilename=|DataDirectory|MyData.mdf;Integrated Security=True; User Instance=True">
< /connectionStrings>
< /configuration>
displaystudent.aspx
< %@ Page Language="VB" %>
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
< xmlns="http://www.w3.org/1999/xhtml">
< id="Head1" runat="server">
<>Show Movies
< /head>
< body>
< id="form1" runat="server">
< div>
< id="grdStudent" datasourceid="srcStudent" runat="server">
< id="srcStudent" selectcommand="SELECT * FROM student" connectionstring="<%$ ConnectionStrings:student %>">"
Runat="server" />
< /div>
< /form>
< /body>
< /html>
The expression <%$ ConnectionStrings:student %> is used to represent the connection string. This expression is not case sensitive.
Monday, May 5, 2008
SqlDataSource Overview
How to creating Database Connection
By default, the SqlDataSource control is configured to connect to Microsoft SQL Server version 7.0 or higher. The default provider used by the SqlDataSource control is the ADO.NET provider for Microsoft SQL Server.
Example :
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
< xmlns="http://www.w3.org/1999/xhtml">
< id="Head1" runat="server">
<>Show Example Connection
< /head>
<>
< id="form1" runat="server">
<>
< id="grdTeacher" datasourceid="srcTeacher" runat="server">
< id="srcTeacher" selectcommand="SELECT * FROM Teacher" connectionstring="Data Source=.\SQLEXPRESS; AttachDbFilename=|DataDirectory|MyData.mdf; Integrated Security=True;User Instance=True" runat="server">
< /div>
< /form>
< /body>
< /html>