master page
-
I'm writing java script in aspx page(this is inheriting master page). this code to get value of TextBox1.Text : document.write(document.getElementById('<%=TextBox1.ClientID%>').value); now my question is : How to assign this value in TextBox2.text ? like this not working TextBox2.Text = document.getElementById('<%=TextBox1.ClientID%>').value; thanks in advance Harry
You get the best out of others when you give the best of yourself.
-
I'm writing java script in aspx page(this is inheriting master page). this code to get value of TextBox1.Text : document.write(document.getElementById('<%=TextBox1.ClientID%>').value); now my question is : How to assign this value in TextBox2.text ? like this not working TextBox2.Text = document.getElementById('<%=TextBox1.ClientID%>').value; thanks in advance Harry
You get the best out of others when you give the best of yourself.
-
var clientId = '<%=ClientID%>'; document.getElementById(ClientId + '_TextBox2').value = document.getElementById(ClientId + '_TextBox1').value; try this way ...
Sathy
It's not working. document.getElementById(ClientId + '_TextBox2').value I think above code to get value not for assigning. I want to assign value in TextBox2. please tell me other way. thanks a lot to try to solve my problem.
You get the best out of others when you give the best of yourself.
-
It's not working. document.getElementById(ClientId + '_TextBox2').value I think above code to get value not for assigning. I want to assign value in TextBox2. please tell me other way. thanks a lot to try to solve my problem.
You get the best out of others when you give the best of yourself.
Declare these things in master page
var clientId = '<%=ClientID%>'; var contentId = '<%=ContentPlaceHolder1.ID %>'; var separator = '<%=IdSeparator%>';
Write this javascript code in your aspx page.document.getElementById(clientId +separator+ contentId + separator + 'TextBox2').value = document.getElementById(clientId +separator+ contentId + separator + 'TextBox1').value;
Sathy
-
I'm writing java script in aspx page(this is inheriting master page). this code to get value of TextBox1.Text : document.write(document.getElementById('<%=TextBox1.ClientID%>').value); now my question is : How to assign this value in TextBox2.text ? like this not working TextBox2.Text = document.getElementById('<%=TextBox1.ClientID%>').value; thanks in advance Harry
You get the best out of others when you give the best of yourself.
document.getElementById('<%=TextBox2.ClientID%>').value = document.getElementById('<%=TextBox1.ClientID%>').value;
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
document.getElementById('<%=TextBox2.ClientID%>').value = document.getElementById('<%=TextBox1.ClientID%>').value;
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
this is not working!!!
N a v a n e e t h wrote:
document.getElementById('<%=TextBox2.ClientID%>').value = document.getElementById('<%=TextBox1.ClientID%>').value;
but this works
document.getElementById('<%=TextBox2.UniqueID%>').value = document.getElementById('<%=TextBox1.UniqueID%>').value;
ClientID uses ClientIDSeparator property where masterpage uses IdSepartor property :~Sathy
-
Declare these things in master page
var clientId = '<%=ClientID%>'; var contentId = '<%=ContentPlaceHolder1.ID %>'; var separator = '<%=IdSeparator%>';
Write this javascript code in your aspx page.document.getElementById(clientId +separator+ contentId + separator + 'TextBox2').value = document.getElementById(clientId +separator+ contentId + separator + 'TextBox1').value;
Sathy
Now working properly Thank you so much. I have one problem more. function ChangePage(id) { // save the page clicked document.all.PageNumber.value = id; // call the __doPostBack function to post back the form and execute the //PageClick event __doPostBack('PageClick',''); } document.all.PageNumber.value = id; code is not working. How to assign id into document.all.PageNumber.value thanks in advance.
You get the best out of others when you give the best of yourself.
-
this is not working!!!
N a v a n e e t h wrote:
document.getElementById('<%=TextBox2.ClientID%>').value = document.getElementById('<%=TextBox1.ClientID%>').value;
but this works
document.getElementById('<%=TextBox2.UniqueID%>').value = document.getElementById('<%=TextBox1.UniqueID%>').value;
ClientID uses ClientIDSeparator property where masterpage uses IdSepartor property :~Sathy
Now working properly Thank you so much. I have one problem more. function ChangePage(id) { // save the page clicked document.all.PageNumber.value = id; // call the __doPostBack function to post back the form and execute the //PageClick event __doPostBack('PageClick',''); } document.all.PageNumber.value = id; code is not working. How to assign id into document.all.PageNumber.value thanks in advance.
You get the best out of others when you give the best of yourself.