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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesModifying A Prebuilt ModuleModifying A Prebuilt Module's ASCX File...?
Previous
 
Next
New Post
6/29/2012 8:07 PM
 

I purchased a module on the DNN Store, and there is one feature that the module does not have that my client really needs. I thought that I could maybe "fudge" the feature by modifying the ASCX file...but I am having trouble.

The Modules was compiled in C#. The module has an ASP:Textbox that by default is blank. I use the module in a few places on the site, and the client want the Textbox's value to have a default value depending on which Module instance is being used. In some cases I need default text in the box, in others I need the box to be empty. I tried using INLINE CODE between the ASP:Textbox opening and closing tags. But I got a "Code blocks are not supported in this context" error. So then I removed the [runat="server"] portion of the ASP:Textbox, which then made the "default text" appear, but the ASP:Textbox itself no longer rendered. The company's tech support said that what I was looking to do *is* possible in the ASCX file, but they won't tell me how unless I pay them a "fee" (I work for a non-profit educational agency and getting PO's is beyond a pain, and for something like this they won't authorize it).

The code I currently have is:

<asp:textbox id="descriptionTextBox" width="800" height="250" textmode="MultiLine">
<% if (ModuleId == 719) { %>
This is my sample text.
It requires multiple lines.
<%} %>
</asp:textbox>

If the ModuleID = 719, the text appears like it should, otherwise it doesn't.  However, in all cases the "Textbox" itself is missing, it doesn't render.

Anyone have and ideas? Is what I am trying to do not possible through ASP Inline Coding?


Ben Santiago, MCP Certified & A+ Certified
Programmer Analyst
(SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS, Cognos ReportNet)
 
New Post
6/29/2012 9:05 PM
 

not tried this but i would recommend you dont inline within the textbox but rather elsewhere such as directly afterwards

<asp:textbox id="descriptionTextBox" width="800" height="250" textmode="MultiLine" />

<% if (ModuleId == 719)

 {

descriptionTextBox="This is my sample text.It requires multiple lines.";

}

%>

If that doesnt work its probable that the value is being set within an event - you could try defining it in an event yourself (e.g. http://www.codeproject.com/Articles/8... ), or else redefining the event inline and calling the codebehind base http://stackoverflow.com/questions/66...


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
6/29/2012 9:06 PM
 
whoops, you'll need to set the relevant property above i.e. descriptionTextBox.text

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
6/29/2012 9:07 PM
 
note: you can of course do this clientside (e.g. with jQuery) as the different module instances will have different names due to the naming container

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
7/2/2012 10:01 AM
 

Aha! Thank you! Redefining the Page_Load event using Inline code worked!

It's not a pretty patch, but it gets the job done for the time being. Thank you again for this idea. :-)


Ben Santiago, MCP Certified & A+ Certified
Programmer Analyst
(SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS, Cognos ReportNet)
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesModifying A Prebuilt ModuleModifying A Prebuilt Module's ASCX File...?


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