Friday, March 28, 2008

Thursday, March 20, 2008

Wednesday, March 19, 2008

Gradient Filter (A, ABBR, ACRONYM, ...)

Gradient Filter (A, ABBR, ACRONYM, ...): "Gradient Filter"



filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#ffffff,endColorStr=blue);



http://www.svdeals.com/

Friday, March 14, 2008

Content feeds with RSS 2.0

Content feeds with RSS 2.0: "Content feeds with RSS 2.0Content feeds with RSS 2.0"


www.visli.com

CodeProject: Introduction to XMLDataSource control in ASP.NET 2.0. Free source code and programming help

CodeProject: Introduction to XMLDataSource control in ASP.NET 2.0. Free source code and programming help: "Introduction to XMLDataSource control in ASP.NET 2.0"


XPath="rss/channel/item" runat="server">


<%#XPath("title")%>


<%#XPath("description")%>

<%#XPath("pubDate")%>


Wednesday, March 12, 2008

Parsing Amazon Web Services (AWS) with C# and .NET

Parsing Amazon Web Services (AWS) with C# and .NET

Amazon web services are one of the most feature and information-rich sourcesof queryable product data available. They even have user and editorial reviews thatyou can present to your customers to induce them to buy through your site. Thebest part is that it’s free for developers (Get it at Amazon.com).Here I want to present a short tutorial on how to access the data in AWS withC#. It’s not really hard to use at all from .NET, and in fact is quite a biteasier than some of the feeds I have dealt with before (e.g. Apple iTunes feed).There are no namespaces in the nodes to worry about so our job is a bit simpler.
I know using XSLT might be preferable, but someone just might be looking for aDOM-centric way to parse an XML feed.In order to query the Amazon information database, you need an AWSAccessKeyId.In order to get paid for any sales originating from your site, you need anAmazon AssociateTag.So the query URL would look something like this (substitute your AccessKeyId for“12345″ and your AssociateTag for “mytag-20″):
http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=12345&AssociateTag=mytag-20
For this operation we will search for some items in a category (Mario VideoGamesin this case), so we append to the URL:&Operation=ItemSearch&SearchIndex=VideoGames&Keywords=Mario
We also want to know about the items and get some prices and images so we tackthis on to the URL:&ResponseGroup=Request,ItemAttributes,OfferSummary,Images
Lastly, we desire to see some reviews done by customers and editorial staff sowe append Reviews,EditorialReview
So the final URL looks like this:
http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=12345&AssociateTag=mytag-20&Operation=ItemSearch&SearchIndex=VideoGames&Keywords=Mario&ResponseGroup=Request,ItemAttributes,OfferSummary,Images,Reviews,EditorialReview
The response is big, so I’ll just deal with the relevant parts here. Let’ssuppose we want to get the following information from the first item in thefeed:-DetailPageURL (The page you direct your users to go to buy the item)-SmallImage (Graphical representation of the product)-Title of the game-LowestNewPrice (lowest price for the item on Amazon)-Text of a customer review of the item
The simplified feed looks like this:



True




http://www.amazon.com/gp.......more stuff



http://ec1.images.... more stuff








$26.90






Bla Bla Bla. This is the greatest game ever.






What to do first? Let’s open the XmlDocument:String strURL = "http://webservices.amazon.com.....";
XmlDocument doc = new XmlDocument();
doc.Load(strURL);
//See if the response is valid - Amazon sends this info in a
//node of the XML tree:
XmlNodeList lstIsValid = doc.GetElementsByTagName("IsValid");
//This is nice because .NET automatically drills down a couple
//of levels to find the "IsValid" node tag
if (lstIsValid.Count > 0 && lstIsValid[0].InnerXml == "True")
{
//InnerXml holds is the actual data from the node
//Ready to party on the data because the response is valid
XmlNodeList lstItems = doc.GetElementsByTagName("Item");
//Also automatically getting info a couple of levels
//deep - sweet
//Get a NodeList of the "Item" nodes - they hold our info
if (lstItems.Count > 0)
{
//could use a foreach loop here to get them all
XmlNode nItem = lstItems[0];
//all children of the first "item" node
foreach (XmlNode nChild in nItem.ChildNodes)
{
//Clunky way to find a child node.
//This is the best I could
//come up with from the MSFT docs.
//Anybody have a better way?
if (nChild.Name == "DetailPageURL") //string compare !
{
String strURL = nChild.InnerXml; //our data !
}
else if (nChild.Name == "SmallImage")
{
//Now we have to look through the children of the
//SmallImage node:
foreach (XmlNode nURLImg in nChild.ChildNodes)
{
if (nURLImg.Name == "URL")
{
String strImage = nChild.InnerXml; //our data !
}
}
}
else if (nChild.Name == "ItemAttributes")
{
foreach (XmlNode nIA in nChild.ChildNodes)
{
//Look through each "ItemAttributes" to find the one
//we want again
if (nIA.Name == "Title")
{
String strTitle = nIA.InnerXml; //our data !
}
}
}
else if (nChild.Name == "OfferSummary")
{
foreach (XmlNode nOS in nChild.ChildNodes)
{
//looking again
if (nOS.Name == "LowestNewPrice")
{
foreach (XmlNode nLNP in nOS.ChildNodes)
{
if (nLNP.Name == "FormattedPrice")
{
String strPrice = nLNP.InnerXml; //our data !
break; //done looking here.
}
}
}
}
}
else if (nChild.Name == "CustomerReviews")
{
foreach (XmlNode nCR in nChild.ChildNodes)
{
if (nCR.Name == "Review")
{
foreach (XmlNode nRev in nCR.ChildNodes)
{
if (nRev.Name == "Content")
{
//Our review text!
String strReview = nRev.InnerXml;
}
}
}
}
}
}
}
}

http://www.svdeals.com/

XmlDataSource control

ASP.NET QuickStart Tutorials: "XmlDataSource control"


http://www.visli.net/

Tuesday, March 11, 2008

how can I get url of page ASPNET C#

how can I get url of page ASPNET C#


Request.Url.Host or Request.ServerVarables("HTTP_HOST")



www.svdeals.com

Left, Right and Mid functions in C#

Left, Right and Mid functions in C#: "Left, Right and Mid functions in C#"


public static string Left(string param, int length)
{
//we start at 0 since we want to get the characters starting from the
//left and with the specified lenght and assign it to a variable
string result = param.Substring(0, length);
//return the result of the operation
return result;
}
public static string Right(string param, int length)
{
//start at the index based on the lenght of the sting minus
//the specified lenght and assign it a variable
string result = param.Substring(param.Length - length, length);
//return the result of the operation
return result;
}

public static string Mid(string param,int startIndex, int length)
{
//start at the specified index in the string ang get N number of
//characters depending on the lenght and assign it to a variable
string result = param.Substring(startIndex, length);
//return the result of the operation
return result;
}

public static string Mid(string param,int startIndex)
{
//start at the specified index and return all characters after it
//and assign it to a variable
string result = param.Substring(startIndex);
//return the result of the operation
return result;
}

WWW.SVDEALS.COM

Monday, March 10, 2008

How to: Join Multiple Strings (C#)

How to: Join Multiple Strings (C#): "How to: Join Multiple Strings (C# Programming Guide)"

class StringBuilderTest
{ static void Main()
{ string two = "two";
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("one ");
sb.Append(" three");
System.Console.WriteLine(sb.ToString());
string str = sb.ToString();
System.Console.WriteLine(str); }}


www.svdeals.com

Friday, March 7, 2008

RSS Feed as parameter XmlDataSource datafield as variable

Sample ASPX Using a Gallery Dropdown





And the Code Behind (C#)protected void Page_Load(object sender, EventArgs e)

protected void Page_Load(object sender, EventArgs e)
{
string rssURL;
string URLID;
// URLID = ddlURL.SelectedValue.ToString();
URLID = Request["URLID"];
rssURL = "http://xml-us.amznxslt.com/onca/xml3?t=wwwvislicom-20&dev-t=16ND0GSSVYMWG9M8ECG2&KeywordSearch=" + URLID + "&mode=electronics&bcm=&type=lite&page=1&ct=text%2Fxml&sort=%20salesrank&f=http%3A%2F%2Fxml.amazon.com%2Fxsl%2Fxml-rss091.xsl";
{
xmlDS.DataFile = rssURL;
dlSearch.DataSource = xmlDS;
dlSearch.DataBind();
}


}

SmugMug (DigitalColony.com)

Glassy Black GridView Theme - Kevin Brammer

Glassy Black GridView Theme - Kevin Brammer: "Glassy Black GridView Theme"


www.visli.com

Wednesday, March 5, 2008