Filling space

Loading...

Sunday, December 12, 2010

Post to wcf service windows phone 7

namespace sendsms
{
public partial class Page1 : PhoneApplicationPage
{
public Page1(string s , string u , string t)
{
InitializeComponent();
smssendClient client = new smssendClient();
client.sendsmsCompleted += new EventHandler(client_sendsmsCompleted);
client.sendsmsAsync(s, u, t);

}
void client_sendsmsCompleted(object sender, sendsmsCompletedEventArgs e)
{
textBlock1.Text = e.Result;
}
}
}

Saturday, August 28, 2010

Populate drop down liast repeater

protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
DropDownList dll = (DropDownList )e.Item.FindControl("ddOptions");
if (dll != null)
{
string ID = //Grab the id here
DataTable dt = // call the method from your Class library that returns a DataTable and pass the value of ID as the paramter

if (dt.Rows.Count > 0)
{
dll.DataSource = dt;
dll.DataTextField = "ColumnName";
dll.DataValueField = "ColumnName";
dll.DataBind();
}
}

}

}

Tuesday, August 10, 2010

web site tools

http://www.feedbackarmy.com/

https://www.usertesting.com/

Saturday, August 7, 2010

BIt.ly api asp.net c#

C# class bitlyapi.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;

///
/// Summary description for bitly
///

public static class BitlyApi
{
private const string apiKey = "YOUR API KEY";
private const string login = "YOUR LOGIN";

public static BitlyResults ShortenUrl(string longUrl)
{
var url =
string.Format("http://api.bit.ly/shorten?format=xml&version=2.0.1&longUrl={0}&login={1}&apiKey={2}",
HttpUtility.UrlEncode(longUrl), login, apiKey);
var resultXml = XDocument.Load(url);
var x = (from result in resultXml.Descendants("nodeKeyVal")
select new BitlyResults
{
UserHash = result.Element("userHash").Value,
ShortUrl = result.Element("shortUrl").Value
}
);
return x.Single();
}
}

public class BitlyResults
{
public string UserHash { get; set; }

public string ShortUrl { get; set; }
}


Any c# .cs code behind page

string longurl = "http://www.longurl.com;
var shortUrl = BitlyApi.ShortenUrl(longurl).ShortUrl;
bitlyurl = shortUrl.ToString();

Thursday, July 22, 2010

unique entries stored procedure

IF NOT EXISTS(SELECT @uid,@post_id,@travelerid FROM web_like_log WHERE uid=@uid and post_id=@post_id or travelerid=@travelerid)

Friday, July 2, 2010

get you tube thumbnail images

http://img.youtube.com/vi//1.jpg
http://img.youtube.com/vi//2.jpg
http://img.youtube.com/vi//3.jpg
http://img.youtube.com/vi//0.jpg

Friday, June 25, 2010

Iphone APN code sample

- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Add the tab bar controller's current view as a subview of the window
[window addSubview:tabBarController.view];
NSLog(@"Initiating remoteNoticationssAreActive");
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert)];
}
- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
NSLog(@"devToken=%@",deviceToken);
}
- (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)err {
NSLog(@"Error in registration. Error: %@", err);
}