Category Archives: Javascript

javascript value in server side variable

You can get variable from javascript and use it in code behind code in dotnet variable it means server side variable. Dim strMessage2 As String = “” Response.Write(“var str1 = prompt(‘Please Enter Password:’,”);”) strMessage2 = “document.write(str1);” Response.Write(strMessage2)

prevent you from having to POSTBACK to the server to access validator’s properties.

Source : http://forums.asp.net/p/839953/840084.aspx This example shows how to validate the LastName textbox but only if the FirstName textbox contains a value. The first part is simply HTML tags with the form controls, the second part is simply the code for “onblur” even in the Page_Load event handler. FIRST HTML ***************************************************************************** <%@ Page Language=”vb” AutoEventWireup=”false” Codebehind=”WebForm1.aspx.vb” [...]

Difference between RegisterClientScriptBlock and RegisterStartupScript

I will try to explain the difference between RegisterClientScriptBlock and RegisterStartupScript . I have experienced the difference while I was doing some stuffs yesterday. Here is what I was doing. I had a hidden field called txtHiddenField, an update button and some tabs in my page. I also have a javascript function called DisplayTab. function [...]

Date Related features…very user friendly

I recently came accross javascript date features and i find it very interesting. You can compare dates, set date on client side only and it increases user friendlyness..Few examples are here… Set date , by adding one day in mm/dd/yyyy format   var d = new Date(fromDate);d.setDate(d.getDate()+1);//alert((d.getMonth()+1)+”/”+d.getDate()+”/”+d.getYear()); ——————————oneMinute = 1000 * 60;oneHour = oneMinute * 60; oneDay = oneHour [...]

Follow

Get every new post delivered to your Inbox.