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 ExtensionsModulesModulesERRoR in moduleERRoR in module
Previous
 
Next
New Post
12/18/2010 5:13 AM
 
I create module  for send Resume ,this module writeen with vb.net ,work goo and insert data in to  when login  with admin or host ,but when logout

cannot insert data in to database and page not post back  to server ,  all permission update and view  module for

everyone but  yet   cannot   insert data in database

,just insert data in  when login   with admin ,plz help ?

this module creat in DNN 05.03.01

 
New Post
12/18/2010 7:45 AM
 
it is for sure not a problem of the database access, but of module permissions. Are you able to debug, where the error is raised?

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
12/18/2010 8:09 AM
 
not problem db Because when login with admin i able to send data in to data base,

i send code to you & thank you for answer.



 
New Post
12/18/2010 8:14 AM
 
this code behin :





Imports DotNetNuke
Imports System.Web.UI
Imports System.Collections.Generic
Imports System.Reflection
Imports DotNetNuke.Security.PortalSecurity
Imports System.IO

Imports System.Net.Mail
Imports DotNetNuke.UI.Utilities



Namespace EOA.Modules.Resume

Partial Class ViewResume
Inherits Entities.Modules.PortalModuleBase

Protected picurl As System.Web.UI.HtmlControls.HtmlInputFile
Dim resumeCtrlr As New ResumeController
Private SelectedFileName As String = " "
Public Sub SendMailToAddress(ByVal strReciever As String, ByVal strSubject As String, ByVal strBody As String)
Try
If strReciever.Length <> 0 Then
Dim EMailer As System.Web.Mail.MailMessage
EMailer = New System.Web.Mail.MailMessage()
EMailer.From = "job@indonya.com"
EMailer.Body = strBody
'EMailer.BodyEncoding = System.Text.UTF8Encoding.UTF8;
EMailer.BodyFormat = System.Web.Mail.MailFormat.Html


EMailer.Subject = strSubject
EMailer.[To] = strReciever
System.Web.Mail.SmtpMail.Send(EMailer)
End If
Catch ex As Exception

End Try
End Sub
Private Function GetUniqFileName(ByVal ext As String) As String
Dim validExt As String = "..doc,.docx,.pdf,.jpg,.jpeg,.tif,.bmp,.rtf,.txt,.png"
If validExt.IndexOf(ext.ToLower) > 0 Then


Dim dt As New DateTime()
dt = DateTime.Now
Dim filename As String = Convert.ToString(dt.Year, 10) + Convert.ToString(dt.Month, 10) + Convert.ToString(dt.Day, 10) + Convert.ToString(dt.Hour, 10) + Convert.ToString(dt.Minute, 10) + Convert.ToString(dt.Second, 10) + Convert.ToString(dt.Millisecond, 10)
'filename=Convert.ToString(Convert.ToInt32(dt.ToString(),10),10);
filename = filename + ext
'idNews.Text=filename ;
SelectedFileName = filename
Return filename
End If
Return ""
End Function
Private Sub FtpImage()
Dim ctrl As Control = FormView1.FindControl("picurl")
picurl = DirectCast(ctrl, HtmlInputFile)

If picurl.PostedFile IsNot Nothing Then
Dim myFile As HttpPostedFile = picurl.PostedFile
Dim nFileLen As Integer = myFile.ContentLength
If nFileLen > 0 Then
Dim myData As Byte() = New Byte(nFileLen - 1) {}
myFile.InputStream.Read(myData, 0, nFileLen)
Dim strFilename As String = GetUniqFileName(Path.GetExtension(myFile.FileName))
If String.IsNullOrEmpty(strFilename) Then
AddItemButton.Text = "فایل رزومه شما غیر مجاز می باشد.نوع فایل رزومه فقط می تواند فایل میکروسافت ورد ، آکروبات یا تصویر باشد"
AddItemButton.Text = AddItemButton.Text + " *.doc,*.docx,*.pdf,*.jpg,*.jpeg,*.tif,*.bmp,*.rtf,*.txt,*.png"


'Throw New Exception("Invalid File Type...Only picture ,word doc, and PDF allowed")
Else

Dim _CurRootFolder As String = PortalSettings.HomeDirectoryMapPath
_CurRootFolder = _CurRootFolder + "resume\"

WriteToFile(_CurRootFolder + strFilename, myData)
End If


End If
End If
End Sub
Private Sub WriteToFile(ByVal strPath As String, ByRef Buffer As Byte())
Dim newFile As New FileStream(strPath, FileMode.Create)
newFile.Write(Buffer, 0, Buffer.Length)
newFile.Close()
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If HasEditPermissions(ModuleId, TabId) Then


' End If

Try
If Not PortalSecurity.IsInRole("Registered Users") AndAlso Not PortalSecurity.IsInRole("Administrators") Then

Me.FormView1.Visible = True
AddItemButton.Visible = False
Else
Me.FormView1.Visible = True
AddItemButton.Visible = False
End If
Catch exc As Exception

'Module failed to load

Exceptions.ProcessModuleLoadException(Me, exc)

End Try
End If

'If HasEditPermissions(ModuleId, TabId) Then

'Else
' AddItemButton.Enabled = False
' lblResume.Visible = Falsem

' AddItemButton.Text = "برای ارسال رزومه باید ابتدا در سایت ثبت نام کنید و یا از قسمت ورود وارد سایت شوید"
' End If
End Sub

Protected Sub SetModuleID(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs) Handles ResumeDataSource.Selecting
e.InputParameters("ModuleId") = ModuleId.ToString
End Sub

Protected Sub InsertingItem(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewInsertEventArgs) Handles FormView1.ItemInserting

Dim ctrl As Control = FormView1.FindControl("chkImg")
If (DirectCast(ctrl, CheckBox).Checked = True) Then
FtpImage()
e.Values.Item("FileName") = SelectedFileName
End If
Dim ctrl2 As Control = FormView1.FindControl("ddGender")
Dim sex As String = DirectCast(ctrl2, DropDownList).SelectedValue
e.Values.Item("gender") = sex
e.Values.Item("ModuleId") = ModuleId.ToString()
End Sub

Protected Sub AddItemButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles AddItemButton.Click

End Sub
Public Function getMailBody(ByVal resume1 As ResumeInfo) As String
Dim mailbody As String = "
" + "رزومه " + resume1.FullName + " ارسال شد" + "

"
Dim murl = ""
If (Not String.IsNullOrEmpty(resume1.FileName.Trim())) Then
murl = "http://www.indonya.com/portals/0/resume/" + resume1.FileName
mailbody = mailbody + "فایل رزومه

"
murl = " آدرس فایل رزومه: " + "

" + murl + ""
Else
murl = ""
mailbody = mailbody + "
" + "فایلی به عنوان رزومه ارسال نشده است "

End If
Dim jdate As New JalaliDate()
Return mailbody + murl + "

تاریخ ارسال: " + jdate.getDateJ() + "

"
End Function

Protected Sub InsertItemButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Try

If Not PortalSecurity.IsInRole("Registered Users") AndAlso Not PortalSecurity.IsInRole("Administrators") Then
Me.FormView1.Visible = False
AddItemButton.Visible = True
lblResume.Visible = False
'Dim ctrl As Control = FormView1.FindControl("CaptchaControl1")
'If (DirectCast(ctrl, PIP.Modules.WebControlCaptcha.CaptchaControl).isTypesCorrect()) Then
'SendMailToAddress("ali.norouzitafreshhi@yahoo.com", "رزومه جدیدی ارسال شد", "

رزومه جدیدی ارسال شد

")
' AddItemButton.Text = "رزومه شما با موفقیت ارسال شد پس از بررسی در اسرع وقت با شما تماس گرفته می شود.در صورت تمایل متوانید با کلیک برروی این لینک رزومه دیگری ارسال کنید"

Else
Me.FormView1.Visible = False
AddItemButton.Visible = True
lblResume.Visible = False

End If
'AddItemButton.Text = "کد وارد شده صحیح نیست باید کدی که در تصویر وجود دارد را وارد نمایید برای ارسال مجدد کلیک نمایید"

Catch exc As Exception

'Module failed to load

Exceptions.ProcessModuleLoadException(Me, exc)

End Try

End Sub

Protected Sub InsertCancelButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
If Not PortalSecurity.IsInRole("Registered Users") AndAlso Not PortalSecurity.IsInRole("Administrators") Then
Me.FormView1.Visible = False
Else
Me.FormView1.Visible = False
End If

End Sub

Protected Sub FormView1_ItemInserted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewInsertedEventArgs) Handles FormView1.ItemInserted
Dim resume1 As ResumeInfo = resumeCtrlr.GetLatestResume()
'MailHelper.SendMailMessage("ali.norouzitafreshi@yahoo.com", "info@indonya.com", " رزومه " + resume1.FullName + " ارسال شد ", getMailBody(resume1))
'MailHelper.SendMailMessage("Mailer@indonya.ir", "job@indonya.ir", " رزومه " + resume1.FullName + " Send", getMailBody(resume1))
End Sub


End Class

End Namespace

 
New Post
12/18/2010 1:53 PM
 
Please check in the module settings that output cacheing has been disabled and/or cache time set to 0.

Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesERRoR in moduleERRoR in module


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