DataGrid edited row and jScript

S

SergioT

Hi


I wanna to create a jscript function that sets the value of a textbox into a
datagrid, But the problem is How can I obtain the name of the textbox and
send it to my jscript function???? The textbox is in a TemplateColumn

The Idea is sent to the funcion the name of the control and then pass it to
another window and then this child window must set the values of the
control. But for simplicity the problem get reduced to obtain the name of
the textbox

This is the call of my fHelpItm jscript function, like you see I associate
the call to onclick event for the IMG control
==================
<EditItemTemplate>
Codigo<asp:TextBox id="txtCod" runat="server"
Width="87px"></asp:TextBox>
<IMG id="imgBuscar" onclick="javascript:fHelpItm('txtCod')" alt=""
src="../Images/iconBuscar.jpg">
</EditItemTemplate>
==================

the function simplified function is something like this
=======================
function fHelpItm(Codigo)
{
if confirm(' Do you wanna set a value for ' + Codigo)
document.forms[0].elements[Codigo].value ='Hello world' <<<HERE
is the problem
}
=====================
jscript says that the name of the control "txtCod" is not an object and that
is correct because the name sure is something like "Datagrid__ctl2_txtCod"
so the question is How can I obtain the correct name of the control


THANKSSSSSSS FOR YOUR HELP because this is getting me crazy!!!
bye
 
G

Guest

Hi!
You cannot get the TextBox using its ID (txtCod), because in datagrid you
have many items (here textboxes) with the same ID. But in one page you cannot
have two controls with the same ID. So, the framework places some prefix to
all the controls. That's why it is like "Datagrid__ctl2_txtCod". If you want
to have the textbox available on the client (in js function) you have to use
the ID with the prefix

Hope that helps!
Regards,
Kostadin Kostov
 
S

SergioT

HI Kostadin

I got the idea, but how can i get the "real name" of the control??? how can
I "build" the name ????

onclick="javascript:fHelpItm('txtCod')" alt=""
src="../Images/iconBuscar.jpg">
^
How I must right this part??---------- |

I guess that is the key right?? how to write the control name in order to
send to my jscript funcion


Thanks
Bye




Kostadin Kostov said:
Hi!
You cannot get the TextBox using its ID (txtCod), because in datagrid you
have many items (here textboxes) with the same ID. But in one page you
cannot
have two controls with the same ID. So, the framework places some prefix
to
all the controls. That's why it is like "Datagrid__ctl2_txtCod". If you
want
to have the textbox available on the client (in js function) you have to
use
the ID with the prefix

Hope that helps!
Regards,
Kostadin Kostov

SergioT said:
Hi


I wanna to create a jscript function that sets the value of a textbox
into a
datagrid, But the problem is How can I obtain the name of the textbox and
send it to my jscript function???? The textbox is in a TemplateColumn

The Idea is sent to the funcion the name of the control and then pass it
to
another window and then this child window must set the values of the
control. But for simplicity the problem get reduced to obtain the name of
the textbox

This is the call of my fHelpItm jscript function, like you see I
associate
the call to onclick event for the IMG control
==================
<EditItemTemplate>
Codigo<asp:TextBox id="txtCod" runat="server"
Width="87px"></asp:TextBox>
<IMG id="imgBuscar" onclick="javascript:fHelpItm('txtCod')"
alt=""
src="../Images/iconBuscar.jpg">
</EditItemTemplate>
==================

the function simplified function is something like this
=======================
function fHelpItm(Codigo)
{
if confirm(' Do you wanna set a value for ' + Codigo)
document.forms[0].elements[Codigo].value ='Hello world'
<<<HERE
is the problem
}
=====================
jscript says that the name of the control "txtCod" is not an object and
that
is correct because the name sure is something like
"Datagrid__ctl2_txtCod"
so the question is How can I obtain the correct name of the control


THANKSSSSSSS FOR YOUR HELP because this is getting me crazy!!!
bye
 
G

Guest

The only thing that appears in my mind is:
1. Handle the ItemDataBound event of the grid
2. Inside the handler construct the ID of the TextBox (Datagrid__ctl2_txtCod)
3. Get your button through e.Item.FindControl("myButton")
4. Add attribute - myButton.Attributes.Add("onclick",
fHelpItm('Datagrid__ctl2_txtCod'));

It's quite complicated, but I can't think of better way to achieve this.
Sorry!
Hope that helps!
Regards,
Kostadin Kostov

SergioT said:
HI Kostadin

I got the idea, but how can i get the "real name" of the control??? how can
I "build" the name ????

onclick="javascript:fHelpItm('txtCod')" alt=""
src="../Images/iconBuscar.jpg">
^
How I must right this part??---------- |

I guess that is the key right?? how to write the control name in order to
send to my jscript funcion


Thanks
Bye




Kostadin Kostov said:
Hi!
You cannot get the TextBox using its ID (txtCod), because in datagrid you
have many items (here textboxes) with the same ID. But in one page you
cannot
have two controls with the same ID. So, the framework places some prefix
to
all the controls. That's why it is like "Datagrid__ctl2_txtCod". If you
want
to have the textbox available on the client (in js function) you have to
use
the ID with the prefix

Hope that helps!
Regards,
Kostadin Kostov

SergioT said:
Hi


I wanna to create a jscript function that sets the value of a textbox
into a
datagrid, But the problem is How can I obtain the name of the textbox and
send it to my jscript function???? The textbox is in a TemplateColumn

The Idea is sent to the funcion the name of the control and then pass it
to
another window and then this child window must set the values of the
control. But for simplicity the problem get reduced to obtain the name of
the textbox

This is the call of my fHelpItm jscript function, like you see I
associate
the call to onclick event for the IMG control
==================
<EditItemTemplate>
Codigo<asp:TextBox id="txtCod" runat="server"
Width="87px"></asp:TextBox>
<IMG id="imgBuscar" onclick="javascript:fHelpItm('txtCod')"
alt=""
src="../Images/iconBuscar.jpg">
</EditItemTemplate>
==================

the function simplified function is something like this
=======================
function fHelpItm(Codigo)
{
if confirm(' Do you wanna set a value for ' + Codigo)
document.forms[0].elements[Codigo].value ='Hello world'
<<<HERE
is the problem
}
=====================
jscript says that the name of the control "txtCod" is not an object and
that
is correct because the name sure is something like
"Datagrid__ctl2_txtCod"
so the question is How can I obtain the correct name of the control


THANKSSSSSSS FOR YOUR HELP because this is getting me crazy!!!
bye
 
S

SergioT

Hi Kostadin

Thanks por the tip, I got only one dub how to do the second point of your
sugestion "construct the ID of the TextBox (Datagrid__ctl2_txtCod)" and one
more thing, I am using "TemplateColumns" so your first point is
aplicable???


Kostadin Kostov said:
The only thing that appears in my mind is:
1. Handle the ItemDataBound event of the grid
2. Inside the handler construct the ID of the TextBox
(Datagrid__ctl2_txtCod)
3. Get your button through e.Item.FindControl("myButton")
4. Add attribute - myButton.Attributes.Add("onclick",
fHelpItm('Datagrid__ctl2_txtCod'));

It's quite complicated, but I can't think of better way to achieve this.
Sorry!
Hope that helps!
Regards,
Kostadin Kostov

SergioT said:
HI Kostadin

I got the idea, but how can i get the "real name" of the control??? how
can
I "build" the name ????

onclick="javascript:fHelpItm('txtCod')" alt=""
src="../Images/iconBuscar.jpg">
^
How I must right this part??---------- |

I guess that is the key right?? how to write the control name in order to
send to my jscript funcion


Thanks
Bye




Kostadin Kostov said:
Hi!
You cannot get the TextBox using its ID (txtCod), because in datagrid
you
have many items (here textboxes) with the same ID. But in one page you
cannot
have two controls with the same ID. So, the framework places some
prefix
to
all the controls. That's why it is like "Datagrid__ctl2_txtCod". If you
want
to have the textbox available on the client (in js function) you have
to
use
the ID with the prefix

Hope that helps!
Regards,
Kostadin Kostov

:

Hi


I wanna to create a jscript function that sets the value of a textbox
into a
datagrid, But the problem is How can I obtain the name of the textbox
and
send it to my jscript function???? The textbox is in a TemplateColumn

The Idea is sent to the funcion the name of the control and then pass
it
to
another window and then this child window must set the values of the
control. But for simplicity the problem get reduced to obtain the name
of
the textbox

This is the call of my fHelpItm jscript function, like you see I
associate
the call to onclick event for the IMG control
==================
<EditItemTemplate>
Codigo<asp:TextBox id="txtCod" runat="server"
Width="87px"></asp:TextBox>
<IMG id="imgBuscar" onclick="javascript:fHelpItm('txtCod')"
alt=""
src="../Images/iconBuscar.jpg">
</EditItemTemplate>
==================

the function simplified function is something like this
=======================
function fHelpItm(Codigo)
{
if confirm(' Do you wanna set a value for ' + Codigo)
document.forms[0].elements[Codigo].value ='Hello world'
<<<HERE
is the problem
}
=====================
jscript says that the name of the control "txtCod" is not an object
and
that
is correct because the name sure is something like
"Datagrid__ctl2_txtCod"
so the question is How can I obtain the correct name of the control


THANKSSSSSSS FOR YOUR HELP because this is getting me crazy!!!
bye
 
G

Guest

I mean if the needed ID is Datagrid__ctl2_txtCod -
string id = "Datagrid__ctl" + e.Item.ItemIndex + "_txtCod";

And also - yes, it's applicable. It doesn't matter if you use TemplateColumn
(I almost always use them). The ItemDataBound event doesn't depend on the
column type that you use.

Hope that helps!
Regards,
Kostadin Kostov

SergioT said:
Hi Kostadin

Thanks por the tip, I got only one dub how to do the second point of your
sugestion "construct the ID of the TextBox (Datagrid__ctl2_txtCod)" and one
more thing, I am using "TemplateColumns" so your first point is
aplicable???


Kostadin Kostov said:
The only thing that appears in my mind is:
1. Handle the ItemDataBound event of the grid
2. Inside the handler construct the ID of the TextBox
(Datagrid__ctl2_txtCod)
3. Get your button through e.Item.FindControl("myButton")
4. Add attribute - myButton.Attributes.Add("onclick",
fHelpItm('Datagrid__ctl2_txtCod'));

It's quite complicated, but I can't think of better way to achieve this.
Sorry!
Hope that helps!
Regards,
Kostadin Kostov

SergioT said:
HI Kostadin

I got the idea, but how can i get the "real name" of the control??? how
can
I "build" the name ????

onclick="javascript:fHelpItm('txtCod')" alt=""
src="../Images/iconBuscar.jpg">
^
How I must right this part??---------- |

I guess that is the key right?? how to write the control name in order to
send to my jscript funcion


Thanks
Bye




message Hi!
You cannot get the TextBox using its ID (txtCod), because in datagrid
you
have many items (here textboxes) with the same ID. But in one page you
cannot
have two controls with the same ID. So, the framework places some
prefix
to
all the controls. That's why it is like "Datagrid__ctl2_txtCod". If you
want
to have the textbox available on the client (in js function) you have
to
use
the ID with the prefix

Hope that helps!
Regards,
Kostadin Kostov

:

Hi


I wanna to create a jscript function that sets the value of a textbox
into a
datagrid, But the problem is How can I obtain the name of the textbox
and
send it to my jscript function???? The textbox is in a TemplateColumn

The Idea is sent to the funcion the name of the control and then pass
it
to
another window and then this child window must set the values of the
control. But for simplicity the problem get reduced to obtain the name
of
the textbox

This is the call of my fHelpItm jscript function, like you see I
associate
the call to onclick event for the IMG control
==================
<EditItemTemplate>
Codigo<asp:TextBox id="txtCod" runat="server"
Width="87px"></asp:TextBox>
<IMG id="imgBuscar" onclick="javascript:fHelpItm('txtCod')"
alt=""
src="../Images/iconBuscar.jpg">
</EditItemTemplate>
==================

the function simplified function is something like this
=======================
function fHelpItm(Codigo)
{
if confirm(' Do you wanna set a value for ' + Codigo)
document.forms[0].elements[Codigo].value ='Hello world'
<<<HERE
is the problem
}
=====================
jscript says that the name of the control "txtCod" is not an object
and
that
is correct because the name sure is something like
"Datagrid__ctl2_txtCod"
so the question is How can I obtain the correct name of the control


THANKSSSSSSS FOR YOUR HELP because this is getting me crazy!!!
bye
 
S

SergioT

HELLO Kostadin

I DID IT!!!!!!!

Thanks a lot, your Idea was the the way!!! I put my code if you wanna take
a look THANKS again

Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGrid1.ItemDataBound

Dim img As New WebControls.Image()
img = e.Item.FindControl("imgBuscar")
If Not img Is Nothing Then
Dim c As Control
Dim s As String
For Each c In e.Item.Cells(1).Controls
If TypeOf c Is TextBox Then
s = c.ClientID
End If
Next
If s.Trim.Length > 0 Then
img.Attributes.Add("onclick", "fHelpItm('" & s & "', 'txtNomItem',
true);")
End If
End If
End Sub


Bye

Kostadin Kostov said:
I mean if the needed ID is Datagrid__ctl2_txtCod -
string id = "Datagrid__ctl" + e.Item.ItemIndex + "_txtCod";

And also - yes, it's applicable. It doesn't matter if you use
TemplateColumn
(I almost always use them). The ItemDataBound event doesn't depend on the
column type that you use.

Hope that helps!
Regards,
Kostadin Kostov

SergioT said:
Hi Kostadin

Thanks por the tip, I got only one dub how to do the second point of your
sugestion "construct the ID of the TextBox (Datagrid__ctl2_txtCod)" and
one
more thing, I am using "TemplateColumns" so your first point is
aplicable???


Kostadin Kostov said:
The only thing that appears in my mind is:
1. Handle the ItemDataBound event of the grid
2. Inside the handler construct the ID of the TextBox
(Datagrid__ctl2_txtCod)
3. Get your button through e.Item.FindControl("myButton")
4. Add attribute - myButton.Attributes.Add("onclick",
fHelpItm('Datagrid__ctl2_txtCod'));

It's quite complicated, but I can't think of better way to achieve
this.
Sorry!
Hope that helps!
Regards,
Kostadin Kostov

:

HI Kostadin

I got the idea, but how can i get the "real name" of the control???
how
can
I "build" the name ????

onclick="javascript:fHelpItm('txtCod')" alt=""
src="../Images/iconBuscar.jpg">
^
How I must right this part??---------- |

I guess that is the key right?? how to write the control name in order
to
send to my jscript funcion


Thanks
Bye




message Hi!
You cannot get the TextBox using its ID (txtCod), because in
datagrid
you
have many items (here textboxes) with the same ID. But in one page
you
cannot
have two controls with the same ID. So, the framework places some
prefix
to
all the controls. That's why it is like "Datagrid__ctl2_txtCod". If
you
want
to have the textbox available on the client (in js function) you
have
to
use
the ID with the prefix

Hope that helps!
Regards,
Kostadin Kostov

:

Hi


I wanna to create a jscript function that sets the value of a
textbox
into a
datagrid, But the problem is How can I obtain the name of the
textbox
and
send it to my jscript function???? The textbox is in a
TemplateColumn

The Idea is sent to the funcion the name of the control and then
pass
it
to
another window and then this child window must set the values of
the
control. But for simplicity the problem get reduced to obtain the
name
of
the textbox

This is the call of my fHelpItm jscript function, like you see I
associate
the call to onclick event for the IMG control
==================
<EditItemTemplate>
Codigo<asp:TextBox id="txtCod" runat="server"
Width="87px"></asp:TextBox>
<IMG id="imgBuscar"
onclick="javascript:fHelpItm('txtCod')"
alt=""
src="../Images/iconBuscar.jpg">
</EditItemTemplate>
==================

the function simplified function is something like this
=======================
function fHelpItm(Codigo)
{
if confirm(' Do you wanna set a value for ' + Codigo)
document.forms[0].elements[Codigo].value ='Hello world'
<<<HERE
is the problem
}
=====================
jscript says that the name of the control "txtCod" is not an object
and
that
is correct because the name sure is something like
"Datagrid__ctl2_txtCod"
so the question is How can I obtain the correct name of the control


THANKSSSSSSS FOR YOUR HELP because this is getting me crazy!!!
bye
 
G

Guest

I'm glad to help!
Just one recommendation... instead of this code:
For Each c In e.Item.Cells(1).Controls
If TypeOf c Is TextBox Then
s = c.ClientID
End If
Next

use this:
c = e.Item.FindControl("txtCod");
s = c.ClientID

Regards,
Kostadin Kostov

SergioT said:
HELLO Kostadin

I DID IT!!!!!!!

Thanks a lot, your Idea was the the way!!! I put my code if you wanna take
a look THANKS again

Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGrid1.ItemDataBound

Dim img As New WebControls.Image()
img = e.Item.FindControl("imgBuscar")
If Not img Is Nothing Then
Dim c As Control
Dim s As String
For Each c In e.Item.Cells(1).Controls
If TypeOf c Is TextBox Then
s = c.ClientID
End If
Next
If s.Trim.Length > 0 Then
img.Attributes.Add("onclick", "fHelpItm('" & s & "', 'txtNomItem',
true);")
End If
End If
End Sub


Bye

Kostadin Kostov said:
I mean if the needed ID is Datagrid__ctl2_txtCod -
string id = "Datagrid__ctl" + e.Item.ItemIndex + "_txtCod";

And also - yes, it's applicable. It doesn't matter if you use
TemplateColumn
(I almost always use them). The ItemDataBound event doesn't depend on the
column type that you use.

Hope that helps!
Regards,
Kostadin Kostov

SergioT said:
Hi Kostadin

Thanks por the tip, I got only one dub how to do the second point of your
sugestion "construct the ID of the TextBox (Datagrid__ctl2_txtCod)" and
one
more thing, I am using "TemplateColumns" so your first point is
aplicable???


message The only thing that appears in my mind is:
1. Handle the ItemDataBound event of the grid
2. Inside the handler construct the ID of the TextBox
(Datagrid__ctl2_txtCod)
3. Get your button through e.Item.FindControl("myButton")
4. Add attribute - myButton.Attributes.Add("onclick",
fHelpItm('Datagrid__ctl2_txtCod'));

It's quite complicated, but I can't think of better way to achieve
this.
Sorry!
Hope that helps!
Regards,
Kostadin Kostov

:

HI Kostadin

I got the idea, but how can i get the "real name" of the control???
how
can
I "build" the name ????

onclick="javascript:fHelpItm('txtCod')" alt=""
src="../Images/iconBuscar.jpg">
^
How I must right this part??---------- |

I guess that is the key right?? how to write the control name in order
to
send to my jscript funcion


Thanks
Bye




message Hi!
You cannot get the TextBox using its ID (txtCod), because in
datagrid
you
have many items (here textboxes) with the same ID. But in one page
you
cannot
have two controls with the same ID. So, the framework places some
prefix
to
all the controls. That's why it is like "Datagrid__ctl2_txtCod". If
you
want
to have the textbox available on the client (in js function) you
have
to
use
the ID with the prefix

Hope that helps!
Regards,
Kostadin Kostov

:

Hi


I wanna to create a jscript function that sets the value of a
textbox
into a
datagrid, But the problem is How can I obtain the name of the
textbox
and
send it to my jscript function???? The textbox is in a
TemplateColumn

The Idea is sent to the funcion the name of the control and then
pass
it
to
another window and then this child window must set the values of
the
control. But for simplicity the problem get reduced to obtain the
name
of
the textbox

This is the call of my fHelpItm jscript function, like you see I
associate
the call to onclick event for the IMG control
==================
<EditItemTemplate>
Codigo<asp:TextBox id="txtCod" runat="server"
Width="87px"></asp:TextBox>
<IMG id="imgBuscar"
onclick="javascript:fHelpItm('txtCod')"
alt=""
src="../Images/iconBuscar.jpg">
</EditItemTemplate>
==================

the function simplified function is something like this
=======================
function fHelpItm(Codigo)
{
if confirm(' Do you wanna set a value for ' + Codigo)
document.forms[0].elements[Codigo].value ='Hello world'
<<<HERE
is the problem
}
=====================
jscript says that the name of the control "txtCod" is not an object
and
that
is correct because the name sure is something like
"Datagrid__ctl2_txtCod"
so the question is How can I obtain the correct name of the control


THANKSSSSSSS FOR YOUR HELP because this is getting me crazy!!!
bye
 
S

SergioT

Hi Kostadin

I will do the chage thanks again

bye

Kostadin Kostov said:
I'm glad to help!
Just one recommendation... instead of this code:
For Each c In e.Item.Cells(1).Controls
If TypeOf c Is TextBox Then
s = c.ClientID
End If
Next

use this:
c = e.Item.FindControl("txtCod");
s = c.ClientID

Regards,
Kostadin Kostov

SergioT said:
HELLO Kostadin

I DID IT!!!!!!!

Thanks a lot, your Idea was the the way!!! I put my code if you wanna
take
a look THANKS again

Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGrid1.ItemDataBound

Dim img As New WebControls.Image()
img = e.Item.FindControl("imgBuscar")
If Not img Is Nothing Then
Dim c As Control
Dim s As String
For Each c In e.Item.Cells(1).Controls
If TypeOf c Is TextBox Then
s = c.ClientID
End If
Next
If s.Trim.Length > 0 Then
img.Attributes.Add("onclick", "fHelpItm('" & s & "',
'txtNomItem',
true);")
End If
End If
End Sub


Bye

Kostadin Kostov said:
I mean if the needed ID is Datagrid__ctl2_txtCod -
string id = "Datagrid__ctl" + e.Item.ItemIndex + "_txtCod";

And also - yes, it's applicable. It doesn't matter if you use
TemplateColumn
(I almost always use them). The ItemDataBound event doesn't depend on
the
column type that you use.

Hope that helps!
Regards,
Kostadin Kostov

:

Hi Kostadin

Thanks por the tip, I got only one dub how to do the second point of
your
sugestion "construct the ID of the TextBox (Datagrid__ctl2_txtCod)"
and
one
more thing, I am using "TemplateColumns" so your first point is
aplicable???


message The only thing that appears in my mind is:
1. Handle the ItemDataBound event of the grid
2. Inside the handler construct the ID of the TextBox
(Datagrid__ctl2_txtCod)
3. Get your button through e.Item.FindControl("myButton")
4. Add attribute - myButton.Attributes.Add("onclick",
fHelpItm('Datagrid__ctl2_txtCod'));

It's quite complicated, but I can't think of better way to achieve
this.
Sorry!
Hope that helps!
Regards,
Kostadin Kostov

:

HI Kostadin

I got the idea, but how can i get the "real name" of the control???
how
can
I "build" the name ????

onclick="javascript:fHelpItm('txtCod')" alt=""
src="../Images/iconBuscar.jpg">
^
How I must right this part??---------- |

I guess that is the key right?? how to write the control name in
order
to
send to my jscript funcion


Thanks
Bye




in
message Hi!
You cannot get the TextBox using its ID (txtCod), because in
datagrid
you
have many items (here textboxes) with the same ID. But in one
page
you
cannot
have two controls with the same ID. So, the framework places some
prefix
to
all the controls. That's why it is like "Datagrid__ctl2_txtCod".
If
you
want
to have the textbox available on the client (in js function) you
have
to
use
the ID with the prefix

Hope that helps!
Regards,
Kostadin Kostov

:

Hi


I wanna to create a jscript function that sets the value of a
textbox
into a
datagrid, But the problem is How can I obtain the name of the
textbox
and
send it to my jscript function???? The textbox is in a
TemplateColumn

The Idea is sent to the funcion the name of the control and then
pass
it
to
another window and then this child window must set the values of
the
control. But for simplicity the problem get reduced to obtain
the
name
of
the textbox

This is the call of my fHelpItm jscript function, like you see I
associate
the call to onclick event for the IMG control
==================
<EditItemTemplate>
Codigo<asp:TextBox id="txtCod" runat="server"
Width="87px"></asp:TextBox>
<IMG id="imgBuscar"
onclick="javascript:fHelpItm('txtCod')"
alt=""
src="../Images/iconBuscar.jpg">
</EditItemTemplate>
==================

the function simplified function is something like this
=======================
function fHelpItm(Codigo)
{
if confirm(' Do you wanna set a value for ' + Codigo)
document.forms[0].elements[Codigo].value ='Hello world'
<<<HERE
is the problem
}
=====================
jscript says that the name of the control "txtCod" is not an
object
and
that
is correct because the name sure is something like
"Datagrid__ctl2_txtCod"
so the question is How can I obtain the correct name of the
control


THANKSSSSSSS FOR YOUR HELP because this is getting me crazy!!!
bye
 
S

shamila thakur

hi..
i tried implementing the same code.
i get teh correct id of the textbox in the datagird.. but
img.Attributes.Add("onclick","GetAd('"+ s + "');");
at the above line i get an error..
Object reference null..
( i 'm using C#)
Please let me know .. i 'm struggling with this code for past 3 days
 

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,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top