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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Javascript not working in ASCX page...Javascript not working in ASCX page...
Previous
 
Next
New Post
4/27/2009 7:22 AM
 

Hi,

Am creating a customize module in DNN. i have one parent.ASCX in that am calling other Child.Ascx. In child ascx am calling javascript for textbox lost focus which is not working.


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

        '    Try

        '        If DotNetNuke.Framework.AJAX.IsInstalled Then
        '            DotNetNuke.Framework.AJAX.RegisterScriptManager()
        '        End If

        '        txtBusLoanAmount.Attributes.Add("onblur", " RunMe()")

        '    Catch exc As Exception        'Module failed to load
        '        ProcessModuleLoadException(Me, exc)
        '    End Try

        'End Sub



My
 function RunMe()
    {
        Hello");
    }

 
New Post
4/27/2009 2:52 PM
 

Well, from the code that you've posted, there are a few problems that may or may not affect your actual site.

First, the Page_Load method is completely commented out, so that code looks like it will never run.

Secondly, the JavaScript that you posted is nowhere near valid JavaScript.  I'm going to guess that it's because the forums filtered it out, or there was an issue with HTML encoding it.  Is the JavaScript function supposed to be function RunMe(){ alert("Hello"); }?

When you look at the source of the page that is created, do you see the onblur attribute on the textbox? Do you see the JavaScript function as you expect? Can you call the JavaScript function from the FireBug console and see it give the response that you expect?

Hope that helps,


Brian Dukes
Engage Software
St. Louis, MO
866-907-4002
DNN partner specializing in custom, enterprise DNN development.
 
New Post
4/28/2009 12:45 AM
 

Hello Sir,

thx for reply.

For showing purpose only here i made commented otherwise Page_Loan code is without comment only. also javascript function is same as u written function RunMe(){ Hello"); }.

onblur attribute is not showing in page source even textbox name also not displaying in page sourse. I think that is because of custom control. Code which i am describing is in child ascx which i am calling in parent ascx.

Version i am using is 4.8.3. with normal website if am checking it is firing an event but with DNN it is not firing an event.

 

 
New Post
4/28/2009 11:22 AM
 

Are you saying that the textbox from the child control isn't showing at all?  If it does show, it won't have the same ID as it does in your markup.  ASP.NET mangles the IDs to ensure that they are unique.  But the ID that you provided should be part of the mangled ID that ends up in the page source.

If the textbox isn't showing up at all, it sounds like there is an issue with your parent control not correctly showing the child control.  If the textbox is there, then it looks like the issue is with getting the onblur attribute onto the textbox.  Which of those cases are we dealing with?

Hope I can help,


Brian Dukes
Engage Software
St. Louis, MO
866-907-4002
DNN partner specializing in custom, enterprise DNN development.
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Javascript not working in ASCX page...Javascript not working in ASCX page...


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