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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...re:error ."Cannot use a leading .. to exit above the top directory". re:error ."Cannot use a leading .. to exit above the top directory".
Previous
 
Next
New Post
4/17/2008 6:09 AM
 

Hello All,

Can anybody please help why i am encountering this error."Cannot use a leading .. to exit above the top directory". I have a datagrid in my module , i have a link export to excel below the datagrid and on this link click i have written the following code

Protected Sub competencygridexport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles competencygridexport.Click
Response.Clear()
Response.AddHeader("content-disposition", "attachment;filename=MyFile.xls")
Response.Charset = ""
Response.ContentType = "application/excel"
Dim sw As New StringWriter
Dim htmlWrite As New HtmlTextWriter(sw)
lstCompetencies.RenderControl(htmlWrite)
Response.Write(sw.ToString())
Response.End()
End Sub

lstcompetencies is my datagrid.But when clicked on the link near the code "lstCompetencies.RenderControl(htmlWrite)" i am encountering the error "Cannot use a leading .. to exit above the top directoryplease" what should i do in order to solve this.please help its urgent.MyGrid contains images also.

Thanks,
Sandeep.M

 
New Post
4/17/2008 9:52 AM
 

I don't seem able to duplicate the issue I have the same code working in aword export module and not such issue it may be the images that you are including.


John Nicholson
 
New Post
4/17/2008 11:05 AM
 

Hi john,

Thanks for the reply.I Have found one thing.All my modules images use the images folder under the root directory.i have found the menu item images have ../../../ added to them by checking it using firebug.so i have hardcoded the url from http://localhost/sample4.7/images/image.jpg in order to test wether it was the problem.But the same error is being repeated.No other image paths has ...please see if you can help me.

Thanks,

Sandeep.M 

 
New Post
4/18/2008 5:24 AM
 

Hi All,

              I have turned off FRIENDLY URL'S option and then the error changes.It says 

              "Control 'dnn_ctr386_Competency_lstCompetencies_ctl03_lnkDeleteCompetency' of type 'ImageButton' must be placed inside a form tag with runat=server."

For your convinience i am pasting the code of the delete link in the grid and the backend i mean vb code

aspx code inside the column of the datagrid for delete column is as follows

<asp:TemplateColumn>

 

<ItemTemplate>

 

<asp:ImageButton ToolTip="Delete Competency" Runat="server" ID="lnkDeleteCompetency" OnCommand="lnkDeleteCompetency_Command" AlternateText="Delete File" ImageUrl="~/images/delete.gif" CommandName='<%# DataBinder.Eval(Container, "DataItem.CompetencyId")%>' />

 

</ItemTemplate>

 

</asp:TemplateColumn>And the vb code for this aspx file is as follows

 

 

 

lnkDeleteCompetency =

 

Protected Sub lstCompetencies_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles lstCompetencies.ItemDataBoundDim lnkDeleteCompetency As ImageButtonCType(e.Item.FindControl("lnkDeleteCompetency"), System.Web.UI.WebControls.ImageButton)If Not lnkDeleteCompetency Is Nothing Then

ClientAPI.AddButtonConfirm(lnkDeleteCompetency, Localization.GetString(

End If

"DeleteItem.Text", LocalResourceFile))

End Sub

 

 

UserCompetencyList = XWD.Modules.XWD_UserCompetencyManager.UserCompetencyController.XWD_CompetencyManager_GetUserwithCompetency(e.CommandName)

 

Protected Sub lnkDeleteCompetency_Command(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs)Dim UserCompetencyList As List(Of XWD.Modules.XWD_UserCompetencyManager.UserCompetencyInfo)If UserCompetencyList.Count > 0 Then

lblUserCompetencies.Visible =

True

pnlCompetencies.Visible =

True

 

Else

DeleteCompetency(e.CommandName)

pnlCompetencies.Visible =

True

 

End If

 

 

End Sub

 

 

Sub DeleteCompetency(ByVal CompetencyId As Integer)If Not Null.IsNull(CompetencyId) Then

 

objCompetencies.CompetencyId = CompetencyId

CompetencyController.XWD_CompetencyManager_Competency_Delete(objCompetencies)

displaycompetencies()

 

Dim objCompetencies As New CompetencyInfoEnd If

 

 

End Sub

 

 
New Post
4/18/2008 8:35 AM
 

Hi Sandeep,
Why don't you create a grid viewcontrol just for outputing to the document without anyof the dynamic control or links in it. 
So you'd generate a grind view.
Databind it to the same source as your other grid view and then render it as you did before.

 

John


John Nicholson
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...re:error ."Cannot use a leading .. to exit above the top directory". re:error ."Cannot use a leading .. to exit above the top directory".


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