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.0DNN and JavascriptDNN and Javascript
Previous
 
Next
New Post
6/3/2006 4:52 PM
 

Hi !, I need to know the ModuleID of a DNN module I'm building, so that client-side Javascript code can access the various controls within. Eg. if ModId=370, to access a textbox with Id="my_text_box" in the view page:

document.getElementById("dnn_ctr370_View_ModuleName_my_textbox")

Any hints ?

 

 
New Post
6/5/2006 5:08 AM
 
Strange, I just did something like this in a temaplate for the Repository module!
http://www.dotnetnuke.com/Community/ForumsDotNetNuke/tabid/795/forumid/54/threadid/42148/scope/posts/Default.aspx

But I was working on the clientside so had to hardcode it - ok for my purpose.

If you are working on the server you can use this.ModuleID I believe (it's a property of the inherited class I think) - at work so can't check. You'll have to pass this into a RegisterScript method to dump it out in you Jscript. But looking at your question I am not sure you need the module ID - you need the ID of the controls - can you not just hardcode them?


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
6/5/2006 5:46 AM
 

You should be able to use <%=ModuleID%> in your javascript.


Cheers,
Philipp Becker, Peppertree Solutions
 
New Post
6/5/2006 10:18 AM
 

Every day it seems that I know what I want to do; I just don’t know how to do it.  Getting the client-side ID you mentioned was something I also recently had to tackle.

Here’s what I came up with, although I think the solution revealed above might be better than this (it would be simple and more direct). 
I used a function GetGridID to find my grid.
So for what it's worth here it is:

function GetGridID (psearch)
{
// find a grid by its ID, for example, “id=SMCGrid”
// the id of the grid is cryptic in DotNetNuke
// it will be something like "dnn_ctr366_SMC_central_SMCGrid"
// you must find its "id=" by using this function
// note that it returns to First occurrence (hopefully the one we want!)

var GridID
for (propertyName in document.all)
 {
  if (propertyName.indexOf(psearch)>0)
  {
  GridID=propertyName;
  return GridID;
  }
 }

Then I made use of the above function like so:

function startHighlight ()

 var GridID = GetGridID("SMCGrid")
}

window.onload = startHighlight;

In the example above I used "GetGridID" to find the ID of a grid a had named SMCGrid.  For the orginal question the code should be altered to be var GridID = GetGridID("my_text_box")


    - Doug Vogel     

 
New Post
3/12/2010 4:15 PM
 
This was very helpful! I've sort of addapted it, but I am having problems figuring out how to complete it. What I want to do is actually get the value of the checked item, and put it into a textbox so I can parse through it on a button click. Here's my code, Can you help me out?

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0DNN and JavascriptDNN and Javascript


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