Monday, December 29, 2008

Selecting particular row from gridview

protected void grdview_srchresult_SelectedIndexChanged(object sender, EventArgs e) {

//for MessageBox
//Page.RegisterStartupScript("StatusMessage", "
");
GridViewRow gd = grdview_srchresult.SelectedRow;
Response.Write(gd.Cells[1].Text.ToString());//zipcode
}

protected void grdview_srchresult_RowDataBound(object sender, GridViewRowEventArgs e) {
if (e.Row.RowType == DataControlRowType.DataRow)
{
//for designing gridview
e.Row.Attributes["onmouseover"] = "this.style.cursor='hand';this.style.background='#D1DDF1'";
e.Row.Attributes["onmouseout"] = "this.style.textDecoration='none';this.style.background='#EFF3FB'";

//for selecting particular record
e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(this.grdview_srchresult, "Select$" + e.Row.RowIndex );
}
}

Wednesday, December 17, 2008

Example for XMLSerializer

This Program is used to create diferent type of values like textbox,lablebox,datagrid into xml file format

//Serialization

TextBox1.Text = "VIJAY WELCOMES U";
XmlSerializer xmlserial = new XmlSerializer(TextBox1.Text.GetType ());
FileStream fs = File.Create("C:\\vijay.xml");
xmlserial.Serialize(fs, TextBox1.Text);
fs.Close();

//Deserialization

object a;
XmlSerializer xmlserial1 = new XmlSerializer(TextBox1.Text.GetType());
FileStream fs1 = File.OpenRead("C:\\vijay.xml");
a=xmlserial1.Deserialize(fs1);
TextBox2.Text = (Convert.ToString(a));
fs1.Close();

Output ill be:

In xml file:
Below line ill show in xml format tag with in tag name "string"
VIJAY WELCOMES U

In form:
VIJAY WELCOMES U-- TextBox1
VIJAY WELCOMES U-- TextBox2

Thursday, December 11, 2008

Tuesday, December 9, 2008

Open Control panel items via Run Command

In some system admin restrict control panel to view. we have a esay method to access item from control panel without opening control panel window...


if u want to chage a date/time property use the following steps..

Strat-->Run-->timedate.cpl and hit Enter

if u want to know more abt that just select

strat-->serach-->enter *.cpl in serach box and hit search it will show all the files with .cpl extension

Thursday, December 4, 2008

Coding for Accessing xml file using javascript

var xml_doc_variable;
function read_xml_file(file_name)
{
xml_doc_variable=new ActiveXObject"Microsoft.XMLDOM");
xml_doc_variable.async=false;
xml_doc_variable.load(file_name);
var xml_doc_values=xml_doc_variable.getElementsByTagName("company");
var xml_value=xml_doc_values[0].getElementsByTagName("employee");
var user_name=xml_value[0].firstChild.nodeValue);//accessing values from specified tag
var text_box_value=document.getElementById('t1');
if(username==text_box_value)
alert('rite user');
else
alert('wrong user');
document.write(xml_value[0].getAttribute("id"));//getting value of attribute
}

Tuesday, December 2, 2008

Coding for Calling Css File using javascript

function select_fun(filename)
{
var file_name_script=filename+".css";
var file_ref=document.createElement("link"); //use for creating link tag
file_ref.setAttribute("rel","StyleSheet");
file_ref.setAttribute("type","text/css");
file_ref.setAttribute("href",file_name_script);
document.getElementsByTagName("head")[0].appendChild(file_ref);//used for appending css link tag to head tag
}

Note:

if u want to call any script file replace "script" by "link" in document.createElement("link");



//coding for changing css style automatically in random using setTimeout()
var i_count_value=0;
var j_count_value=0;
file_name_script='glow.css';
select_fun();
function select_fun()
{
if(file_name_script=='blur.css')
{
i_count_value++;
file_name_script='glow.css';
}
else if(file_name_script=='glow.css')
{
j_count_value++;
file_name_script='blur.css';
}
var file_ref=document.createElement("link");
file_ref.setAttribute("rel","StyleSheet");
file_ref.setAttribute("type","text/css");
file_ref.setAttribute("href",file_name_script);
document.getElementsByTagName("head")[0].appendChild(file_ref);
if(j_count_value>=16)
{
history.go(); //used to refresh page
}
var a=setTimeout("select_fun()",800);
}

//css files

//blur.css
h5
{
height:50;
width:400;
font-size:30pt;
font-weight:bold;
color:orange;
filter:Blur(Direction=1, Strength=8)
}

//glow.css
h5
{
height:50;
width:400;
font-size:30pt;
font-weight:bold;
filter:Glow(Color=green, strength=6)
}


List of Filter Property Values (Functions)

alpha -- Set transparency properties for an element This filter sets the level of opacity for an element. This can be a constant value, or it can be 'blended' across an element (i.e., an alpha gradient) using a variety of different styles.

blendtrans -- Fade the element into or out of view This dynamic filter is used to fade an element and its content into and out of view: parameters control the speed and duration of the fading effect.

blur -- Blur the element and its content This filter is used to blur the content of an element. Parameters can control the degree of blurring, and the direction in which the blur is applied.

chroma -- Make a single color transparent This filter takes the form filter: chroma(color="rrggbb); , and sets the indicated color to be transparent. Dynamic scripts can use this to change the color that is transparent. The value rrggbb can be either an RGB code (#rrggbb) or a known color name.

dropshadow -- Add a drop shadow to the element text This filter creates a drop shadow effect for the text content of an element. Various supported parameters define the direction and size of the shadow. This is only supported by the div, marquee, span, table, td and th elements.

fliph -- Horizontally flip the element This filter has no parameters and takes the form: filter: fliph(); . This flips or "mirrors" the element horizontally.

flipv -- Vertically flip the element Adds radiance around the outer edge of an element . filter: flipv(); . This flips or "mirrors" the element vertically.

glow -- Add radiance around text letters This filter adds a radiant glow around the text content of an element. The parameter color sets the glow color (e.g. color=green), while the parameter strength sets the size for the glow( zero to 100). This has no effect if a background color or image is applied to the element.

gray -- Render element in grayscale This filter has no parameters and takes the form: filter: gray(); . This transforms the element and content to a grayscale palette.

invert -- Inverts colors in the element This filter has no parameters and takes the form: filter: invert(); . This transforms the element and content such that each color is replaced by the color with the opposite hue, saturation and brightness.

light -- Simulated light source projected on the element This filter creates the effect of a simulated light source shining down on the element content. Parameters define the type of light source (color, shape, strength) and the position of the source.

mask -- Remasks transparent pixels. element This filter takes the selected element content, paints the transparent pixels using the color specified by the color property, and changes all the nontransparent pixels to be transparent. This takes only one parameter, color, to set the color.
redirect -- Allow animation using Microsoft DirectAnimation™ components. This filter Converts the object into a DAImage object which can then be manipulated using Microsoft's DirectAnimation controls. Of course, this requires that the DirectAnimation browser component, be invoked in the Web page. This is typically done by referencing the appropriate DLL using an object element.

revealtrans -- Show or hide an element and its content This filter defines one of 23 defined transitions that can hide or reveal the element content. Parameters define the type of transition, its duration, and the nature of the transition (e.g., stops after one transition loop).

shadow -- Paint a shadow around the element content This filter paints a shadow around the selected element content. Parameters define the color of the shadow, and the direction in which the shadow should be applied.

wave -- Apply a sine-wave distortion to the element This filter applies a sine-wave distortion to the element and its content. Parameters define the magnitude and frequency of the wave, and the strength (amplitude, color, etc.) of the distortion.

xray -- Create X-ray effect This filter has no parameters and takes the form: filter: xray(); . This changes the color depth of the display, and renders the element content in black and white, making it look like a black-and-white x-ray.

Monday, December 1, 2008

Text Effect using css

















Text Effect Of Glow

h6 {
height:50;
width:400;
font-size:20pt;
font-weight:bold;
filter:Glow(Color=#FFFF00, strength=10)
}

Text Effect of Blur

h5 {
height:50;
width:400;
font-size:20pt;
font-weight:bold;
filter:Blur(Direction=1, Strength=8)
}

Text Effect of Shadow

h4{
height:50;
color:orange;
width:400;
font-size:20pt;
font-weight:bold;
filter:shadow(Color=green)
}

Rotate text in horizontal position
h6{
height:50;
width:400;
font-size:20pt;
font-weight:bold;
filter:fliph()
}

Rotate text in vertical position
h6{
height:50;
width:400;
font-size:20pt;
font-weight:bold;
filter:fliph()
}







Designing IE Scrollbar Color using css

html {
scrollbar-face-color:orange;
scrollbar-shadow-color: blue;
scrollbar-highlight-color: green;
scrollbar-3dlight-color:green;
scrollbar-darkshadow-color: white;
scrollbar-track-color:white;
scrollbar-arrow-color:white;
}

Note:
if u want to hide a scroll bar just place same color name for all attributes...