How to change the name value of attributes of textbox control that added DataGrid control?

I created a DataGrid and added a textbox control as a template column and binded a DataSet as for DataSource in my webform1.aspx.

when you looked at the HTML format souce code of dataGrid after that have generated .

i found all the textbox named with datagrid,textbox and a random number.

The question is how can i rename it in running time?

i have tried some times in different event of datagrid  but i fail!


4/4/2006 12:39:34 AM 72751 articles. 3 followers. Follow

4 Replies

Similar Articles

[PageSpeed] 47

Of course the ID of the textbox will not be the same as you named it, because datagrid contains lots of rows and each row will have a textbox, so to keep the id unique, id is amended to include the datagrid and row number.

Why do you want to rename the ID's at runtime?  I don't think you can change the ID's at runtime.  Please explain what you want to do in detail, so maybe we will be able to give you a better solution.

4/4/2006 10:10:29 PM

thanks for your response.

i think of that it could not be change but it is able to add a  new one.

However, i only want to change the name not the id  attribute of textbox control .


4/5/2006 10:46:58 AM
You still haven't explained why do you need to change the name property of the TextBoxes.
4/5/2006 11:31:26 PM

It seems no such solution can achieve your goal.  We only can set the name property through javascirpt, however it is done by client.  So if the page is postedback, the name of the textbox still render its default.


4/12/2006 9:46:43 AM

Similar Artilces:

Wizard Control Adding $ To Control Names
I'm using the wizard control in .NET 2 beta which changes the name of the text boxes to [Name Of Wizard]$[Name Of Textbox].I have a javascript function client side that looks up postcode data on exiting a textbox but the $ or some other change in the name is screwing up the process. It works on a form where the text boxes aren't on the wizard.The event is set up by: PrimaryPostcode.Attributes.Add("onblur", "javascript:getpafdata('form1','ApplicationWizard$PrimaryPostcode','ApplicationWizard$PrimaryAddress1','ApplicationWizard$PrimaryAddress2','ApplicationWizard$PrimaryAddress3','Application...

using javascript getting value from textbox when edit button is clicked and both controls are present in gridview control
Hi All using javascript I want to get value  from textbox when edit button is clicked and both controls that is texbox and button are present in gridview control .Alok Hi aloksinha83, Please see this post: Thanks,Qin Dian TangMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and unmark them if they provide no help....

Custom Control within a Control Control
I am developing a custom controls that will render headers for different web sites. Within these controls, I want to place another custom control that will change the language. I created the language control and had it implement IPostBackDataHandler. This control works fine if I drag it on a new web form, but if I tell a header custom control to render it problems occur. The Language Selector custom control does not have a Page member anymore and the event handlers do not work. Does anyone have any experience with doing something similiar? Anyone have any suggestions? Thanks, ...

How do I control one control from another control?
I have a page page1.aspx which is within a master page. On page I have a table with two cells. Within each cell I have placed two controls (ascx) that I have developed. Now I'd like to be able to get these two controls to interact. One needs to update the other. One has some search criteria that the other one needs to update its gridview. One needs to make the other visible/not visible at certain times. Out of the box neither control can see each other at all. Is there a good article or someplace I can find some information on how to do this? Information Technolo...

How to place a DataGrid Control with in a DataGrid Control
Hi, I want to place a DataGrid control in a DataGrid control can any one plz tell me the procedure to place the control Thanks in Advance Krisamigo <!---<asp:DataGrid ID=dg_List runat=server><Columns><asp:TemplateColumn><ItemTemplate><asp:DataGrid ID=dg_List2 Runat=server></asp:DataGrid> </ItemTemplate> </asp:TemplateColumn> </Columns> </asp:DataGrid> ---> Hardik Joshi...

Control.Value and Control.SelectedItem.Value
Can someone explain to me the difference between say, Dropdownlist.SelectedItem.Value and Dropdownlist.SelectedValue?? Just curious, Thanks!Tim These are going to return the same thing. dropdownlist.selectedvalue is a shortcut to get the currently selected value in the dropdown. If that is all you want then you can just use that. If you want to access the currently selected item you can use dropdownlist.selecteditem and that return the item and you can then access any of the item's properties, including in this case the value property. If this post answered your question please r...

Controlling a variable numbers of controls dynamically added to a user control
 Ok, thinking caps on people, this has been causing me grief for a couple of days now. I have an .aspx page which contains various user controls housed in an Accordion control from the Ajax Toolkit and lots of UpdatePanels, these user controls all interact with each other through the parent page, e.g clicking buttons in one control effects visibility of other controls. Two of these controls contain just a series of ImageButtons. In the first of these controls the ImageButtons are generated in the page_load method and added to a panel using Panel.Controls.Add(ImageButtonCont...

Changing Value of Control Before Validator Control access it
Hi, I'm using Validator controls to validate inputs in the ASP .NET Server controls. Here, I want to change the values input by user before it is read by validator control for validation. e.g. I have TextBox1 and It can take only numbers between 400 to 800. So, I have placed a RangeValidator. But, I need to apply some change to the value. User has put input as "Six Hundred", I need to change this to 600 before it's passed onto validator control. Another example is I need to convert all characters to capital, or I need to remove all spaces or I ...

Adding controls to a Custom DataGrid Server Control
Edited by SomeNewKid. Please post code between <code> and </code> tags. I'm working on creating my own customized datagrid control. I've created a class which inherits "System.Web.UI.WebControls.DataGrid" and when I add my new datagrid control library to my project it seems to work nicely. Now I want to add some submit buttons to appear at the bottom of my datagrid control. How do I do this? Sorry, I'm a bit of a newbie at server controls. Here's what I've tried: Public Class UberDataGrid Inherits DataGrid Private MyButton As Button ...

when loading a previously created record on to form, some controls are missing values(controls are depended on values selected in other controls)
Hello - I have created a page for Editing records.  this page will open up a chosen record and allow user to edit the data.On the form, I have 3 drop down lists.   The second dropdown list should fill values depending on value chosen in first dropdown list.  The third dropdown list should show/fill values depending on value chosen in second dropdown list.So taking this into count, i have several records with various data.  When I open-up/load a record in Edit form, only the first dropdown list has a value selected that was the pre-existing va...

Web Custom Control
 I wrote this web custom control, and finally got all the embedded images and script files to embed, and display properly.But when I assign a name to the ID of the Control, the server changes the ID Name.So I have a control called txtMovieEmbed, and I assign the ID as txtMovieEmbed.But when the control renders, the name changes to ctl00_ContentPlaceHolder2_txtMovieEmbed txtMovieEmbed = New TextBox txtMovieEmbed.Width = 325 txtMovieEmbed.CssClass = "FormControl" txtMovieEmbed.ReadOnly = True txtMovieEmbed.Text = MovieEmbedCode txtMovieEmbed.ID = "txtMovieEmbed&qu...

Composite Control
I have created a modal popup composite control in hopes to reduce the amount of code on the in-line code to do modal popups.  Everything works just fine, except when I try to add user controls to the control.  I add a user control to the form control on OnInit, OnLoad, etc.  No matter what I do, the modal does not show up.  On this control, wire up the ModalPopupButtonClicked event and call the Show method to open the modal.  Anyways, can anyone tell me why this control won't work with user controls when I add them?    using System; ...

Changing values of control in Parent Page from user Control
Hi,I have a situation, which is driving me nuts. Any help, comment, feedback, would be really really appreciated.I am working on a web project where user controls in web forms are generated on the fly. I raise an event from the user control which handled in the parent page. Inside the implementation of this event I change the value of a label control on the parent page. when I debug through it, I can see the code getting executed but when the page is shown the change in value of the label control in parent page is not reflected. Interestingly, when I run the same code as a result of an event...

TextBox control not retaining values inside Wizard Control
I might be doing someting very silly. I have a wizard control. Everthing works fine on Wizardstep 1 . But on the step 2 I have some TextBoxes and a Button. When I click on the button a page postback happens and then there is nothing in the TextBox.Text property in the code behind.   Thanks I notice the status of this thread is “Resolved”, is it marked yourself? If so, please post your answer in order for others member learn from it.  We will greatly appreciate all your sharing.Hong-Gang ChenMicrosoft Online Community SupportPlease remember to mark the replies as answers if the...

Web resources about - How to change the name value of attributes of textbox control that added DataGrid control? -

Attribute - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Template:Attributes of God - Wikipedia, the free encyclopedia
Language: English Română Home Random Template:Attributes of God Part of a series on the Attributes of God Aseity Eternity Graciousness Holiness ...

Six Attributes Of The Perfect Facebook Page Administrator
So, here’s the thing: In many ways, hiring a Facebook page administrator is akin to hiring a poster child for your brand. This trusted manager ...

PANDA: Pose Aligned Networks for Deep Attribute Modeling - Facebook
We propose a method for inferring human attributes (such as gender, hair style, clothes style, expression, action) from images of people under ...

Facebook announces data partnerships to help advertisers target users by offline purchases and attributes ...
... will anonymously match data from consumer loyalty programs with user profiles in order to target ads by offline purchase habits and other attributes. ...

New Study Attributes Rapid Ageing Mainly To Environment Factors
New study explains why some people age faster than others.

Should I use the nofollow attribute on internal links? - YouTube
Regarding "nofollow" on internal links: Does it hurt? Does it help? I read different comments from Matt on this matter over time. What's the ...

Justin Trudeau attributes abortion stance to father's example
Liberal Leader Justin Trudeau says he is following an example set by his famous father when it comes to his position on election candidates and ...

Obama attributes western U.S. wildfires to climate change
... that has burned nearly 400 square miles in the north-central part of Washington state, along with blazes in other Western areas, can be attributed ...

Fifty Shades Of Grey Baby Births: Windsor Hospital Sees Spike In Births, Attribute Book
A significant spike in baby births at a hospital in Windsor, Ontario, has been attributed to the book Fifty Shades of Grey, which has become ...

Resources last updated: 12/17/2015 6:45:50 PM