RAD Item Command Events Handeling
protected void grdUser_ItemCommand(object source, GridCommandEventArgs e)
{
try
{
if (e.CommandName.ToUpper().Equals("EDITCONTENT"))
{
Session["ContentIDToUpdate"] = e.Item.Cells[3].Text;
Session["EditCONTENTTYPEID"] = e.Item.Cells[18].Text; // Assigning ContentTypeID
Session["ContUserId"] = e.Item.Cells[2].Text;
Session["CurrentPage"] = gridValue;//GRID
GenericSessions.CurrentPage = gridValue;//GRID
if (e.CommandArgument.Equals("MMS"))
Response.Redirect("EditMMSContent.aspx", false);
else
Response.Redirect("EditContent.aspx", false);
}
if (e.CommandName.ToUpper().Equals("MAPCONTENT"))
{
Session["ContentIDToUpdate"] = e.Item.Cells[3].Text;
Session["EditCONTENTTYPEID"] = e.Item.Cells[18].Text;
Session["CurrentPage"] = gridValue;
GenericSessions.CurrentPage = gridValue;
Response.Redirect("ManageRelatedContent.aspx", false);
}
{
try
{
if (e.CommandName.ToUpper().Equals("EDITCONTENT"))
{
Session["ContentIDToUpdate"] = e.Item.Cells[3].Text;
Session["EditCONTENTTYPEID"] = e.Item.Cells[18].Text; // Assigning ContentTypeID
Session["ContUserId"] = e.Item.Cells[2].Text;
Session["CurrentPage"] = gridValue;//GRID
GenericSessions.CurrentPage = gridValue;//GRID
if (e.CommandArgument.Equals("MMS"))
Response.Redirect("EditMMSContent.aspx", false);
else
Response.Redirect("EditContent.aspx", false);
}
if (e.CommandName.ToUpper().Equals("MAPCONTENT"))
{
Session["ContentIDToUpdate"] = e.Item.Cells[3].Text;
Session["EditCONTENTTYPEID"] = e.Item.Cells[18].Text;
Session["CurrentPage"] = gridValue;
GenericSessions.CurrentPage = gridValue;
Response.Redirect("ManageRelatedContent.aspx", false);
}
RAD Grid : pagination, sorting and filters
protected void grdUser_PreRender(object sender, EventArgs e)
{
GridFilterMenu menu = grdUser.FilterMenu;
int i = 0;
while (i < menu.Items.Count)
{
if (menu.Items[i].Text == "Contains" || menu.Items[i].Text == "StartsWith" || menu.Items[i].Text == "EndsWith" || menu.Items[i].Text == "NoFilter")
{
i++;
}
else
{
menu.Items.RemoveAt(i);
}
}
}
Toggeling visibility like treeview for the subreport in ssrs
refer the below link
http://www.simple-talk.com/sql/reporting-services/beginning-sql-server-2005-reporting-services-part-2/
http://www.simple-talk.com/sql/reporting-services/beginning-sql-server-2005-reporting-services-part-2/
gmail contact in .net web application using Google Contacts API

Source Code
using Google.GData.Client;
using Google.GData.Contacts;
using Google.GData.Extensions;
public partial class _Default : System.Web.UI.Page
{
private Service service;
private string uname;
private string authToken;
private String googleAuthToken = null;
private ContactsService contactsService = null;
public void Page_Load(object sender, EventArgs e)
{
this.contactsService = new ContactsService("GoogleContactsSample");
}
public void vyaslogin(Service servicetouse,string username)
{
this.service = servicetouse;
this.uname = username;
}
protected void Button1_Click(object sender, EventArgs e)
{
vyaslogin(this.contactsService, "pyk.vyas@gmail.com");
this.service.setUserCredentials(gmailusername.Text, gmailpassword.Text);
try
{
this.authToken = this.service.QueryAuthenticationToken();
Label1.Text = "login success";
ContactsQuery query = new ContactsQuery(ContactsQuery.CreateContactsUri(gmailusername.Text));
this.lbcontacts.Items.Clear();
ContactsFeed feed = this.contactsService.Query(query);
if (feed != null && feed.Entries.Count > 0)
{
foreach (ContactEntry entry in feed.Entries)
{
this.lbcontacts.Items.Add(entry.PrimaryEmail.Address.ToString());
}
}
}
catch
{
Label1.Text="login failed";
}
}
}
using Google.GData.Contacts;
using Google.GData.Extensions;
public partial class _Default : System.Web.UI.Page
{
private Service service;
private string uname;
private string authToken;
private String googleAuthToken = null;
private ContactsService contactsService = null;
public void Page_Load(object sender, EventArgs e)
{
this.contactsService = new ContactsService("GoogleContactsSample");
}
public void vyaslogin(Service servicetouse,string username)
{
this.service = servicetouse;
this.uname = username;
}
protected void Button1_Click(object sender, EventArgs e)
{
vyaslogin(this.contactsService, "pyk.vyas@gmail.com");
this.service.setUserCredentials(gmailusername.Text, gmailpassword.Text);
try
{
this.authToken = this.service.QueryAuthenticationToken();
Label1.Text = "login success";
ContactsQuery query = new ContactsQuery(ContactsQuery.CreateContactsUri(gmailusername.Text));
this.lbcontacts.Items.Clear();
ContactsFeed feed = this.contactsService.Query(query);
if (feed != null && feed.Entries.Count > 0)
{
foreach (ContactEntry entry in feed.Entries)
{
this.lbcontacts.Items.Add(entry.PrimaryEmail.Address.ToString());
}
}
}
catch
{
Label1.Text="login failed";
}
}
}
Posted by
Vyas Pentakota
at
9:19 PM
Labels:
gmail contacts in .net web application,
google contact api,
vyas gmail contacts api
How to get ConnectionStrings list programmatically in asp.net
protected void Button1_Click(object sender, System.EventArgs e) {
ListBox1.DataSource = System.Web.Configuration.WebConfigurationManager.ConnectionStrings;
ListBox1.DataBind();
}

ListBox1.DataSource = System.Web.Configuration.WebConfigurationManager.ConnectionStrings;
ListBox1.DataBind();
}

Posted by
Vyas Pentakota
at
10:14 PM
Labels:
connection string,
How to get ConnectionStrings list programmatically in asp.net,
vyas
Subscribe to:
Posts (Atom)
