Welcome Guest Search | Active Topics | Sign In | Register

dialog Options
Ria
Posted: Sunday, January 20, 2008 2:25:35 AM
Rank: Advanced Member
Groups: Member

Joined: 6/6/2007
Posts: 37
I have a dialog accept cancel in my page and the javascript:


function OnDialogCancel(e)
{if (window.confirm("Weet u zeker dat u dit record wilt verwijderen?"))
eo_Callback('CallbackPanel1', e);
// grid.deleteItem(e);
}


in the gridview I have a hyperlinkfield
<asp:HyperLinkField
Text="&lt;img Title = 'Verwijder deze regel' src='../Images/icon_delete.GIF' border='0' /&gt;" NavigateUrl ="javascript:OnDialogCancel(<% Eval("Id") %>)"/>

when I set the Id of the record instead of <% Eval("Id") %> it works.
how can I pass the value of the cell "Id" of the selected row to my callbackpanel1_execute
Code: Visual Basic.NET
eo_support
Posted: Sunday, January 20, 2008 5:52:49 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi Ria,

I would think the first step to troubleshoot this is to view your rendered page source and see what's the difference between Eval("Id") and directly setting the Id of the record.

The question is not related to our product at all though. So we won't be able provide step by step assistance to you. Thanks for understanding!

Thanks
Ria
Posted: Sunday, January 20, 2008 6:04:01 AM
Rank: Advanced Member
Groups: Member

Joined: 6/6/2007
Posts: 37
it would be nice when you had an example of passing variables with your very good controls.
Pray
eo_support
Posted: Sunday, January 20, 2008 6:23:03 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi Ria,

Thanks for the suggestion. From the callback point of view, there is one way to pass variables and we do have sample demonstrates that. What we won't be able to cover is how you come out that variable. There are numerous ways to do it. It's like a lamp needs to be plugged in, but you can't really expect the lamp manual to show you all the ways to wire the electric lines in your wall in order to have a plug there. It's just a bit out of out of the scope!

Thanks
Ria
Posted: Monday, January 21, 2008 7:07:59 AM
Rank: Advanced Member
Groups: Member

Joined: 6/6/2007
Posts: 37
which example should answer my problem?

I tried this one,

Protected Sub Gd1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles Gd1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim Zw_nr = e.Row.DataItem("Id").ToString
e.Row.Attributes.Add("onclick", "OnDialogCancel('" + Zw_nr + "')")
End If

End Sub

it works on every row, but now I want it to execute only with the delete button.

perhaps anyone else could show me an example?


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.