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.0Partial Rendering and DOM variable names questionPartial Rendering and DOM variable names question
Previous
 
Next
New Post
12/6/2007 9:12 AM
 

I am using partial rendering in a module I am developing 

Specifically I am using a DataGrid Control with a Formview conrol that gets dynamically updated and it works absolutely great.

However I need to do some client side javascript accessing the value some of the Formview control's values.

Typically I would use "document.GetElementByID("SomeVariable").value" but it appears that once partial rendering is involked these variable are handled by dnn created javascript.

My question is this:

Is there any way to access these values via client side javascript.

I search the forums here and couldn't find any info. Apologies in advance if I missed it.

Jeff

 
New Post
12/6/2007 12:09 PM
 

In ASP.NET if you are working with form elements that are contained inside of a container that supports the INamingContainer interface, the id's of the elements are modified by the .NET runtime.

The best way is to inject the object's Client Id into your javascript so that you have the proper id.

Each .NET control has a .ClientId property that you can use to get this fully formed id that you can use in JavaScript.


-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
12/7/2007 6:59 AM
 

Thanks for your help.

I am still having a problem however. I am not sure if it is because the item is within a formview or not but I keep getting veriable not declared. here are some exerpts of the code I am using if anyone can comment.

this line is wihtin the formview:

<asp:TextBox id="edtAddress" runat="server" Text='<%# Bind("Address") %>' Width="300px" BackColor="#FFE0C0" ReadOnly="True"></asp:TextBox>

here is my javascript exerpt:

function assigncode()

{

var theid =

'<%= edtAddress.UniqueID %>'

}

here is the error I get when I compile

Name 'edtAddress ' is not declared.

 

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Partial Rendering and DOM variable names questionPartial Rendering and DOM variable names question


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