Category: Dot Net Framework

downloading file in c#

downloading file in c#

private void DownloadFile(String strFileName){FileStream fs; string strContentType;string strPath=TaskManagementTool.Config.Path.ToString(); //Dim strFileName As String = Request.QueryString(”DocumentFile”)fs = File.Open(Server.MapPath(strPath + strFileName), FileMode.Open); Byte[] bytBytes = new byte[fs.Length] ; // Write the stream to the byte array fs.Read(bytBytes,...

how to get multiselected from listbox in asp.net

how to get multiselected from listbox in asp.net

we Select multiple indices from list boxes . the listbox have propery of GetSelectedIndicdces . Which return all selected indexes . so code is like  int[] _SelectedIndexes = lstBlog.GetSelectedIndices(); foreach (int Y in _SelectedIndexes)  {            Response.Write(this.lstBlog.Items[Y].Text...

How to use Check boxes in DataList

How to use Check boxes in DataList

 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...

How to fetch data form  Rss

How to fetch data form Rss

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 =...

Url regular expression in asp.net

Url regular expression in asp.net

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

Shopping Cart in asp.net 2

Shopping Cart in asp.net 2

Currently I m working on shopping cart application . I found some cool and very helpful articles where guys describe the way in which they write  shopping cart application in dot net. These are the...

Why Use Forms Authentication?

Why Use Forms Authentication?

No of reasons that mostly developers use Form based authentication in their asp.net application They have full control over the authentication code. They have full control over the appearance of the login form. Form...