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.0AJAX inside of Formview template?AJAX inside of Formview template?
Previous
 
Next
New Post
9/17/2007 12:28 AM
 
Does anyone know how to get AJAX to work inside of a tag in a Formview control?

Here's the complication:

In order to get access to buttons in a Formview template, I've had to declare a PreRender for the FormView and disable/enable the buttons in there like this:

protected void FormView1_PreRender(Object sender, System.EventArgs e) {

if (this.FormView1.CurrentMode == FormViewMode.ReadOnly)
{
((LinkButton)this.FormView1.FindControl("ItemUpdateButton")).Visible = true;

}}

You can't just manipulate the button called ItemUpdateButton because it doesn't exist until the Formview template it's defined in is called. Then you have to use FindControl to search for the name of the button and cast it as LinkButton for example (if anyone has a better way I'd love to know)

So now I want to add an Ajax TabContainer (from the AJAX Toolkit) inside of a Formview so I can break up data entry and make things look nicer with tabs. You can't add the TabContainer outside of the Formview because then you can't define individual TabContainers inside... However the TabContainer doesn't exist until Formview loads and I can't wrap it in an UpdatePanel. If I try to call something like the following on a Page_Load, it won't compile because the TabContainer ID is not defined. This is the same problem with buttons which is why I have to use FindControl...

if (DotNetNuke.Framework.AJAX.IsInstalled())
{
DotNetNuke.Framework.AJAX.RegisterScriptManager();
DotNetNuke.Framework.AJAX.WrapUpdatePanelControl(EditItemTabContainer, true);
}

I'm trying to figure out how to wrap this in the FormView PreRender. I see the methods

Control DotNetNuke.Framework.AJAX.ContentTemplateContainerControl(objectUpdatePanel );
Control DotNetNuke.Framework.AJAX.CreateUpdatePanelControl();

but I can't figure out what they do. Is there an equivalent FindControl? I've tried doing a FindControl like I did with the buttons and typecasting as (Control) but with no luck. I'm finding an object of type AjaxControlToolkit.TabContainer when I call FindControl, but I can;t figure out what to cast it to.

any help would be greatly appreciated, I can send someone the full code if anyone's interested
 
New Post
9/19/2007 3:44 PM
 

this drove me nuts, so I did it a much easier way. instead of having a <FormView> with an embedded <ajaxtoolkit:TabContainer> i made an <ajaxtoolKit:TabContainer> where each tab has it's own <FormView>. It works well although sometimes i get some weirdness when switching tabs, the data doesn't alway refresh in the tabs.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0AJAX inside of Formview template?AJAX inside of Formview template?


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