Archive for the ‘.Net control Codes’ Category

Retrieve the fully URL without a QueryString

AFAIK, there

Convert the Request URL to an SSL/HTTPS link

For example to take the current request URL and converted it to a secure URL can be done like this: Secure Sockets Layer (SSL). UriBuilder build = new UriBuilder(Request.Url); build.Scheme = “https”; build.Port = -1; // don’t inject port Uri newUri = build.Uri; string newUrl = build.ToString();

Request Object of ASP .NET related to Paths

Request Object Here’s a list of the Path related properties on the Request object (and the Page object). Assume a path like http://www.avmendapara.com/wallpaper/admin/paths.aspx for the paths below where webstore is the name of the virtual. here property of request object given ApplicationPath : Returns the web root-relative logical path to the virtual root of this [...]

Download Data Services Update for .NET 3.5 SP1

Data Services Update for .NET 3.5 We

ASP.NET AJAX Rating Control using Star

Rating Ajax Control To Use Ajax Star rating Use this code. There Are many code available (1) Simple form binding <script type=”text/javascript”> var s1 = new Stars({ maxRating: 5, bindField: ‘myRating’, imagePath: ‘images/’, value: 4.5 }); </script> (2) JavaScript callback function <script type=”text/javascript”> function rating(val) { alert(‘You rated it ‘ + val + ‘ star(s)!’); [...]

Rename your all files located in one folder

rename files just use this code its rename all files which is located in your folder path string dest; string[] a = new string[5]; string b = Server.MapPath(“your folder path”); a = Directory.GetFiles(b); for (int i = 0; i < a.Length; i++) { FileInfo sos = new FileInfo(a[i].ToString()); //string c = a[i].ToString(); //source = a[i].ToString(); [...]

Renaming In .net With C#

Renaming Your files using c# just copy and paste your code. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO; namespace rhozetApplication3 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private int File_Delete(string Filepath) { FileInfo fi = new FileInfo(Filepath); if (fi.Exists) { [...]

Ajax CollapsiblePanelExtender in .net

Ajax CollapsiblePanelExtender in Asp.Net: There are the following easy steps to understand how to use Ajax CollapsiblePanelExtender control in Asp.Net. Step 1: Create new Ajax enabled website Step 2: Now go to solution explorer and right click on root directory and click on Add reference then add AjaxControlTollkit.dll. Step 3: Copy the following code and [...]

File Upload Control

//fileupload.aspx.cs file using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.IO; public partial class fileupload : System.Web.UI.Page { string destpath; public string filename; public static string[] name = new string[20]; public static int i = 0; protected void Page_Load(object sender, EventArgs e) [...]