Trying to find ClientID of web form - Update

C

Chad Z. Hower aka Kudzu

Cor Ligthert said:
Juan does not know you. He tried to help you. I really don't know what
that has to do with that he is awarded as MVP or the way you find that
he threats you.

You need an answer and in the way you write now, you will probably
never get it from a newsgroup.

This is the last time I give you this advice any reply on this will
not be answered by me.

I dont think I posted this to this thread yet, if I did I apologize for the duplication. But I feel its very
appropriate:

http://www.hower.org/kudzu/dotnet/newsgroupguidelines.iwp


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Develop ASP.NET applications easier and in less time:
http://www.atozed.com/IntraWeb/
 
J

Juan T. Llibre

re:
I do believe that my reply was a bit too much of a personal attack. To use a metaphor, I
lunged when I should have parried. For that, I apologise about the "big mouth" and "ego"
statements.

Apology accepted.

It takes a good man to recognize a mistake and amend it.

I hope that others don't continue to post to this thread,
and that it dies peacefully, except for a possible answer
to your code problem.

Now, I'm *really* off to enjoy the last of today's sunshine.

;-)
 
T

Tom.PesterDELETETHISSS

If you remember my reply I was under the impression that you were a beginner
too (which you are not).
The only thing Juan did was point you to a tutorial cause he thought also
you didn't grasp the basics.
And there is no need to post +300 lines of code so we can repro. Only the
minimum code that shows the problem is what we want.

I read in another answer that we have to keep the discussions just technical.
Quit true. But if someone starts to get personal he has the right to defend
himself/react.
I do this actualy in place of Juan who better keeps out of this IMO. You
probably wont agree but I think an apology is in order.

Cheers,
Tom Pester
 
T

Tom.PesterDELETETHISSS

If you haven't solved the problem than I can try to run your code. The code
you posted has lots of dependancies (user controls,database,...)
Can you strip out these so we can repro the problem?

Let me know if you have any more questions..

Cheers,
Tom Pester
 
G

Guest

The code, <%= name.ClientID %>, won't work since TextBox.name is a child of a
some DataGrid child. It will not have the "name" id but the "ClientID".
However, I tried he following:

....
<%= (dg.FindControl("name") as TextBox).ClientID %>
....

This compiled and ran successfully. However, the ClientID did not appear in
the TextBox!

George
 
G

Guest

Perhaps, you can not get the ClientID inside of the DataGrid! I was able to
get the ClientiD after the DataGrid code but not inside of the the DataGrid
with the code:

<form id="Form1" method="post" runat="server">
<asp:DataGrid id=DataGrid1 style="Z-INDEX: 101; LEFT: 80px; POSITION:
absolute; TOP: 80px" runat="server" DataSource="<%# dataSet11 %>"
DataMember="users" AutoGenerateColumns="False">
<Columns>
<asp:BoundColumn DataField="name" SortExpression="name"
HeaderText="Name"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="ClientId">
<ItemTemplate>
<asp:TextBox id="TextBox1" runat="server"><%=
(DataGrid1.Items[0].FindControl("TextBox1") as TextBox).ClientID
%></asp:TextBox>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
</form>
<div><%= (DataGrid1.Items[0].FindControl("TextBox1") as TextBox).ClientID
%></div>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top