.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

how to fix the path???!!!!

Posted By:      Posted Date: September 04, 2010    Points: 0   Category :ASP.Net
 
hi allmy website is in the root directory witch is "/www.lebmotor.com/web/content/" where no problem with the path in this page because I am using this Dim appPath As String = HttpContext.Current.Request.ApplicationPath Dim directory As String = appPath & "/upload/" & Left(TableName, 2) & "/"to get the path and it's working very well.but when i create a new sub folder and copy some pages from the root directory into the sub foldermy Images can't be displayed because the path has been change.this it the link from the page in the root directory:"http://www.lebmotor.com/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010 1:45:17 AM"and this is the link from the page in the sub folder:"http://www.lebmotor.com/ar/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010 1:45:17 AM"so how can I make the link in the sub folder like this:"http://www.lebmotor.com/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010 1:45:17 AM"please help


View Complete Post


More Related Resource Links

Virtual Path Problem

  

 I get the following error on last line below (working on remote host): 'E:\web\sfcascom\ls_admin/uploads/images/001.JPG' is not a valid virtual path,

Note that the slashes go in different directions

I've tried a number of things but nothing seems to work. Thanks-

 

Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Drawing.Imaging
Imports System.Web.UI.WebControls

Imports System.Drawing.Imaging.ImageCodecInfo
Partial Class Protected_imageupload
    Inherits System.Web.UI.Page
    Private Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
        ' Initialize variables
        Dim sSavePath As String
        Dim sThumbExtension As String
        Dim intThumbWidth As Integer
        Dim intThumbHeight As Integer
        Dim sFilename As String = ""
        ' Set constant values
        'sSavePath = "images/"
        sSavePath = Server.MapPath("~/") + "ls_admin/uploads/images/"



        sThumbExtension = "_thumb"
        intThumbWidth = 160
        intThumbHeight = 120

        ' If file field isn?t empty
        If FilUpload.PostedFile IsNot Nothing Then
            ' Check file size (mustn?t be 0)
            Dim myFile As Http

Creating a user friendly alias for the website path

  

 Hello mates,

I am hosting my ASP.NET application on a Windows 2003 Server.

To browse to my application one has to type the path :http://serverName/applicationName


I want users to only type  applicationName on the web adress area.I believe there is something to do with alias and CNAME on DNS records that can adress this.

Any help on how to go about doing this will be highly appreciated.


How to set SearchRoot Path in Active Directory in this scenario

  

How to set SearchRoot Path in Active Directory in this scenario:

Functionality: We have scenario that 1<sup>st</sup> hit one LDAP server with some 'fixed user name' &' fixed password ' and filter data with specific User name(which given by user) getting 'User dn'.

After that we hit Next LDAP server based on the 'User dn' getting from 1<sup>st</sup> server.

(So, in my case 1<sup>st</sup> LDAP server works like as Load balancing server but functionalitywise it is different)

|-------------------------------------------------------------------------------|
|                                         

Split URL/Path in Classic AND .net 2.0

  

I need to be able to get the different parts of the URI (and convert from/to relative page paths) in BOTH classic ASP and .Net 2.0 (VB).

For example, if I have "http://sitename.company.com/index.aspx?sec=fred&pag=dis&mode=1" OR "/index.aspx?sec=fred&pag=dis&mode=1"

IS there a function where I can pass in either string (assuming I'm on sitename.company.com) and get back an array with:

(0): sitename.company.com
(1): index.aspx
(2): sec=fred&pag=dis&mode=1

(Or, alternately, three different functions that would return the three parts?)

TIA,


Path not valid.

  

hi

im trying to save a file, filename as current date and time.it will give an error.

any ideas.

here is my code

string datetime=DateTime.Now.ToString();

if (GridviewtoCSV("~/Admin/doc/Reports/" + batchid.ToString() + datetime + ".csv", transactiongrid) && GridviewtoPDF("~/Admin/doc/Reports/" + batchid.ToString() + datetime + ".pdf", transactiongrid))
                {


Scale Out: Distributed Caching On The Path To Scalability

  

Developers frequently face issues related to scalability bottlenecks when they have applications that need to handle a lot of load. This article describes the role of a distributed cache in building scalable applications.

Iqbal Khan

MSDN Magazine July 2009


Foundations: Render Text On A Path With WPF

  

With Windows Presentation Foundation (WPF) you can lay out text on a path, then animate the individual points defining the path and watch the characters bounce around in response.

Charles Petzold

MSDN Magazine December 2008


asp.net path issue

  

Hi all,
I am working on an application where many hyperlinks ( <a hrefs> like <a href=/web/index.html ) are used. The website is working fine on live server. The previous link goes to wwww.mysite.com/web/index.html which fine. But when i setup the website on my local machine. The above link goes to
http://localhost/web/index.html which is not correct path and I get resource not found error. If i correct the path in browser like this :
http://localhost/myvirtu

Path 'OPTIONS' is forbidden

  
Don't know exactly where this goes, so I shall post here.

I'm getting an error when I link to a Word Document.  My Hyperlink control simply opens up the doc in a new window.  The error message is "Path to 'OPTIONS' is forbidden."

The Word document actually comes up and is displayed, but my error handling sends me about 5 emails each time a document is viewed.  I'm using MS Application Blocks, and this is the error I'm getting:


1) Exception Information

*********************************************

Exception Type: System.Web.HttpException

ErrorCode: -2147467259

Message: Path 'OPTIONS' is forbidden.

Data: System.Collections.ListDictionaryInternal

TargetSite: Void ProcessRequest(System.Web.HttpContext)

HelpLink: NULL

Source: System.Web

StackTrace Information

*********************************************

at System.Web.HttpMethodNotAllowedHandler.ProcessRequest(HttpContext context)

at System.Web.Http

File Attachments from info-path forms to Sharepoint document library

  

Hi Experts,

How to upload file attachements from info-path forms to Sharepoint document library?

I need to add attachement from local-PC/Any User to Sharepoint Document Library.

 

Any help please?? Appreciated

 

Regards,

Kumar


Info Path form when modified by using UTF-8 encoding having issues with existing 'iso-8859-1' char

  

Hi,

I am modifying the infio path form 2007 from my state machine workflow to constantly update the status fields in the request form.

below is the method i created for the same..

private void updateInfoPathRequestForm(string xpathNode, string nodeValue)
        {
            SPUserToken token = workflowProperties.Web.CurrentUser.UserToken;
            using (SPSite _site = new SPSite(workflowProperties.Site.ID, token))
            {
                _site.AllowUnsafeUpdates = true;
                using (SPWeb _web = _site.OpenWeb(workflowProperties.Web.ID))
                {
                    SPListItem item = _web.Lists[workflowProperties.List.ID].Items[workflowProperties.Item.UniqueId];
                 &nb

FileUpload.SaveAs is configured to require a rooted path. but "http:// --- is not a rooted path

  

Hi Friends

when i am uploading image to http://filepath i got the 

The FileUpload.SaveAs Method is configured to require a rooted path but http:// filepath is not a rooted path

my code is as follows

If (Fileupload.HasFile)

 Then

Dim filepath As String = http://filepath/

FileUpload.SaveAs(filepath & String.Format("datafield_{0}_b.jpg", textbox.Text))

End If

Please help me

Thanks

Rama 

 


How do I find the file path from a namespace.class name?

  

I'm programatically looking ito a .aspx file and getting the file class name declared in its CodeBehind. For example, when analyzing myFile.aspx I read in its Page Directive and found its CodeBehind equals "myApplication\myPage.aspx.vb". Then I use the code below:

 

Dim Assm As System.Reflection.Assembly = System.Reflection.Assembly.LoadFrom("myApplication\bin\myApplication.dll")
Dim ClassType As Type = Assm.GetType("myApplication\myPage.aspx.vb")
    
' myBaseType = "myApplication.Forms.BasePage"
Dim myBaseType As System.Type = ClassType.BaseType

 

Now I want to read the BaseFile (class = myApplication.Forms.BasePage). However, to read in this file, I need I need to get its full path instead of its namespace.class hiearchy. In this case, the BasePage is wrapped in a different namespace declaration thus I cannot just change the '.' to '\' in order to get the path.

How can I get the path of BasePage so I can read it? Thank you - Frank


HTTP verb POST used to access path ' ' is not allowed

  

Hi, 

Im new to ASP.NET MVC 2.

Im trying to call a controller method using Jquery $.ajax().


---- inside Controllers/ServiceController

public string GetString()

{

        return "My First MVC Ajax Testing";

}

---- javascript code calling the controller method

    var serviceUrl = '~/Controllers/ServiceController/GetString';

    var jsonData = '';


    $.ajax({

        url: serviceUrl,

        type: 'POST',

        data: JSON.stringify(jsonData),

        dataType: 'json',

        beforeSend: function (XMLHttpRequest) {

            onBeforeSend(XMLHttpRequest);

        },

        success: function (data, textStatus, XMLHttpRequest) {

            onSuccess(data, textStatus, XMLHttpRequest);

        },

        error: function (XMLHttpRequest, textStatus) {

            on

Could not find a part of the path ... Occuring even if it's not required

  
I have a windows application which will be installed on a client PC. However, when the user tries to run the app, an error is thrown up.   Could not find a part of the path "C:\Documents and Settings\$username$\Application Data\$appName folder$\sample_log.txt   I looked in the code..but could not find any reference to the file named sample_log.txt . There's no code that creates this file. Although, I know, we had in the past created this file for testing purposes and then deleted the code.   Thank You    

Designer crashes sometimes because application path becomes C:\Windows\system32

  
Sometimes VS crashes as it seems to execute the WPF designer in its directories or C:\Windows\system32. Sometimes it works fine as we can preview saved settings in the Designer. I have set application path as follows : ConfigFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "mixer.ser");<br/> When VS crashes I accept to debug it, the exception is : {"Access to the path 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\mixer.ser' is denied."}    System.Exception {System.UnauthorizedAccessException} ... or c:\windows\system32 Any ideas on how to fix this ?   Thank you !
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend