Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

Affordable ASP.NET Hosting Service
  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

SmarterTools
Verndale
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Click event not fired
Previous Previous
 
Next Next
New Post 5/1/2008 11:29 PM
User is offline Edy
6 posts
10th Ranked


Click event not fired 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

/>

I'm just started to explore DNN 04.08.02. I'm using VS2005 and C#. Created the DNN web site (first one - HelloWorld) and all fine. Then I was thinking to add a button to that module and to chect if I can add some code behind. Itdidn't work and I'm not able to find why.

Here you can see the markup from my ViewHelloWorld.ascx:

<%

 

@ Control language="C#" Inherits="YourCompany.Modules.HelloWorld.ViewHelloWorld" CodeFile="ViewHelloWorld.ascx.cs" AutoEventWireup="true"

%>

<%

 

@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx"

%>

<

 

asp:datalist id="lstContent" datakeyfield="ItemID" runat="server" cellpadding="4" OnItemDataBound

="lstContent_ItemDataBound">

 

 

<itemtemplate

>

 

 

<table cellpadding="4" width

="100%">

 

 

<tr

>

 

 

<td valign="top" width="100%" align

="left">

 

 

<asp:HyperLink ID="HyperLink1" NavigateUrl='<%# EditUrl("ItemID",((int)DataBinder.Eval(Container.DataItem,"ItemID")).ToString()) %>' Visible="<%# IsEditable %>" runat="server"><asp:Image ID="Image1" Runat=server ImageUrl="~/images/edit.gif" AlternateText="Edit" Visible="<%# IsEditable%>" resourcekey="Edit"/></asp:hyperlink

>

 

 

<asp:Label ID="lblContent" runat="server" CssClass

="Normal"/>

 

 

</td

>

 

 

</tr

>

 

 

</table

>

 

 

</itemtemplate

>

</

 

asp:datalist

>

<

 

asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button"

and here the event in ViewHelloWorld.ascx.cs file:

 

{

Button1.Text =

}

Simple, when user click the button - change name of button to Hmm... Well it does nothing. More than this - I've put a breakpoint in line Button1.Text = "Hmmm..." and it doesn't seem to go there at all. Then I've put a breakpoint in first line of PageLoad event ViewHelloWorld.ascx.cs and it goes there only when I first run the site. Any subsequent press on Button doesn't make it go there even I can see in my IE it is doing a postback.

What's wrong? How to fix it?

protected void Button1_Click(object sender, EventArgs e)"Hmm..";

 
New Post 5/2/2008 12:17 AM
Online now... Chris Hammond
2953 posts
www.engagesoftware.com
5th Ranked








Re: Click event not fired 

Does it work when you're logged in as Host?

Check to make sure you don't have any Cache value in your module settings for this module.


Chris Hammond
Engage Software
St. Louis, MO
314.966.4000


The leading provider of DotNetNuke skinning, training and custom module development.
Official DotNetNuke® Training Provider
 
New Post 5/2/2008 12:48 AM
User is offline Edy
6 posts
10th Ranked


Re: Click event not fired 

 Chris Hammond wrote

Does it work when you're logged in as Host?

Check to make sure you don't have any Cache value in your module settings for this module.

Yes! It works when you are logged in as Host! Why only then????

 
New Post 5/2/2008 9:32 AM
Online now... Chris Hammond
2953 posts
www.engagesoftware.com
5th Ranked








Re: Click event not fired 

Because the Host gets at things without Cache turned on. Turn off the Cache on the module on the page, as well as disable the default cache value for the module on the Module Definitions page, that should correct your problems.


Chris Hammond
Engage Software
St. Louis, MO
314.966.4000


The leading provider of DotNetNuke skinning, training and custom module development.
Official DotNetNuke® Training Provider
 
New Post 5/3/2008 4:40 AM
User is offline Edy
6 posts
10th Ranked


Re: Click event not fired 

 Chris Hammond wrote

Because the Host gets at things without Cache turned on. Turn off the Cache on the module on the page, as well as disable the default cache value for the module on the Module Definitions page, that should correct your problems.

Thanks! I've set 0 for Cache in Module Settings and Module Definition section and now it works as expected.

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Click event not fired
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Cygnusoft Custom Software
Cygnusoft has been providing cutting-edge custom software solutions for 20 years. Cygnusoft is also a leading start-up incubator, helping our partners build successful new businesses.
www.cygnusoft.com
Digicon: DotNetNuke design and development
Digicon is based in Brisbane, Queensland, Australia
digicon.com.au
Live Visitor Tracking & Live Chat For DotNetNuke
Track your visitors in real time and add live chat for sales & support. Free Trial.
www.whoson.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP