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.0Click event not firedClick event not fired
Previous
 
Next
New Post
5/2/2008 1:29 AM
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

/>

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 2:17 AM
 

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
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
New Post
5/2/2008 2:48 AM
 

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 11:32 AM
 

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
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
New Post
5/3/2008 6:40 AM
 

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
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Click event not firedClick event not fired


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