Master page id's and rendered id's not matching up

Hi all,
 I've got a question... I'm pretty new to masterpages and have a simple one setup that looks like this.

<html xmlns="" >
<head runat="server">
    <title>Simple test</title>
    <form id="form1" runat="server">

however when I view the rendered source code the form line looks like this

<form name="aspnetForm" method="post" action="Default2.aspx" id="aspnetForm">

The same thing happens with any element that has an id="something" and runat="server". 
So my question is... is there a way to make the rendered code maintain the exact id I give it in the masterpage file? 


10/13/2006 8:27:14 PM 13714 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 53
Get it on Google Play
Get it on Apple App Store

Hello awbirkner, and welcome to the forums!

Read this topic up to second post from Mr. Brunone included, for an explanation of this "renaming":

Hope this helps. -LV

Julio P. Di Egidio
Software Analyst Programmer

(Peace X Love] = [++1)
10/15/2006 2:52:37 PM

Similar Artilces:

Send Message to user's Skype' id ,MSN' Id ,Yahoo'sID or Gmail ID.
hi, i m writing a application in which i have to notify the user to his Skype' id ,MSN' Id ,Yahoo'sID or Gmail ID. Please let me know the code usign C#   Thanks Tulika. hi, what do you want to do...i you wnat to send email's or do you want to send message to the messenger. thanks, rajiv hi i want to send IM messages to online and offline users not Email. Please help me....

How to set a Master Page's control's property through content page on a postback event?
Hi all, i m using a master page in my application. i have a panel on master page and a tab container with three tab panels on content page. i want to set/change  the visibility of the panel control when the tab is changed on the content page. By default the panel is invisible. To implement this i executed the following steps: 1. Set AutoPostBack of tacontainer to true 2. Wrote an event handler for ActiveTabIndexChanged event of the tab container 3 Wrote the following code on Tab changed event   if (TabContainerEmpPerformance.ActiveTabIndex == 1) { ...

Getting the recreated control's id's by viewstate?
Hi How can i get the automaticly created fileupload control's id's by stroring them in the viewstate? Is it possible? or any other way to get them on the run-time? I can store button's click number and then create dynamic controls on the run-time and if i look at the source code i can see the auto-created id's but when i click submit button to upload files in fileupload controls i get an NullReferenceException. I guess when i click submit button all the id's gone because the page posts back. So i write this to read id's and assign to my fileupload control, here is the code for it...

Treeview control: how do you access client id's for each node's checkbox?
Is it possible to get the client id's for the checkboxes that are created by a treeview control?  I need to create some javascript that will manipulate the checked status of the boxes on the client side, but can not figure out how to determine the client id's for each checkbox. I am in a situation where the tree can have 4 levels of nodes, and they are not populated unless the user expands a node.  This causes the client id's to constantly change as they are numerically numbered from the top down. Thanks, Billy You can get the ClientID of a checkbox inside javascript as follow...

Can't declare control's id in code behind page
I am not sore if any of you have experienced this problem. I have many webcontrols (textboxs, labels...) defined on aspx page. As a rule, you have to declare these controls in code behind page in order to access the propertities and methods. But I can only define some of them, but not all. For example, I have a textbox and label defined on the aspx page: <asp:textbox id="textbox1" runat="server"/> <asp:label id="label1" runat="server"/> On my code behind page: Imports System.Web.UI.WebControls Pbulic Class Page1 ...

Session ID's in the URL's
on my company site the session ID's are in a URL. For ex: http://localhost/test.asp?SessionID=05000010066C5DEEF-5045-43D5-9771-3ED6 what does that mean? does that mean that they are not using the client side cookies? and are passing the session in the URL.   That is exactly what it means   but I think this is not the format when the session is not using the cookies, in that case the session is in a format like http://localhost/(000000000000000000)form.aspx I think you are confusing two things here.  The localhost url you showed me appears to be an IIS 7 compati...

Naming a document element problems (trying to getElementByID() but the id's of the control are staring with _'s, which are not valid)
This page is an almost working implementation of viewing the HTML source, you'll see the two files are very close, with the difference being that the spans in the working on faulty version are named "_ctl0_Strategy0" instead of "Strategy0". That causes the getElementByID() javascript function to fail because id's staring with _'s are not valid). Since as far as I know, I can't control the control's naming prefix (via a C# command), how do I get around this?Mark You could just append the _ctl0_ in your JavaScript.Are you making this ...

Label control's text doesn't appear to be set (in the page which has a user control )when trying to update the text property in the FormView's ItemUpdated event
Hi There,I have a user control which hosts a formview control, gridview control and a label control. The grid view is usedto show rows in the DB and when clicked to edit each row, a form view opens up in edit mode with that particular row info. So I have nothing in the item template.My first question it mandatory to have smth in the itemtemplate of the form view.I have controls in edititemtemplate and insertitemtemplate.When a particular row is edited, I would like to show a status msg showing that the row has been updated.For this, I use the ItemUpdated event of the formview and try ...

Problem with Aps.Net 2.0 Master Page. ID's?
Hello,I am using a Master Page (MyMaster) with a Content Place Holder (ID="ContentPlaceHolder1").In MyPage.aspx I inserted an Asp:Panel (ID="Panel1") inside ContentPlaceHolder1.I am having problems using javascript functions with Panel1.For example, my javascript functions say they can't find an element with ID="Panel1" in my page.The same happens when I use CSS styles like "#Panel1 {...}".I believe the problem is that when MyPage.aspx runs Panel1's ID becomes "ctl00_ContentPlaceHolder1_Panel1".I saw the Panel1's ID in IE and Firefox "View Source" option.How can I solve this so I can use my ...

The DataSourceID of 'DetailsView1' must be the ID of a control of type IDataSource. A control with ID 'AccessDataSource1' could not be found.
 Anyone help with this? i have tried lots of ways to query this database and create the insert command, including making my own data sets and setting it up that way with my own custom SQL statement.....this did not work, so i though i would use VWD 2008's own tools to create the insert, i have been left with the following error: The DataSourceID of 'DetailsView1' must be the ID of a control of type IDataSource.  A control with ID 'AccessDataSource1' could not be found.   Everything looks ok to me. Code below:   <%@ Page Title="" Lan...

The DataSourceID of 'GridView1' must be the ID of a control of type IDataSource. A control with ID 'AccessDataSource' could not be found.
what i'm missing that i get the error: The DataSourceID of 'GridView1' must be the ID of a control of type IDataSource.  A control with ID 'AccessDataSource' could not be found.      <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="NewsId"                  EmptyDataText="There are no data records to display.">          &nb...

The DataSourceID of 'gv2' must be the ID of a control of type IDataSource. A control with ID 'objDs1' could not be found.
i have a radiobutton list and gridview and a object data source at runtime i'm changing the object data source by clicking on the radiobutton list selected index changed and here is my source code....          <asp:RadioButtonList runat="server" ID="rblView" RepeatDirection="Horizontal" RepeatLayout="Flow" AutoPostBack="True" OnSelectedIndexChanged="rblView_SelectedIndexChanged">                &nb...

Can I hide a user control's control from the hosting page's client script?
Okay, my previous question was not unswered and I guess you can't hide a control's panel with server code then show it with client code. Now this is what I try to do: on the hosting page's onload event, call a function to hide the user control's penal. Here is the deal: the user control was looped as many times as data required. So the penals will be name mypanel1, my panel2, etc... that is not even a problem if I know if the following is true: * Do all server codes finish running before the page get sent back to the client? Say the database gave me 5 penals, I can then determine how...

Master page's "Load" event is later than content page's ?
Example:1. Add a label to master page, set its "text" attribute to nothing. 2. In master page's page load event, assign "hello" to label1.text3. In content page's page load event: Response.write (   ctype(master.FindControl("label1"),label).text   )it will be nothing. 4. In content page,  add a button named button1, in button1's click event, copy the upper sentence, it will write "hello". so , master page's load event it later than content page's ?  If I need the result of master page's load ev...

Web resources about - Master page id's and rendered id's not matching up -

Resources last updated: 12/10/2015 9:32:11 PM