Gaurav Taneja

Great dreams... never even get out of the box. It takes an uncommon amount of guts to put your dreams on the line, to hold them up and say, "How good or how bad am I?" That's where courage comes in.

  Home  |   Contact  |   Syndication    |   Login
  90 Posts | 0 Stories | 78 Comments | 7 Trackbacks

News




Google RankGoogle PRâ„¢ - Post your Page Rank with MyGooglePageRank.com



The content on this site represents my own personal opinions and thoughts at the time of posting, and does not reflect those of my employer's in any way.

Disclaimer:- All postings in this blog is provided "AS IS" with no warranties, and confers no rights.

Archives

Post Categories

Image Galleries

Atlas

Error

OutLook

SharePointService

Usefull Site Links

September 2006 Entries

try { this.EnableViewState = false; Response.ContentType = "text/xml"; // chnage the content type accordingly string Filename = System.Web.HttpContext.Curr... Filename = “abc.txt“; Response.WriteFile(Filename); string strFilename =“abc.txt"; Response.Buffer = true; Response.AddHeader("Content... "attachment; filename=" + strFilename); } catch (Exception ex) { Response.Write(ex.ToString()); } Response.End(); ...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Serialize (convert an object instance to an XML document): // Assuming obj is an instance of an object XmlSerializer ser = new XmlSerializer(obj.GetType()); System.Text.StringBuilder sb = new System.Text.StringBuilder(); System.IO.StringWriter writer = new System.IO.StringWriter(sb); ser.Serialize(writer, obj); XmlDocument doc = new XmlDocument(); doc.LoadXml(sb.ToString()); Deserialize (convert an XML document into an object instance): //Assuming doc is an XML document containing a serialized object...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Convert a string to a byte array string myString = "a test string";byte[] myByteArray = new byte[myString.Length];int i = 0;foreach(char c in InStr.ToCharArray()){ myByteArray [i] = (byte)c; i++;} Convert a byte array to a string System.Text.Encoding enc = System.Text.Encoding.ASCII;... myByteArray = enc.GetBytes("a text string);string myString = enc.GetString(myByteArray );...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

In computer networking, the Lightweight Directory Access Protocol, or LDAP ("ell-dap"), is a networking protocol for querying and modifying directory services running over TCP/IP. An LDAP directory usually follows the X.500 model: it is a tree of entries, each of which consists of a set of named attributes with values. While some services use a more complicated "forest" model, the vast majority use a simple starting point for their database organization. An LDAP directory often reflects various political,...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

You need to define which Textbox and Button you want to make them default. // add the attribute in your form tag <form id="form1" DefaultButton="Button1" DefaultFocus="TextBox2" runat="server">...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

//// Code Snippet <form id="form1" runat="server"> <div> <h3>To Exceute Client Click Event</h3> <asp:Button ID="Button1" OnClientClick='javascript:a... Just Clicked ME!")' OnClick="Button1_Click" Text="Click Me!" runat="server" /> </div> </form>...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

//Function to get the HTML name of the server control from the Client Id // Parameters: // clientId - Control.ClientId // serverId - Control.id private string GetHTMLNameById(string clientId, string serverId) { int pos = serverId.IndexOf('_'); string HTMLName = ""; if(pos >= 0) { pos = clientId.IndexOf(serverId); HTMLName = clientId.Remove(pos, serverId.Length); HTMLName = HTMLName.Replace('_', '$'); HTMLName += serverId; } else HTMLName = clientId.Replace('_', '$'); return HTMLName; }...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati