Posts

Showing posts from 2013

Alert Box within UpdatePanel

Problem is Java Script doesn't work in Update Panel Sample : On SQL condition div has to be disable and enable To Disable Dim strScript As String strScript = "$('#divVI').attr('disabled', 'disabled');" ScriptManager.RegisterStartupScript(UpdatePanel8,UpdatePanel8.GetType(), Guid.NewGuid().ToString(), "<script type='text/javascript'>" & strScript & " </script>", False) Note : This code is placed in page load. This will disable the div To Enable ScriptManager.RegisterStartupScript(UpdatePanel8, UpdatePanel8.GetType(), Guid.NewGuid().ToString(), " <script type='text/javascript'> $('#divVI').removeAttr('disabled');</script>", False) ScriptManager.RegisterStartupScript(UpdatePanel3, UpdatePanel3.GetType(), "DeleteMessage", "<script type='text/javascript'> alert('Individual Member Not Found!'); </script...

Provide Inline Scrolling in Div

Provide Inline Scrolling in Div Some External file are needed to work this out Source Web site :- http://jscrollpane.kelvinluck.com/ Download Files :-  http://jscrollpane.kelvinluck.com/index.html#download File Needed :- 1.jquery.jscrollpane.css       2.jquery.mousewheel.js                3.jquery.jscrollpane.min.js           4.jquery-1.9.1.js  {Any Latest file will work}     <script src="Script/jquery-1.9.1.js" type="text/javascript"></script>     <script src="Script/jquery.jscrollpane.min.js" type="text/javascript"></script>     <script src="Script/jquery.mousewheel.js" type="text/javascript"></script>     <script type="text/javascript">         $(document).ready(function ()         {             $('.divscroll').jScrollPa...

Link Image box to Page

When HyperLink is linked with Imagebox Border appears on IE. To remove this follow HTML below Note : border="0" in IE Border appear around Image Control                             < asp:hyperlink id="link" runat="server" NavigateUrl="default.aspx" >                                  < asp:Image ID="imgboxPanel1" runat="server"  Width="100px" Height="109px"  border="0" / >                              < asp:hyperlink >

Overlapping Div Side by Side

Image
Place overlapping Div Position:absolute; is main key for overlapping the Div on right side. To perform this it has to have container. less it will start floating on page Leftdiv has text which is suppose to overlap text on right div upto certain width Check for Working IIDAwards and zone page  <div id="leftdiv" style="height:500px; width:400px; float:left;">              <div id="textdiv" style="height:100px; width:450px; padding-top:20px; position:absolute;"                           class="staticpagetext" >                     Zone / Region refers to the city in which the Project is located, without any reference                     to the Participant's design office location.              </div>   ...

Ajax Combobox and SelectedIndex Issue

1.This is to handle Issue with Combobox When text is deleted direct Selected index doesn't Turn -1 2.Remove value which is not there is list after leave event of combobox.                 $(".ajaxComboBox :input[type=text]").each(function (i) {                     this.onblur = function () {                         var comboBox = $find(this.parentNode.parentNode.parentNode.parentNode.parentNode.id); // the combobox                         //alert(comboBox._element.id);                  // Return Control ID                         //alert(comboBox.get_textBoxControl().value);  // Return textbox value                   ...

Java Script not working with UpdatPanel

Sample : on some database condition div has to be disable and enable To Disable Dim strScript As String strScript = "$('#divVI').attr('disabled', 'disabled');" ScriptManager.RegisterStartupScript( UpdatePanel8 , UpdatePanel8 .GetType(), Guid.NewGuid().ToString(), "<script type='text/javascript'>" & strScript & " </script>", False) Note : This code is placed in page load. This will disable the div To Enable ScriptManager.RegisterStartupScript( UpdatePanel8, UpdatePanel8.GetType() , Guid.NewGuid().ToString(), " <script type='text/javascript'> $('#divVI').removeAttr('disabled');</script>", False) Note :- Instead of page for UIControl {i.e Page Control} use Updatepanel 

Ajax Combobox and UpdatePanel issue

Recently i was working on one of my project found funny thing happening with AJAX Combobox and updatepanel. Combobox had Autopostback set to True and On selecetedIndexChanged event on combobox it was to fetch some information from backend and show it on Label control on page. Label control was placed under updatepanel. and Async Trigger control was Combobox. While testing i found SelectedIndexChanged event was triggering only for the first time. Than after nothing was happening. This was happening due Combobox was not placed inside Updatepanel. that means both control has to be placed inside updatepanel Current Sample Ajax Combobox SelectedindexChanged event fires only once. when updatepanel is used.I had situtaion where i had to disable Control on change of combobox value.Source control and Destination Control both has to be placed under update panel. HTML  <asp:UpdatePanel ID="UpdatePanel2" runat="server" updatemode="conditional">      ...

Two level Menu with CSS And UL

Image
Two level menu with CSS and UL CSS .menu > li                      /*Main Header */ {      float: left;               /* To Make all Li Align Horizontally*/      margin-left:15px;          /*Have Padding between two Menu*/      list-style: none;     } .menu ul                        /* First Level */ {     display:none;               /*Hide the First level Menu */     position: absolute;         /*Relative Positioning for first level menu so that it appear in same line of header*/       list-style-type:none;       /*Remove bullets for list*/     list-style: none;           /*Remove bullets for list*/ ...

MultiLine TextBox MaxLength Problem in asp.net

If Textbox style is set to multiline, Control will not validate for maxlength value set in property. Multiple code has to be placed to handle this problem. 1.Use JavaScript to validate on each keystroke add this to HTML tag of textbox onKeyPress="return ValidateMultiLineTextboxMaxLength(this,250);"  JS for above Call function ValidateMultiLineTextboxMaxLength(txtbox,MaxLen)  {     if (txtbox.value.length >= (MaxLen-1))      {         return false;     }     return true; } 2. This Can happen in case when Text is pasted directly into textbox. as there won't be any keystroke. So validator has to be placed

How to use Javascript alert inside AJAX UpdatePanel

Java Script to show Messagebox from Codebehind, This code will not work when same is used with Updatepanel postback. Page. ClientScript.RegisterStartupScript(this.GetType(), "winPop", "alert('Update is successful') So in order to add javascript in update panel you need to register you client script to your script manager as shown below: ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), Guid.NewGuid().ToString(), "alert('Update is successful.');",True)

AJAX Masked Edit Extender Problem

Ajax Date Control using Masked Edit Extender  while Navigating from Date Control without entering date if you move out of control.  Control will validate for input date,This happen because for _ to enter the value in control. Solution :-  using jquery remove the _ is nothing is entered in control  $(document).ready(function () {             $("#<%= txtExpDate.ClientID %>").focusout(function () {                 if ($("#<%= txtExpDate.ClientID %>").val() == "__/__/__")                  {                     $("#<%= txtExpDate.ClientID %>").val("") ;                 }             });         });

Get Decimal and Value Seprated

SQL SERVER 2005 and above supports Function Call ParseName (), Function splits value when "." is used in given value Declare @Value as Numeric(13,3) SET @Value  = 1000.250 Select ParseName(@Value,2) Precision, ParseName(@Value,1) Scale Output Precision = 1000 Scale  = 250 Now we try same with String Value. Declare @Value as Varchar(500) SET @Value  = 'Switin.Kotian.Mumbai.switinkotian@gmail' Select ParseName(@Value,4) Name, ParseName(@Value,3) SurName,ParseName(@Value,2) Place, ParseName(@Value,1) Email Output Name :- Switin SurName : Kotian Place :  Mumbai Email : switinkotian@gmail After seeing this we can get value from string and break into columns. Counting starts from Highest value to lowest seprated by " . " .                           4      3          2                   1 ...

Viewstate vs Session

Image
Currently i am working on Web Application for which i had to perform some research on storing values in web application Which one is best to be used, As we all known HTTP Protocol is State less. Page can't hold variable [Value] on post back. So let see the working and difference Viewstate vs Session ViewState and Session are used to stored value Syntax  :  Viewstate (“ VariableName ”) = “ Value ”  :   Session (“ VariableName ”) =  “ Value ”                 1. ViewState are only accessible to page.                 i.e. Page1.aspx has Viewstate("Var1") Same will not be accessible in Page2.aspx.                        Instead once you call Viewstate("Var1") in page2.aspx it will create new Viewstate         ...

Part 2 C# Syntax for VB.net

Part 2 C# Syntax for VB.net 1).Any Collection value has to be accessed using index for example ArrayList MyArrayList[0].ToString(); All Index has to be accesses using Square brackets 2). Even Integer Variable Can't be used directly without assign values Int16 intValue; Int16 intloop; for (intLoop = 0; intLoop <= 5;intLoop ++) { intValue += intLoop; } This will give compile time error. for intValue is not assigned before using. Code has to be ----> Int16 intValue =0; 3.Intization of Value or Calls using constructor using System.Collections; ArrayList MyArrayList = new ArrayList(); DataEntry MyDEntry = new DataEntry(); 4.All methods will end with () Open And Close Brackets Example : intValue.ToString(); 5.Defining Properties string myStringValue; public string AccountName { get { return myStringValue; } set { mystringValue= value; } } WriteOnly Property public string my...

Part-1 C# Syntax For VB.net Developer

Part-1 C# Syntax For VB.net Developer             Started working on C# for a change. Found it to be more interesting and more challenging than conventional Basics Langauge. To get break from routine work i started developing sample  application on c#. I am enjoy this more and more. Felt some of the programming experience has to be shared.     While developing found there some of the syntax changed and way they are defined are also changed.     I have started series of C# Syntax for VB.net Developers which may help you people too.    To Concatenate String + sign has to be used VB.net uses & it has been replaced with + Sign in C# All Variable define must have default value string strSQL =""; int32 intNumber =0; Comment in C# Single Line Comment  // Muti Line Comment /* */ Define Subroutines private void DoSomething { } Define Fu...