This is html code for datalist
<asp:DataList ID=”dlist” runat=”server” RepeatColumns=”3″ OnItemDataBound=”dlist_ItemDataBound” Width=”681px” ItemStyle-HorizontalAlign=”Left”>
<ItemTemplate>
<asp:CheckBox ID=”chkBlogSites” runat=”server” />
</ItemTemplate>
</asp:DataList>
IN Code Behind OnItemDatabound Event look like
protected void dlist_ItemDataBound(object sender, DataListItemEventArgs e){
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
// Here we get the reference of check box
CheckBox lit = (CheckBox)e.Item.FindControl(“chkBlogSites”);
if (lit != null)
{
//bind it with database field, in [...]
Archive for January, 2007
How to use Check boxes in DataList
Posted in asp.net 2 on January 27, 2007 | 5 Comments »
How to fetch data form Rss
Posted in .net framework 2, asp.net 2 on January 14, 2007 | Leave a Comment »
This is some code I used to fetch data from rss links and insert to database. Where _RssAgent is containing business logic, having getters, setters and function to insertion in database. you can implement as your requirement
XmlDocument doc = new XmlDocument();
doc.Load(xmlPath);
//Get all Items in the XML file
//Get reference to the first author node in the XML file
XmlNodeList titleList = [...]
Url regular expression in asp.net
Posted in asp.net 2, tagged url regular expression on January 13, 2007 | Leave a Comment »
buddy here is regular expression for Url Vaildation
“http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?”
asp.net control would be look like
<asp:RegularExpressionValidator ID=”RegularExpressionValidator1″ ControlToValidate=”XYZl” ValidationExpression=”http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?” runat=”server” ErrorMessage=”Invalid URL”></asp:RegularExpressionValidator>
enjoy
Url Vaildator in asp.net
Posted in Favorites on January 13, 2007 | Leave a Comment »
buddy here is regular expression for Url Vaildation
“http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?”
asp.net control would be look like
<asp:RegularExpressionValidator ID=”RegularExpressionValidator1″ ControlToValidate=”XYZl” ValidationExpression=”http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?” runat=”server” ErrorMessage=”Invalid URL”></asp:RegularExpressionValidator>
enjoy