Monday, August 22, 2011

Print div content in using Javsscript??

Below code used to print div content here we have to write printable content in "printDiv" 

    <form id="Form1" method="post" runat="server">
 <div id="printDiv">
  Printable content
 </div>
 <input type="button" value="Print" onclick="JavaScript:printPartOfPage('printDiv');">

<script type="text/javascript">
<!--
function printPartOfPage(elementId)
{
 var printContent = document.getElementById(elementId);
 var windowUrl = 'about:blank';
 var uniqueName = new Date();
 var windowName = 'Print' + uniqueName.getTime();
 var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0');

 printWindow.document.write(printContent.innerHTML);
 printWindow.document.close();
 printWindow.focus();
 printWindow.print();
 printWindow.close();
}
// -->
</script>

</form>


Njoy coding......

Sunday, August 14, 2011

Playing You tube video on own site??

A jQuery plugin to hook into the YouTube Chromeless Video API.
Sample Usage:
<a href="http://www.youtube.com/watch?v=sxUjB3Q04rQ&quot; class="video-link">Bolt Arms - Around the World</a>

$(document).ready(function() {
  $('a.video-link').ytchromeless();
});


Requirements:
- jQuery: http://jquery.com/
- SWFObject: http://code.google.com/p/swfobject/
- YouTube Chromeless Video Plugin: http://github.com/davist11/YouTube-Chromeless


Options:
- videoWidth : '640'
- videoHeight : '360'
- videoIdBase : 'ytplayer'
- params : { allowScriptAccess: 'always', wmode: 'transparent' }
Njoy Coding.....:)

Tuesday, August 2, 2011

cookies with jquery(set,get and delete cookies)........??

I can easily manage cookies information by using  jquery cookie plugin.

Download jquery cookie plugin here http://plugins.jquery.com/project/Cookie

Here I was share simple script to handle jquery cookies:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>

    <script src="js/jquery-1.4.4.min.js" type="text/javascript"></script>

    <script src="js/jquery.cookie.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
    function setCookie(name,value,days) {
        if (days) {
            var date = new Date();
            date.setTime(date.getTime()+(days*24*60*60*1000));
            var expires = "; expires="+date.toGMTString();
        }
        else var expires = "";
        document.cookie = name+"="+value+expires+"; path=/";
    }

    function getCookie(name) {
        var nameEQ = name + "=";
        var ca = document.cookie.split(';');
        for(var i=0;i < ca.length;i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1,c.length);
            if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
        }
        return null;
    }

    function deleteCookie(name) {
        setCookie(name,"",-1);
    } 
   
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <input id="Button1" type="button" onclick="setCookie('myCookie', 'myValue', 1);" value="SetCookies" />
        <input id="Button2" type="button" onclick="alert(getCookie('myCookie'));" value="GetCookies" />
        <input id="Button3" type="button" onclick="deleteCookie('myCookie');" value="DeleteCookiess" />
    </div>
    </form>
</body>
</html>

In above code setCookie() used for setting cookies, getCookie() function used for get cookies value and deleteCookie() used for delete cookies information.

Njoy coding.....:)

Wednesday, July 20, 2011

HighLight Grid View Selected Row Using Jquery..?

All we need to do is that on mouseover on gridview rows assign any CSS and on mouseout, remove that CSS. Rather than using mouseover and mouseout method seperately, jQuery provides another method named "hover()" which serves purpose of both the methods.


    <script type="text/javascript" language="javascript">
 
       $(document).ready(function() {
          $("#<%=gvCustomer.ID%> tr").hover(function() {
            $(this).css("background-color", "Lightgrey");
           }, function() {
           $(this).css("background-color", "#ffffff");
          });
        });
 
    </script>


My Grid view structure is.


<asp:GridView ID="gvCustomer" runat="server" AutoGenerateColumns="False"
            DataKeyNames="ID" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False"
                    ReadOnly="True" SortExpression="ID" />
                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                <asp:BoundField DataField="Age" HeaderText="Age" SortExpression="Age" />
            </Columns>
</asp:GridView>


Here the above code highlighted header row as well. Solution to overcome header row highlighted solution is here.


  <script type="text/javascript" language="javascript">
 
        $(document).ready(function() {
          $("#<%=gvCustomer.ID%> tr:has(td)").hover(function() {
            $(this).css("background-color", "Lightgrey");
           }, function() {
           $(this).css("background-color", "#ffffff");
          });
        });
 
    </script>


Enjoy Coding:)

Tuesday, July 12, 2011

Best way to implement support for multiple languages in a web app?

There are some basic trick to make multi language supported application:

1. Store data in UTF in your DB.  

2. Do not hard code strings anywhere in the code. Use resource files so you can translate just them to enable support for a new language.

3. Do not hard code any styles in the HTML(like: float:left, etc.) but externalize them in CSS files. That way, you don't need an army of developers to support Arabic, which is read from right to left.

4. Pay attention to common areas (such as header, footer, etc., which maybe left/right aligned) typically reserved for branding and navigation. Like the styles above, these are affected by I18N.
I18N is actually easy and requires only a little planning and care.

Njoy Coding......:)

Wednesday, June 29, 2011

Protect your web site from bot?

By using recaptcha you can protect your web side from bot:

For using recaptcha in your web site you have need to download Recaptcha.dll from


After that add DLL as a reference as url website.

You can get your public key and private key from

http://www.google.com/recaptcha

here my page name was captcha.aspx: 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Captcha.aspx.cs" Inherits="Captcha" %>
<%@ Register TagPrefix="recaptcha" Namespace="Recaptcha" Assembly="Recaptcha" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <recaptcha:RecaptchaControl
    ID="recaptcha"
    runat="server"
    PublicKey="XXXXXXXXXX"
    PrivateKey="XXXXXXXXXX"
    />
    <div>
   
    <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />

   
    </div>
    </form>
</body>
</html>

Server side code for captcha.aspx is:

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Recaptcha;

public partial class Captcha : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
             //True Conditon
        }
        else
        {
            //False Condition
        }
    }
}



For more information gone through following URL:

http://code.google.com/apis/recaptcha/docs/aspnet.html

Njoy buddy...:)

Sunday, June 26, 2011

ASP.NET tips and trick....?


Use StringBuilder for Complex String Manipulation

When a string is modified, the run time will create a new string and return it, leaving the original to be garbage collected. Most of the time this is a fast and simple way to do it, but when a string is being modified repeatedly it begins to be a burden on performance: all of those allocations eventually get expensive. Here's a simple example of a program that appends to a string 50,000 times, followed by one that uses a StringBuilder object to modify the string in place. The StringBuilder code is much faster, and if you run them it becomes immediately obvious.



namespace ConsoleApplication1.Feedback{
  using System;
  
  public class Feedback{
    public Feedback(){
      text = "You have ordered: \n";
    }

    public string text;

    public static int Main(string[] args) {
      Feedback test = new Feedback();
      String str = test.text;
      for(int i=0;i<50000;i++){
        str = str + "blue_toothbrush";
      }
      System.Console.Out.WriteLine("done");
      return 0;
    }
  }
}



namespace ConsoleApplication1.Feedback{
  using System;

  public class Feedback{
    public Feedback(){
      text = "You have ordered: \n";
    }

    public string text;

    public static int Main(string[] args) {
      Feedback test = new Feedback();
      System.Text.StringBuilder SB = 
        new System.Text.StringBuilder(test.text);
      for(int i=0;i<50000;i++){
        SB.Append("blue_toothbrush");
      }
      System.Console.Out.WriteLine("done");
      return 0;
    }
  }
 
 

Use Session State Only If You Need To

One extremely powerful feature of ASP.NET is its ability to store session state for users, such as a shopping cart on an e-commerce site or a browser history. Since this is on by default, you pay the cost in memory even if you don't use it. If you're not using Session State, turn it off and save yourself the overhead by adding <@% EnabledSessionState = false %> to your asp. This comes with several other options, which are explained at the ASP. NET Web site. For pages that only read session state, you can choose EnabledSessionState=readonly. This carries less overhead than full read/write session state, and is useful when you need only part of the functionality and don't want to pay for the write capabilities.

Use View State Only If You Need To

An example of View State might be a long form that users must fill out: if they click Back in their browser and then return, the form will remain filled. When this functionality isn't used, this state eats up memory and performance. Perhaps the largest performance drain here is that a round-trip signal must be sent across the network each time the page is loaded to update and verify the cache. Since it is on by default, you will need to specify that you do not want to use View State with <@% EnabledViewState = false %>. You should read more about View State on the the ASP. NET Web site to learn about some of the other options and settings to which you have access.

BackSpace problum with IE Toolbar...?

For Handling backspace IE toolbar Band object I need to include following thing:

Here tstxt_Name and tstxt_Password is my TextBox..



public IEToolbarEngine () 


         Assembly asm = Assembly.GetExecutingAssembly (); 
         string fullName = asm.GetModules () [0].FullyQualifiedName;
         toolbarFolder = Path.GetDirectoryName (fullName);
         dataFolder = DataFolder;


        try

         { 
                cacheFolder = Path.Combine (dataFolder, "Cache"); 
               Directory.CreateDirectory (cacheFolder); 
         }
        catch (Exception){}

         try

        {
           rssFoldr = Path.Combine (cacheFolder, "RSS");
           Directory.CreateDirectory (rssFolder);
        } 

      catch (Exception){}

       InitializeComponent ();

       toolStripLabel1.Size = new System.Drawing.Size(150, 21);
       tstxt_Name.GotFocus += new EventHandler(tstxt_Name_GotFocus);
      tstxt_Name.Focus();

      tstxt_Password.GotFocus += new EventHandler(tstxt_Password_GotFocus);
      tstxt_Password.Focus(); 

}


private void tstxt_Password_GotFocus(object sender, EventArgs e)


      this.OnGotFocus(e);
}

private void tstxt_Name_GotFocus(object sender, EventArgs e)

{
      this.OnGotFocus(e);
}

public override int TranslateAcceleratorIO(ref MSG msg)


       TranslateMessage(ref msg);
       DispatchMessage(ref msg);
       return 0;
}



Njoy buddy..:)

Wednesday, May 25, 2011

Send email with attachment in ASP.NET?



First, you will need to import the System.Net.Mail namespace.


using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;

public partial class _Default : System.Web.UI.Page
{

protected void Page_Load(object sender, EventArgs e)
{

}

protected void btnSubmit_Click(object sender, EventArgs e)
{
try
{
MailAddress SendFrom = new MailAddress(txtFrom.Text);
MailAddress SendTo = new MailAddress(txtTo.Text);

MailMessage MyMessage = new MailMessage(SendFrom, SendTo);

MyMessage.Subject = txtSubject.Text;
MyMessage.Body = txtBody.Text;

Attachment attachFile = new Attachment(txtAttachmentPath.Text);
MyMessage.Attachments.Add(attachFile);

SmtpClient emailClient = new SmtpClient(txtSMTPServer.Text);
emailClient.Send(MyMessage);

litStatus.Text = "Message Sent";
}
catch (Exception ex)
{
litStatus.Text=ex.ToString();
}
}

Create, Delete & Move Directory Using C#.Net?

Hi friend here I have written code for Creating, Delete and Move dirrctory.

In My createDirectory.aspx page I have use one text box and three button.

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;

public partial class CreateDirectory : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       
    }

    protected void btnCreate_Click(object sender, EventArgs e)
    {
        string FolderName = txtFolder.Text;
        string Path = Server.MapPath(FolderName);

        try
        {
            // Check if directory exists
            if (!Directory.Exists(Path))
            {
                // Create the directory.
                Directory.CreateDirectory(Path);
            }

        }
        catch (IOException _ex)
        {
            Response.Write(_ex.Message);
        }
    }
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        string FolderName = txtFolder.Text;
        string Path = Server.MapPath(FolderName);

        try
        {
            // Check if directory exists
            if (Directory.Exists(Path))
            {
                // Delete the directory.
                Directory.Delete(Path);
            }

        }
        catch (IOException _ex)
        {
            Response.Write(_ex.Message);
        }
    }
    protected void btnMove_Click(object sender, EventArgs e)
    {
        string FolderName = txtFolder.Text;
        string sPath = Server.MapPath(FolderName);
        string dPath = Server.MapPath("MoveItem\\" + FolderName);

        try
        {
            // Check if directory exists
            if (Directory.Exists(sPath))
            {
                // Move the directory.
                Directory.Move(sPath, dPath);
               
            }

        }
        catch (IOException _ex)
        {
            Response.Write(_ex.Message);
        }
    }
}

Before deleting directory make sure directory is empty.

Monday, May 9, 2011

Script For Creating Directory And Folder Using C#.Net??


Here I just write code for create directory. Go through it it's a very simple example:

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;

public partial class CreateDirectory : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       
        // Call function for creating a directory
        CreateDirectoryFunction(Server.MapPath("NewFolder"));
    }

    private void CreateDirectoryFunction(string NewDirectory)
    {
        try
        {
            // Check if directory exists
            if (!Directory.Exists(NewDirectory))
            {
                // Create the directory.
                Directory.CreateDirectory(NewDirectory);
            }
        }
        catch (IOException _ex)
        {
            Response.Write(_ex.Message);
        }
    }
}


Saturday, April 30, 2011

Importing Data From Database table to CSV File???

Here I am writing simple come for importing data from database to CSV file :

My table structure is:


Customer Table:

ID    int   Unchecked
Name  nvarchar(50)      Checked
Age   nvarchar(50)      Checked


Code for importing data:


using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;


public partial class CSVDataFromDatabase : System.Web.UI.Page
{
    DataTable tblCustomer = new DataTable("Customer");
    DataRow drCustomer;
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnExportToCSV_Click(object sender, EventArgs e)
    {
        CreateCustomerTable();
        DataClassesDataContext Db_Context = new DataClassesDataContext();
        IQueryable<Customer> cusData = Db_Context.Customers;

        foreach (Customer cus in cusData)
        {
            tblCustomer = BindCustomerTable(cus.ID, cus.Name, cus.Age);
        }

        writeDataToCsvFile(tblCustomer, "Customer");
    }

    public void CreateCustomerTable()
    {
        DataColumn col_ID = new DataColumn("ID");
        DataColumn col_Name = new DataColumn("Name");
        DataColumn col_Age = new DataColumn("Age");

        tblCustomer.Columns.Add(col_ID);
        tblCustomer.Columns.Add(col_Name);
        tblCustomer.Columns.Add(col_Age);
    }

    public DataTable BindCustomerTable(int Id, string Name, string Age)
    {
        drCustomer = tblCustomer.NewRow();
        drCustomer["ID"] = Id;

        drCustomer["Name"] = Name;
        drCustomer["Age"] = Age;

        tblCustomer.Rows.Add(drCustomer);

        return tblCustomer;
    }


    public void writeDataToCsvFile(DataTable dt, string filename)
    {

        string strFilePath =  "G:\\"+filename+".csv";

        StreamWriter sw = new StreamWriter(strFilePath, true);
        int iColCount = dt.Columns.Count;
        for (int i = 0; i < iColCount; i++)
        {
            sw.Write(dt.Columns[i]);

            if (i < iColCount - 1)
            {
                sw.Write(",");
            }
        }

        sw.Write(sw.NewLine);
        foreach (DataRow dr in dt.Rows)
        {
            for (int i = 0; i < iColCount; i++)
            {
                if (!Convert.IsDBNull(dr[i]))
                {
                    sw.Write(dr[i].ToString());

                }
                if (i < iColCount - 1)
                {
                    sw.Write(",");
                }
            }
            sw.Write(sw.NewLine);

        }
        sw.Close();

    }
}


Hope you are enjoying...;)

Wednesday, April 20, 2011

Exproting Data From GridView To Excel File...?

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;

public partial class DatagridToExcel : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnExport_Click(object sender, EventArgs e)
    {
        ExportToExcel("report.xls", GridView1);
    }

    private void ExportToExcel(string strFileName, GridView gv)
    {
        Response.Clear();
        Response.Buffer = true;
        Response.ContentType = "application/vnd.xls";
        Response.AddHeader("content-disposition",
        "attachment;filename=" + strFileName);
        Response.Charset = "";
        this.EnableViewState = false;
        System.IO.StringWriter sw = new StringWriter();
        System.Web.UI.HtmlTextWriter htw = new HtmlTextWriter(sw);
        gv.RenderControl(htw);
        Response.Write(sw.ToString());
        Response.End();
    }
    public override void VerifyRenderingInServerForm(Control control)
    {

    }

}

Here you need to include VerifyRenderingInServerForm() Function also...


Importing From Excel File To Datagrid In ASP.NET.....:)

Here In design page I have one grid id as GVExcel.
and G:\\Yash\\WorkInProgress\\TestProject\\website1\\Student.xls path of excel file which has to import.


protected void Page_Load(object sender, EventArgs e)
    {       
        try
        {
            string conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\\Yash\\WorkInProgress\\TestProject\\website1\\Student.xls;Extended Properties=Excel 8.0;";

            DataSet ds = new DataSet();
            OleDbDataAdapter da = new OleDbDataAdapter("select * From [Sheet1$]", conn);
            da.Fill(ds);
            GVExcel.DataSource = ds;
            GVExcel.DataBind();
        }
        catch(Exception ex)
        {
        }
        finally
        {
            // Close connection
            //oledbConn.Close();
        }     
    }

Hope this code is helpful for you.

Thursday, April 14, 2011

Create, Read, write and appending Data to textFile?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ReadWriteAppendTextFile
{
    class Program
    {
        static void Main(string[] args)
        {
            WriteToFile();
            ReadFromFile("G:\\MyTextFile.txt");
            AppendToFile();
        }

        #region Function Used to create/Write text file

        static void WriteToFile()
        {           
            StreamWriter SW;
            SW = File.CreateText("G:\\MyTextFile.txt");
            SW.WriteLine("God is greatest of them all");
            SW.WriteLine("This is second line");
            SW.Close();
            Console.WriteLine("File Created SucacessFully");
        }
        #endregion


        #region Creating Data from text file

        static void ReadFromFile(string filename)
        {
            StreamReader SR;
            string S;
            SR = File.OpenText(filename);
            S = SR.ReadLine();
            while (S != null)
            {
                Console.WriteLine(S);
                S = SR.ReadLine();
            }
            SR.Close();
        }
        #endregion

        #region Function used to append data to text file

        static void AppendToFile()
        {
            StreamWriter SW;
            SW = File.AppendText("G:\\MyTextFile.txt");
            SW.WriteLine("This Line Is Appended");
            SW.Close();
            Console.WriteLine("Text Appended Successfully");
        }
        #endregion
    }
}

Saturday, March 19, 2011

Importing Contact From Gmail Account.?


Google provide api for importing contact you have to download this from following URL:


Here I write class file for that(“GContactsImport.cs”):

using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Google.GData.Contacts;
using Google.GData.Client;
using Google.GData.Extensions;
using Google.Contacts;


namespace GmailContact
{
    public class GContactsImport
    {
        public static DataSet GetGmailContacts(string App_Name, string Uname, string UPassword)
        {
            DataSet ds = new DataSet();
            DataTable dt = new DataTable();
            DataColumn C2 = new DataColumn();
            C2.DataType = Type.GetType("System.String");
            C2.ColumnName = "EmailID";
            dt.Columns.Add(C2);
            RequestSettings rs = new RequestSettings(App_Name, Uname, UPassword);
            rs.AutoPaging = true;
            ContactsRequest cr = new ContactsRequest(rs);
            Feed<Contact> f = cr.GetContacts();
            foreach (Contact t in f.Entries)
            {
                foreach (EMail email in t.Emails)
                {
                    DataRow dr1 = dt.NewRow();
                    dr1["EmailID"] = email.Address.ToString();
                    dt.Rows.Add(dr1);
                }
            }
            ds.Tables.Add(dt);
            return ds;
        }
    }
}


Code behind file for that (“Populate Gcontacts.aspx.cs”):

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Google.GData.Contacts;
using Google.GData.Client;
using Google.GData.Extensions;
using Google.Contacts;

namespace GmailContact
{
    public partial class PopulateGcontacts : System.Web.UI.Page
    {
        //GContactsImport
        protected void Page_Load(object sender, EventArgs e)
        {
string App_Name = "MyNetwork Web Application!";
string username = “testaccount@gmail.com”;
            string password = “testPassword”;
            DataSet ds = GContactsImport.GetGmailContacts(App_Name, username, password);
            GridView1.DataSource = ds;
            GridView1.DataBind(); 
        }

       
    }
}

 For any query fell free to ask....