Posts

Showing posts from June, 2013

How to access master page variable/property from the content page using C#

======== MASTER PAGE CODE BEHIND public string MasterPageVariable { get ; set ; } ========ASPX PAGE Source <% @ MasterType VirtualPath ="Maste Page Path" %> ========ASPX PAGE Code Behind protected void Page_Load( object sender, EventArgs e) { Master.MasterPageVariable = "This text is written from Content page." ; }

How to enable/disable dropdownlist through a checkbox selection using Jquery

============Head Tag Of Page================== < script src ="Scripts/jquery-1.4.1.js" type ="text/javascript" ></ script > <script type= "text/javascript" > $(document).ready( function () { $( "#chkbox" ).click( function () { if ( this . checked ) $( '#ddlcountry' ).attr( 'disabled' , 'disabled' ); else $( '#ddlcountry ' ).removeAttr( 'disabled' ); }); }); </ script > ==================Body Tage of Page================= < asp:CheckBox ID ="chkbox " runat ="server" Text ="Enable/Disable" /> < asp:DropDownList ID ="ddlcountry " runat ="server" > < asp:ListItem Text ="Select" Value ="India"/ > < asp:ListItem Text ="Opt...

Enable the file upload in ck-editor using C#

==========Add the following script in head tag================  <script type="text/javascript" language="javascript">     $(function () {         CKEDITOR.replace('<%=CKEditorControl1.ClientID %>', { filebrowserImageUploadUrl: 'Upload.ashx' });     });   </script> =========Create ASHX handler page for uploading================= <%@ WebHandler Language="C#" Class="Upload" %> using System; using System.Web; public class Upload : IHttpHandler {          public void ProcessRequest (HttpContext context) {         databaseprocess db = new databaseprocess();                 string appLink = "Web Site URL";         HttpPostedFile uploads = context.Request.Files["upload"];         string CKEditorFuncNum = context.Request["CKEditorFuncNum"];         string ...

Lightbox is a simple script used to overlay images Using Jquery

Image
Download the Running Example From Following URL http://lokeshdhakar.com/projects/lightbox2/

Replace Double Quote with Empty String using C#

string strvariable="Frame size 7" x 12" inches";  string result = strvariable.Replace("\"", ""); ==============Answer================= Frame size 7 x 12 inches

How to calculate Shipping by UPS using C#

First Create a class for UPS shipping "UPS.cs" using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml; using System.IO; using System.Net; namespace UPSShipping {     public class UPS     {         private string m_accessNumber;         private string m_userName;         private string m_password;         private string m_shipperNumber;         private string m_pickupType;         private string m_uri = "https://www.ups.com/ups.app/xml/Rate?";         #region Properties         public string AccessNumber         {             get { return m_accessNumber; }             set { m_accessNumber = value; }         }       ...