var name = 'india';
alert(name);
var name = $("#txtname").val();
alert(name);
var name = 'india';
alert(name);
var name = $("#txtname").val();
alert(name);
private string name = "John Doe";The visibility part is explained elsewhere in this tutorial, so let's concentrate on the variable part. We will jump straight to an example of actually using a couple of them:
using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { string firstName = "John"; string lastName = "Doe"; Console.WriteLine("Name: " + firstName + " " + lastName); Console.WriteLine("Please enter a new first name:"); firstName = Console.ReadLine(); Console.WriteLine("New name: " + firstName + " " + lastName); Console.ReadLine(); } } }Okay, a lot of this has already been explained, so we will jump directly to the interesting part. First of all, we declare a couple of variables of the string type. A string simply contains text, as you can see, since we give them a value straight away. Next, we output a line of text to the console, where we use the two variables. The string is made up by using the + characters to "collect" the different parts.
| Data Type | Initialser |
| int | 0 |
| char | '\0' |
| float | 0 |
| pointer | NULL |
<script type="text/javascript">
function Validation()
{
var txt_pan=document.getElementById('TextBox1').value;
var checkval=/^[A-Z]{5}\d{4}[A-Z]{1}$/;
if(checkval.test(txt_pan)== false)
{
alert('Please enter valid pan number');
return false;
}
}
</script>
In the Body Section of the .aspx page just bind the onClientclickevent of the button to the function above in the javascript to check the value of TextBox1
Take one texbox and button control on the page as shown below
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="javascript:return Validation();" />
enable or disable a form element using the.prop()method:// Disable #div1$( "#div1" ).prop( "disabled", true );// Enable #div1$( "#div").prop( "disabled", false );
<style type="text/css">
.normalRow
{
background-color:Red;
cursor:pointer;
.highlightRow
{
background-color:white;
cursor:pointer;
}
</style>
Step 2:-
Now call this css in code file like (this is for table row TR):
tr1.Attributes.Add("onmouseover", "this.className=('highlightRow');");
tr1.Attributes.Add("onmouseout", "this.className=('normalRow');");
Way2finder Technologies is a web design studio that offers corporate web design and custom web design. Our website designers offer cheap w...