Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesJava script  in moduleJava script in module
Previous
 
Next
New Post
11/15/2010 3:05 PM
 
Hi,

I created my first DNN module and I have a few problems, concretely with

- on my ascx page I have DataGrid. I create in DataGrid 



<ItemTemplate>

<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"

CommandName="Edit" Text="Edit" meta:resourcekey="LinkButton1Resource2"></asp:LinkButton>

&nbsp;<asp:LinkButton ID="LinkButton2" runat="server"

CommandName="Delete" Text="Delete" meta:resourcekey="LinkButton2Resource2"></asp:LinkButton>

<asp:ConfirmButtonExtender ID="LinkButton2_ConfirmButtonExtender"

runat="server" ConfirmText="You are sure delete this file?" Enabled="True" TargetControlID="LinkButton2">

</asp:ConfirmButtonExtender>

</ItemTemplate>

In "normal" aspx page (after click on LinkButton) I can see Javascript window with this message, but on my aspx (with my module) page anything.
I read, that I must use like this

LinkButton2.Attributes.Add("onclick", " addValue()")

but LinButton2 isn't visible from my ascx.vb page

Thanks a lot for your help me

 
New Post
11/15/2010 4:10 PM
 
You can use the ItemDataBound event, then find the control from there and add the necessary code.

This way you are looping through all controls.

-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
11/16/2010 7:07 AM
 

 

Hi, thanks, I am add a new value to the function

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

GridView1.Attributes.Add("onclick", " return " + "confirm('" + DELETE + "')")

 

End Sub

DELETE is a readonly property with String value

I know, that isn't optimal resolution, but it  works. I tried to add new function



    Protected Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs) Handles GridView1.RowDeleting

        Dim grid As GridViewRow = GridView1.Rows(Me.GridView1.EditIndex)
        Dim lbt As LinkButton = CType(grid.Cells(3).FindControl("LinkButton2"), LinkButton)

       
        If lbt.GetType() Is GetType(LinkButton) Then
            lbt.Attributes.Add("onclick", " return " + "confirm('" + DELETE + "')")
           
        End If



    End Sub

but result is still false. In table I have columns
id, name, description, and template field with two buttons - Edit and Delete

Regards 

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesJava script  in moduleJava script in module


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out