help with referencing in c# 
Author Message
 help with referencing in c#

String js = "return alert('Do you really want to delete the record?');";

{

((System.Web.UI.WebControls.LinkButton)(this.LateFeeDetailGrid.Items[e.Item.
ItemIndex].Cells[0].Controls[0])).Attributes.Add("onclick",js);

Quote:
}

I want to replace the above line with the next block for more readability:
It gets Anchor element in a table in HTML page, which is actually Update
LinkButton in DataGrid as in Server-side. I am adding client side javascript
for confirmation before onUpdateCommand function is run.

The Question is:

the ABOVE line works and the BELOW block doesn't work. the reason is onclick
event handler is not written to HTML page.

What's wrong with the reference, lnkbtnUpdate?

I'd really appreciate it.

{

System.Web.UI.WebControls.LinkButton lnkbtnUpdate;

lnkbtnUpdate =
(System.Web.UI.WebControls.LinkButton)(this.LateFeeDetailGrid.Items[e.Item.I
temIndex].Cells[0].Controls[0]);

lnkbtnUpdate.Attributes.Add("onclick",js);

Quote:
}



Thu, 30 Dec 2004 20:35:05 GMT  
 help with referencing in c#
winglesslight,

    Are you sure that the js variable is being set correctly once you
changed your code?

--
               - Nicholas Paldino [.NET MVP]


Quote:
> String js = "return alert('Do you really want to delete the record?');";

> {

((System.Web.UI.WebControls.LinkButton)(this.LateFeeDetailGrid.Items[e.Item.
Quote:
> ItemIndex].Cells[0].Controls[0])).Attributes.Add("onclick",js);

> }

> I want to replace the above line with the next block for more readability:
> It gets Anchor element in a table in HTML page, which is actually Update
> LinkButton in DataGrid as in Server-side. I am adding client side
javascript
> for confirmation before onUpdateCommand function is run.

> The Question is:

> the ABOVE line works and the BELOW block doesn't work. the reason is
onclick
> event handler is not written to HTML page.

> What's wrong with the reference, lnkbtnUpdate?

> I'd really appreciate it.

> {

> System.Web.UI.WebControls.LinkButton lnkbtnUpdate;

> lnkbtnUpdate =

(System.Web.UI.WebControls.LinkButton)(this.LateFeeDetailGrid.Items[e.Item.I

- Show quoted text -

Quote:
> temIndex].Cells[0].Controls[0]);

> lnkbtnUpdate.Attributes.Add("onclick",js);

> }



Fri, 31 Dec 2004 23:22:21 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help, undefined reference to 'sqrt'

2. Help on reference book for c++

3. I'm new - need help - Symbol referencing errors

4. HELP: Cross reference tool wanted

5. Help : Cross reference/Call structure of C function calls

6. valarray help/online references

7. Concept Q: string reference type is not behave in reference using = sign

8. Web reference vs local reference

9. no reference ... *is* a reference

10. Obj A references Obj B which in turn references Obj A

11. MFC Reference Library should I by reference Lib

12. C++ References and C# references Question?

 

 
Powered by phpBB® Forum Software