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.0DNN 4.3.2 - a few (Dumb) questionsDNN 4.3.2 - a few (Dumb) questions
Previous
 
Next
New Post
7/12/2006 2:55 AM
 

Hi,

Firstly, please excuse me if the questions are a little dumb but I am new to DNN and to VB.NET.

1. Is the full code for the core available? I notice that there is no CODE BEHIND files for any of the modules, nor are any of the dataprovider modules found. Its not that I want to modify them but it would be useful to see how things are done.

2. How do I reference a field within a Forms View? I need to set a date field to todays date prior to an insert taking place. Now, I don't want to do it as the record is about to be inserted into the database. Rather, I want to initialise the field prior to editing. In the Forms View there is an INSERT button and when that is clicked I want to initialise the field but I don't know how to reference it in code. The field, EXPIRYDATE, is sitting in the inserttemplate of the forms view.

3. How do I get the Calendar to popup and then how do I take the selected value and populate the form view field? I can see that there is a Calendar object which is used in various parts. (But without access to the source I cannot see how it is used.)

Thanks

 

 
New Post
7/12/2006 3:07 AM
 

1: for 4.x source is only available for the core (you need the source package, not the starterkit, to see all source), All core modules are still developed in DNN 3.x, so source would be pointles in dnn 4.x, because it would be incompatible. To see the source of modules, you either have to switch to dnn 3.x and vs2003, or run the module upgrade wizard over the source packages of the modules (module sources can be downloaded  through the separate project pages)

2. if you have a texbox named txtDate in your form, you can just init the value of the textbox by doing txtDate.text = date.Today.tostring

3. the calender popup is called through a clientside javascript eventhandler. Put a hyperlink in your form, and name it cmdCalender for instance. In code behind, all you have to do is this:

cmdCalendar.NavigateUrl = Calendar.InvokePopupCal(txtDate)

Note that you can pass the textbox that should receive the selected date from the popup

Cheers,

Erik


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
7/12/2006 8:06 AM
 

Hi Erik,

Thanks for your reply - on the issue of referencing the text box I am obviously doing something wrong!

This is what I have in the ascx file: -

<tr>

<td style="height: 27px; width: 144px;">

Expiry Date :</td>

<td style="width: 40px; height: 27px">

<asp:TextBox ID="ExpiryDate" runat="server" Width="104px" OnTextChanged="ExpiryDate_TextChanged" Text='<%# Bind("ExpiryDate", "{0:d}") %>'></asp:TextBox>&nbsp;</td>

</tr>

Note that I have a FormView control with an InsertItemTemplate in which the above has been placed.

The top of the ascx file contains this: -

<%@ Control Language="VB" AutoEventWireup="false" Inherits="BM.Modules.BM_ThingsForSale.BM_ViewThingsForSale" CodeFile="BM_ViewThingsForSale.ascx.vb" Explicit="True" %>

<%@ Register Assembly="DotNetNuke" Namespace="DotNetNuke.UI.WebControls" TagPrefix="cc1" %>

<%@ Register Assembly="DotNetNuke.WebUtility" Namespace="DotNetNuke.UI.Utilities" TagPrefix="ccl" %>

<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx"%><br />

This is what I have in the .vb file: -

Protected Sub Add_MyListing_LinkButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Add_My_Listing_LinkButton.Click

Me.FormView1.Visible = True

ExpiryDate.Text = Date.Today.ToString

End Sub

This gives me an error: -Name "ExpiryDate" not declared.

I assume I am doing something really stupid (considering my lack of asp.net experience!!)

Thanks

 
New Post
7/14/2006 9:08 AM
 

is the ExpiryDate control in the vb file.. it should have something like this:

Protected WithEvents ExpiryDate As System.Web.UI.WebControls.TextBox

 

also, i dont quite understand

<%@ Register Assembly="DotNetNuke" Namespace="DotNetNuke.UI.WebControls" TagPrefix="cc1" %>

<%@ Register Assembly="DotNetNuke.WebUtility" Namespace="DotNetNuke.UI.Utilities" TagPrefix="ccl" %>

Why not just add

imports DotNetNuke

Imports DotNetNuke.WebUtility

in the code behind?

cheers,

Erik


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
7/14/2006 10:54 AM
 

Erik,

The reason that these -

<%@ Register Assembly="DotNetNuke" Namespace="DotNetNuke.UI.WebControls" TagPrefix="cc1" %>

<%@ Register Assembly="DotNetNuke.WebUtility" Namespace="DotNetNuke.UI.Utilities" TagPrefix="ccl" %>

appear is because I based the module on a tutorial "Creating a Super-fast and Super-Easy DotNetNuke Module" from ADefWebServer.com - so was copying the code verbatim.

I did try Protected WithEvents ExpiryDate As System.Web.UI.WebControls.TextBox but had some hassles - will try again though! What I did manage to do was use the following:-

ExpiryDate = Me.FormView1.FindControl("ExpiryDate")

and that worked but I don't think I like that - surely I should be able to resolve Expirydate directly?

Anyway, I am very proud to say that i have managed to get 2 basic modules working - one that includes editing and the other which simply displays data but allows various search options. Believe it or not but I did try DNN earlier in the year but opted for rainbow as I found the module creation quite laborious. However, upon revisting and using the above mentioned tutorial I am vary much swayed in favour of DNN.

Thanks for the help

Campbell

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0DNN 4.3.2 - a few (Dumb) questionsDNN 4.3.2 - a few (Dumb) questions


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