Monday, January 19, 2009
डेट परसे इन sql
DateTime.Parse(Request["ctl00$ContentPlaceHolder1$GridView1$ctl0"+Rownum.ToString()+"$txt_date"], new CultureInfo("fr-FR", false));
Friday, January 16, 2009
GridView add multiple controls to edit item template
Reading values from Gridview Item Templates
//write this coding in gridview1_RowUpdating event // Read the values from Text Box String name = ((TextBox)(gridview1.Rows[e.RowIndex].FindControl("NAME"))).Text; //Read the values from Label String ID = ((Label)(dgSummary.Rows[e.RowIndex].FindControl("ID"))).Text; //Read Html Check Box value boolean bol=((HtmlInputCheckBox)(gridview1.Rows[e.RowIndex].FindControl("CheckBox1"))).Checked
An API for Google Image Search
find the url listed below
http://www.codeproject.com/KB/IP/google_image_search_api.aspx
http://www.codeproject.com/KB/IP/google_image_search_api.aspx
Upload any type of File through a C# Web Service
http://www.c-sharpcorner.com/UploadFile/scottlysle/UploadwithCSharpWS05032007121259PM/UploadwithCSharpWS.aspx
Get Values from CheckBoxList
String values = "";
for (int i=0; i< cbl.Items.Count; i++)
{
if(cbl.Items[i].Selected)
{
values += cbl.Items[i].Value + ",";
}
}
values = values.TrimEnd(',');
for (int i=0; i< cbl.Items.Count; i++)
{
if(cbl.Items[i].Selected)
{
values += cbl.Items[i].Value + ",";
}
}
values = values.TrimEnd(',');
How to get the Content Type(MimeType) of a file
private string MimeType (string Filename)
{
string mime = "application/octetstream";
string ext = System.IO.Path.GetExtension(Filename).ToLower();
Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(ext);
if (rk != null && rk.GetValue("Content Type") != null)
mime = rk.GetValue("Content Type").ToString();
return mime;
}
{
string mime = "application/octetstream";
string ext = System.IO.Path.GetExtension(Filename).ToLower();
Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(ext);
if (rk != null && rk.GetValue("Content Type") != null)
mime = rk.GetValue("Content Type").ToString();
return mime;
}
Wednesday, January 14, 2009
Dropdown in Gridview in Asp.net
DataSource="<%# GetProjectDs() %>"
DataTextField="PROJECT_NAME"
DataValueField="PROJECT_ID"
SelectedIndex='<%# GetProjectSelectedIndex((int)DataBinder.Eval(Container.DataItem,"PROJECT_ID")) %>'
>
DataTextField="TASK_NAME"
DataValueField="TASK_ID"
SelectedIndex='<%# GetTaskSelectedIndex((int)DataBinder.Eval(Container.DataItem, "TASK_ID")) %>'
/>
,'view_time_sheet.aspx?action=delete')">
,<%# Container.DataItemIndex + 2 %>)">
Subscribe to:
Posts (Atom)