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.0Problems wih module button handlersProblems wih module button handlers
Previous
 
Next
New Post
8/28/2008 9:48 AM
 

Hi all

I've been playing around with creating my own custom mondule. Managed to create a nice blank one and then added a text box linkbutton and label.  To test it out i want the label to display what was in the text box and to clear the text box when the button is clicked.

Here is the code from my .ascx.cs file:

        protected void cmdSearch_Click(System.Object sender, System.EventArgs e)
        {
            search(txtBox.Text);    
        }

        private void search(String t)
        {
            Label1.Text = t;
            txtBox.Text = "";
        }

And this is the code for the components in my .ascx file:

<table width="140px" >
    <tr>
        <td>
            <asp:TextBox ID="txtBox" runat="server" Width="100%"></asp:TextBox>
        </td>      
    </tr>
    <tr>            
        <td align="right">
            <asp:linkbutton cssclass="CommandButton" ID="cmdSearch" runat="server"
                onClick="cmdSearch_Click" resourcekey="cmdSearch" CausesValidation="False" >
                Search
            </asp:linkbutton>
        </td>
    </tr>

</table>
L1: <asp:Label ID="Label1" runat="server"></asp:Label><br />

The problem is that the label does not set to what the txtBox is.  Any help would be great.

Si

 
New Post
8/28/2008 4:23 PM
 

Check the cache on the module settings (in general, but also the instance of the module) to make sure that it is set to 0.  A lot of the module starter kits seem to default the cache to 1200 and that has adverse effects (which you've seen) on the events and their ability to modify the DOM.


-- Jon Seeley
DotNetNuke Modules
Custom DotNetNuke and .NET Development
http://www.seeleyware.com
 
New Post
8/29/2008 3:58 AM
 

That solved my problems thanks.

 
New Post
8/29/2008 4:03 AM
 

Actually I take that back. Although it is doing less crazy stuff, the Label1 still does not set its text to that of the textbox

 
New Post
8/29/2008 9:39 AM
 

Is anything else going on behind the scenes to access that label?  Is the control wrapped in an UpdatePanel?  Does the module itself have "SupportsPartialRendering" enable?  Just trying to get some more info as to what is going on because it *sounds* like the caching issue, but since you've corrected that on the module instance AND the module definition (so new instances don't have the same problem down the road), it must be something else.

Additionally, maybe override OnPreRender and place a break point in there and debug to see if it shows the correct text right before it passes the html back to the browser... curious if something has changed it back by then.


-- Jon Seeley
DotNetNuke Modules
Custom DotNetNuke and .NET Development
http://www.seeleyware.com
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Problems wih module button handlersProblems wih module button handlers


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