Friday 28 September 2012

Attractive drop down menu using css

Write Down The Code

    <div id="content-wrapper">
  <ul id="hb-menu">
<li><a href="#">Home</a></li>
<li>
<a href="#">Categories</a>
<ul>
<li><a href="#">CSS</a></li>
<li><a href="#">Graphic design</a><ul>
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
<li><a href="#">Link 4</a></li>
</ul>   </li>

Thursday 27 September 2012

how can we upload and download file in asp.net

Code of upload/insert data in database:- 
 
protected void imgSubmit_Click(object sender, ImageClickEventArgs e)
    {
        SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["con"].ToString());
        SqlCommand cmd = new SqlCommand("application", con);
        cmd.Connection = con;
        cmd.CommandType = CommandType.StoredProcedure;

        if (filephoto.HasFile && filedoc1.HasFile && filedoc2.HasFile && filedoc3.HasFile)
        {
            string fileExt = System.IO.Path.GetExtension(filephoto.FileName);

Friday 21 September 2012

How can we validate .doc,.docx file using javascript

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script type="text/javascript" language="javascript">
function validate() {
var uploadcontrol = document.getElementById('<%=FileUpload3.ClientID%>').value;
//Regular Expression for fileupload control.
var reg = /^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.doc|.docx|.DOC|.DOCX)$/;
if (uploadcontrol.length > 0)
{
//Checks with the control value.
if (reg.test(uploadcontrol))
{
return true;
}

Saturday 8 September 2012

How can we select all check box in one click using javascript

<HeaderTemplate>
  <input id="chkAll"  
onclick="javascript:SelectchooseAllCheckboxes(this);" 
              runat="server" type="checkbox" />
</HeaderTemplate>