|
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<script type="text/javascript">
$(document).ready(function () {
// Solution 1:
$('input[id$=TextBox1]').keyup(function () {
//write your code here
var txt = $('input[id$=TextBox1]').val();
$('input[id$=TextBox2]').val(txt);
});
// Solution 2:
var lbltext = $('#' + '<%=lbl.ClientID %>').text();
$('#' + '<%=TextBox4.ClientID %>').val(lbltext);
});
// Solution 3:
$(document).ready(function () {
alert($("[id$=_TextBox6]").attr("id"));
});
</script>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<p> Solution 1 :</p>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<p> Solution 2:</p>
<asp:Label ID="lbl" runat="server" Text="CopytoTextbox"></asp:Label>
<asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
<p> Solution 3 : get id of textbox6</p>
<asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
</asp:Content>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I do believe life is to help others ... So here i am .. in my spare time i learn new things of programming and try to help people with my knowledge .
I'm an energetic, self-motivated and hard-working Developer and Information Technology Professional with experience in projects, website design and development.
Visit My Technical Blog