473,399 Members | 4,254 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Masterpage and postback

Hi all,
I am very new to ASP.net. As I was going through new features of asp.net, I came across Masterpage and I tried to use it. But when I tried to access a control from client side java script (for postback purpose), I found that the controls name was changed (appended with ctl00_ContentPlaceHolder1_). Is there any way to find out the client name of the control at runtime dynamically?

Thanks in advance

Nov 19 '05 #1
1 1061
Yes, you want to use Control.ClientID in your javascript. So perhaps this:

<script>
function DoSomething()
{
document.findElementById('<%= myServerLabel.ClientID %>').innherHtml = "something";
}
</script>

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi all,
I am very new to ASP.net. As I was going through new features of
asp.net, I came across Masterpage and I tried to use it. But when I
tried to access a control from client side java script (for postback
purpose), I found that the controls name was changed (appended with
ctl00 ContentPlaceHolder1 ). Is there any way to find out the client
name of the control at runtime dynamically?
Thanks in advance


Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Fuehner | last post by:
I have a masterpage define that contains a asp:menu control. My menu control has items that do not have a NavigateUrl assigned which causes them to postback on the current page... Now the issue...
2
by: Alexander Widera | last post by:
Hi, the situation is the following: There is this masterpage: <%@ Master Language="C#" AutoEventWireup="true" CodeFile="mymaster.master.cs" Inherits="mymaster" %> <%@ Register...
1
by: dawg1998 | last post by:
I have a page that creates dynamic textboxes based on the number of fields a user chooses to fill out. Basically, I am able to create the controls via this method (with other details): Dim...
3
by: Tom | last post by:
I have a VS.NET 2005 WEB application where I place all of my common controls (ie header, nav, footer) into a mater page template. Then all of my web forms inherit from the mater page template. All...
0
by: =?Utf-8?B?YmVycnkubW9yZ2Fu?= | last post by:
I want to bypass my content page's page_load event when the postback is caused by a control from my masterpage, doing something like this from my content page's page_load handler: Private Sub...
9
by: Jonathan Wood | last post by:
Does anyone know of any reason a button on a master page would have no effect? I have a complex HTML page that I'm converting to ASP.NET, and acknowledge I could have something odd that is...
4
by: faraz | last post by:
I have a javascript function that i want to call masterpage load method called. I cant add onLoad event of body or table in master page. I have put the call to script function in <form>, it...
10
by: goscottie | last post by:
Hi, Simply put, I have a control in MasterPage and another in content. When the control in content fires off post back, MasterPage also runs and returns post back. I want to control these where...
1
by: splendid9 | last post by:
Update panel and masterpage problem i hav a problem with updatepanel on the page. i have 2 update panels on the page which are wortking fine, but there is a display which is on masterpage used...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.