473,669 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

trying to find the html id of a textbox in FooterTemplate at runtime

Here is my goal. I have a textbox in the FooterTemplate of a datagrid

<FooterTemplate >
<asp:TextBox ID="txtFooterTe xtBox" Runat="server"> </asp:TextBox>
</FooterTemplate>

When the html is created, in my case, it creates an html tag like this.

<input name="userLiabi lities:dgFinanc ials:_ctl9:txtF ooterTextBox"
type="text" id="userLiabili ties_dgFinancia ls__ctl9_txtFoo terTextBox" />

I need to get that id userLiabilities _dgFinancials__ ctl9_txtFooterT extBox AT
RUNTIME. How can I do that? I see can tell that the nomenclature consists
of the user control id, the id of the datagrid, the id of the textbox and
"__ctl9_" to assign uniqueness to the textbox (although because it is in the
footer, not in Item, txtFooterTextBo x is already guaranteed to be unique).

I need to some how find that so that I can dynamically create javascript
code. So perhaps in the event handler for ItemCreated,

if (e.Item.ItemTyp e == ListItemType.Fo oter)
{
//looking for the html unique ID
TextBox txtFooterTextBo x = (TextBox)e.Item .FindControl("t xtFooterTextBox ");

//here I need to get the ID
userLiabilities _dgFinancials__ ctl9_txtFooterT extBox
}


Apr 6 '06 #1
3 2027
txtFooterTextBo x.ClientID

Eliyahu

"David C" <pr********@yah oo.com> wrote in message
news:MW******** **********@torn ado.socal.rr.co m...
Here is my goal. I have a textbox in the FooterTemplate of a datagrid

<FooterTemplate >
<asp:TextBox ID="txtFooterTe xtBox" Runat="server"> </asp:TextBox>
</FooterTemplate>

When the html is created, in my case, it creates an html tag like this.

<input name="userLiabi lities:dgFinanc ials:_ctl9:txtF ooterTextBox"
type="text" id="userLiabili ties_dgFinancia ls__ctl9_txtFoo terTextBox" />

I need to get that id userLiabilities _dgFinancials__ ctl9_txtFooterT extBox
AT RUNTIME. How can I do that? I see can tell that the nomenclature
consists of the user control id, the id of the datagrid, the id of the
textbox and "__ctl9_" to assign uniqueness to the textbox (although
because it is in the footer, not in Item, txtFooterTextBo x is already
guaranteed to be unique).

I need to some how find that so that I can dynamically create javascript
code. So perhaps in the event handler for ItemCreated,

if (e.Item.ItemTyp e == ListItemType.Fo oter)
{
//looking for the html unique ID
TextBox txtFooterTextBo x =
(TextBox)e.Item .FindControl("t xtFooterTextBox ");

//here I need to get the ID
userLiabilities _dgFinancials__ ctl9_txtFooterT extBox
}

Apr 6 '06 #2
Tried it in the event handler for ItemCreated

The ClientID is txtFooterTextBo x, not
userLiabilities _dgFinancials__ ctl9_txtFooterT extBox . I should have said so
in my posting. I also tried UniqueID, but it's still set to
txtFooterTextBo x.

Thanks.
"Eliyahu Goldin" <re************ *@monarchmed.co m> wrote in message
news:uo******** ******@TK2MSFTN GP02.phx.gbl...
txtFooterTextBo x.ClientID

Eliyahu

"David C" <pr********@yah oo.com> wrote in message
news:MW******** **********@torn ado.socal.rr.co m...
Here is my goal. I have a textbox in the FooterTemplate of a datagrid

<FooterTemplate >
<asp:TextBox ID="txtFooterTe xtBox" Runat="server"> </asp:TextBox>
</FooterTemplate>

When the html is created, in my case, it creates an html tag like this.

<input name="userLiabi lities:dgFinanc ials:_ctl9:txtF ooterTextBox"
type="text" id="userLiabili ties_dgFinancia ls__ctl9_txtFoo terTextBox" />

I need to get that id userLiabilities _dgFinancials__ ctl9_txtFooterT extBox
AT RUNTIME. How can I do that? I see can tell that the nomenclature
consists of the user control id, the id of the datagrid, the id of the
textbox and "__ctl9_" to assign uniqueness to the textbox (although
because it is in the footer, not in Item, txtFooterTextBo x is already
guaranteed to be unique).

I need to some how find that so that I can dynamically create javascript
code. So perhaps in the event handler for ItemCreated,

if (e.Item.ItemTyp e == ListItemType.Fo oter)
{
//looking for the html unique ID
TextBox txtFooterTextBo x =
(TextBox)e.Item .FindControl("t xtFooterTextBox ");

//here I need to get the ID
userLiabilities _dgFinancials__ ctl9_txtFooterT extBox
}


Apr 6 '06 #3
I am not sure if ItemCreated event is good for you. Try to do the same in
ItemDataBound, or, maybe, in preRender event.

Property ClientID is designed specially for getting control id as it is set
on client.

Eliyahu

"David C" <pr********@yah oo.com> wrote in message
news:Tw******** ***********@tor nado.socal.rr.c om...
Tried it in the event handler for ItemCreated

The ClientID is txtFooterTextBo x, not
userLiabilities _dgFinancials__ ctl9_txtFooterT extBox . I should have said
so in my posting. I also tried UniqueID, but it's still set to
txtFooterTextBo x.

Thanks.
"Eliyahu Goldin" <re************ *@monarchmed.co m> wrote in message
news:uo******** ******@TK2MSFTN GP02.phx.gbl...
txtFooterTextBo x.ClientID

Eliyahu

"David C" <pr********@yah oo.com> wrote in message
news:MW******** **********@torn ado.socal.rr.co m...
Here is my goal. I have a textbox in the FooterTemplate of a datagrid

<FooterTemplate >
<asp:TextBox ID="txtFooterTe xtBox" Runat="server"> </asp:TextBox>
</FooterTemplate>

When the html is created, in my case, it creates an html tag like this.

<input name="userLiabi lities:dgFinanc ials:_ctl9:txtF ooterTextBox"
type="text" id="userLiabili ties_dgFinancia ls__ctl9_txtFoo terTextBox" />

I need to get that id
userLiabilities _dgFinancials__ ctl9_txtFooterT extBox AT RUNTIME. How
can I do that? I see can tell that the nomenclature consists of the
user control id, the id of the datagrid, the id of the textbox and
"__ctl9_" to assign uniqueness to the textbox (although because it is in
the footer, not in Item, txtFooterTextBo x is already guaranteed to be
unique).

I need to some how find that so that I can dynamically create javascript
code. So perhaps in the event handler for ItemCreated,

if (e.Item.ItemTyp e == ListItemType.Fo oter)
{
//looking for the html unique ID
TextBox txtFooterTextBo x =
(TextBox)e.Item .FindControl("t xtFooterTextBox ");

//here I need to get the ID
userLiabilities _dgFinancials__ ctl9_txtFooterT extBox
}



Apr 6 '06 #4

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

Similar topics

5
8760
by: tascien | last post by:
I am just wondering... can footertemplate hold data? b/c i want to show the sum of my Invoice in footer template. How can i do that? I could add the sum to the dataset like this: SumColumn = new DataColumn("SumColumn",Double,"Sum(ItemTotal)") ds.tables(0).columns.Add(SumColumn) if i do:
1
3822
by: MattB | last post by:
OK, never mind my last post. It was easy enough to refer to the table the repeater is bound to, but I made a big, incorrect assumption in that post. In my last post I thought I was successfully getting values from the textboxes in my repeater. It turns out I am not and I can't see what I'm doing wrong. I've had this problem before and just ended up taking a different route to avoid it. Now I REALLY need to figure out what I'm doing...
2
8725
by: Chris Fink | last post by:
This should be relatively simple but I am unable to find an asp:button tag in a datalist footer. I have tried it numerous ways including the FindControl method from the many events that the DataList exposes and the result is always null (I've determined the OnItemDataBound event will not find the footer controls). I understand that I have to navigate the datalist object tree, but I feel like it is a guessing game and am hesitant to do it...
9
5053
by: tshad | last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is filled? I have a bunch of DataGrids that get displayed nested inside a DataList. The datagrid looks like: ******************************************************************************* <asp:DataGrid visible="False" border=1
25
4055
by: Neo Geshel | last post by:
This works: <form> <asp:TextBox id="name" /> <%= name.ClientID %> </form> But this DOES NOT work: <form>
5
2799
by: Steven Berkovitz | last post by:
Hi there, I am having a problem where if i add an attribute to a control at runtime the rendered attribute is HTML encoded. For example, on a textbox: textBox.Attributes = "if(x && y) alert('hello');"; Gets rendered as:
2
335
by: shapper | last post by:
Hello, I created nested pages as follows: Base.master | ------ Global.master | ------ TwoColumns.master | ------ Default.aspx In Global.master.vb I added a textbox in runtime:
3
12247
by: John Kotuby | last post by:
Hi all... I am trying to do a simple thing and maybe am missing something elementary. I have created a Javascript function at the top of a page which is meant to enable editing of an HTML input textbox when the user makes a selection from the DropDownList control. Since there is no OnClick event I have tried using OnSelectedIndexChanged or OnTextChanged such as OnTextChanged ="ckCat()" with ckCat being the javascript function name. I...
0
4176
parshupooja
by: parshupooja | last post by:
Hey All, I have where I want to do some manipulations and show in other column but unable to find their values in RowDatabound event even though I have two records in gridview <asp:GridView ID="GridView1" runat="server" ShowFooter="True" AutoGenerateColumns="false" Width="700px"> <Columns> <asp:TemplateField HeaderText="Qty"> <EditItemTemplate> <asp:TextBox...
0
8383
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8895
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8809
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7407
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4386
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2797
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.