Wrong Root, Absolute Paths '~' Don't Work?

Aug 24, 2010

have some kind of strange problem. I use Visual Studio 2008 Standard Edition, and whenever I use ~ in links (like PostBackUrl = "~/Admin/AddProduct.aspx"), ~ is translated into "C:DocumentAndSettingsUserDesktop" instead of my application root. Of course I dont have any project on Desktop. It happens in every project I run , even in project from pendrive which works properly on other computers.How can i solve this problem ? What and where should i change ?

View 8 Replies


Similar Messages:

Configuration :: Deployed DLL Contains Wrong Paths?

Sep 30, 2010

This may be a dumb question, but I've got a DLL that I compile and reference locally in a web site project and everything runs just fine. When I deploy this solution to the test server, I get an "Object reference not set to an instance of an object." error and the stack trace displays the files with their paths that are causing the error. The thing is, the paths being displayed are the absolute path as they existed on my development machine. Here's the stack trace:.........................

View 3 Replies

URL Rewrite Breaks Root Relative Paths?

Jan 27, 2011

I have a website, lets call it mywebsite.com. I also have a blog at mywebsite.com/blog. I have made a URL rewrite rule so it can be accessed from blog.mywebsite.com. The issue is that all my root relative paths (~/) do not work when viewing the blog from blog.mywebsite.com. Ok, say if there is a link on my blog that goes to a blog post that is at ~/blog/post.aspx?id=1. It will then go to blog.mywebsite.com/blog/post.aspx?id=1 which is actually, mywebsite.com/blog/blog/post.aspx?id=1 and that does not exist.

View 3 Replies

MVC :: FormExtensions Make Wrong Paths When Adding Area To Site

Mar 12, 2010

We have a large mvc2 project and just added an area to it. Now some of the paths in our forms are messed up. We are using Strongly Typed actionlinks and formextensions. Please look at the following demo: [URL] The form on this page is incorrectly submitting to the area. I think it's related to routing or just the way that area's are figured out when it's not specified.

View 5 Replies

C# - File.Exists Using The Wrong Root Path?

Mar 17, 2011

In my c# class I wrote I have a photo property that returns the photo source if the image exists (nothing or default image otherwise). In my code I use:

public string Photo
{
get
{
string source = "~/images/recipes/" + id + ".jpg";
if (File.Exists(source))
return "~/images/recipes/" + id + ".jpg";.......

If I get the FileInfo() information for this image I see that I tries to find this image in the following directory: C:Program Files (x86)Common FilesMicrosoft SharedDevServer10.0~images ecipes Of course the image is not located in that directory and File.Exists is returning me the wrong value.how can I fix this?

View 3 Replies

Web Forms :: Creating An "Absolute Root" Menu In Master Page?

Feb 21, 2011

I am re-vamping an existing website and have several "Sub" directories. I need to have my navigation (not using the .net navigation/sitmenu) but I need my mnus to point to the absolute root of my site in order to go between menu item pages. In other words, my menu is structured like this:

[Code]....

As you can see, the only two pages that are in the Root part of my Project are the Default.aspx page and the Contact.aspx page. This wokrs fine if I am just going to the Home (default) page or the Contact Us page, but of course if I go to the Rose Garden or the Articles pages and then try to go "Home" the page isn't found. I know that using "Absoluteroot" should work to get me back to the root section of my menu, but the only place I have used this is in the BlogEngine. Can anyone plaese point me to a tutiral on how to do this within my own web project?

View 8 Replies

Web Forms :: Absolute Positioning Doesn't Work For Label Control In Ajax?

Feb 1, 2010

Absolute positioning doesnt work for label control in asp.net ajax web form I have tried in VS 2008 as well as Visual Web Developer 2005 as well?

View 1 Replies

State Management :: Data Being Saved To Wrong Table In Wrong Instance Of Sqlserver Of Wrong Database?

Aug 1, 2010

I have a weird thing happening. I have two identical databases installed on one virtual machine but under two different instances of SQLServer. For some reason, periodically when saving from one it will save to the other instead. Using debug, I have verified that the connection string is correct and when the item saves, it still saves to the wrong database.I use session variable, and am of the belief that it might have something to do with it...and t hat when I go from one to the other it is still getting the connection string form the other for some reason.To make sure that it isn't a problem, I make sure that I completely close out one database before opening the other in a new IE window.I assume that when I completely close out an internet explorer window that it abandons all session states. Is that true?

View 7 Replies

Forms Data Controls :: Absolute Positioning In TemplateField / Putting Position Relative In The Cssclass PhoneCostsStyle But It Doesn't Work

Jan 23, 2011

I just want to position the first label in a position on the left and then the start position of the second label at a position. I can't use relative because of the different lengths of the strings. But I the absolute will not work. I tried putting position relative in the cssclass phoneCostsStyle but it doesn't work.

[code]....

View 3 Replies

AJAX :: Controls Work In Subfolders But Not In Root Folder?

Jan 8, 2010

EDITED To make issue more clear. I have also discovered this same issue with validatorcallout extensions used in a usercontrol in a root page and a subfolderpage

I have a strange issue I cannot figure out. I have a usercontrol that is used to display news story details. One of the requirements is to be able to email the story to someone. In this control I have included a modal popup to do contain the email form. What is really strange is that if the control is used in a page in a subfolder themodalpopup works as designed but when the control is in a page in the root folder while the usercontrol still works, themodalpopup control stops working.

Controls/StoryDetails.ascx

[Code]....

This control gets placed within a masterpage via a base MasterPageClass when there is a storyid in the querystring object

[Code]....

When the master page resides at the root level the popup doesn't work but in anyother folder it does work.

View 3 Replies

Web Forms :: ScriptManager Uses Website - Root Instead Of Application Root Directory

Jan 27, 2010

I ran into the following issue when trying to run a test website on IIS 7.5 (Windows Server 2008 R2 DatacenterEdition). The web-app is configured to run with framework version 3.5 in a .Net 2.0 app pool. Also the framework 4.0 beta 2 is installed on the server. The application named 'TestPfade' is located under the website's root named 'Default'. It is not only a virtual directory but defined as an application. The folder structure looks like this: The markup of the sole document reads as follows:

[Code]....

When viewed in a browser the image gets shown because the given relative path is correctly resolved to 'images/Lighthouse.jpg' but the paths to the ajax-framework resources also include the application's root folder and therefor aren't found: 'src="/TestPfade/WebResource.axd?d=1bX...' Here is the complete html-source generated:

[Code]....

View 9 Replies

Virtual Directory Root Vs Default Web Site Root

Feb 11, 2011

I am using iis 5.1 in which we have only only one default website, I have two projects v2 and v3 my website points to v2 projects and have some folders images, styles etc now i have a virtual directory under this website that is hosting project v3 and having the same folder hierarchy as v2 in the home page of the both projects i have img src="imagesedlogo.gif" alt="logo"/> but this shows the same image that is in the v2 directory, How can i show different images for both projects. using "" get the root of the web site but how can i get the root of virtual directory under that website

View 2 Replies

Request The Root Default.aspx Without Specifying It In The Url For Your Root Application?

Sep 17, 2010

How can you request the root default.aspx without specifying it in the url for your root application?e.g. ttp://localhost/MyApp/ instead of http://localhost/MyApp/Default.aspxshould be able to do bothI'm not sure if this is a setting in IIS 7.5 for the application or what.

View 3 Replies

ADO.NET :: Data Saving To Wrong Database On Wrong Instance Of Sqlserver

Aug 1, 2010

I have a very weird thing happening. I have two databases that have exactly the same tables but different database names on the same virtual machine, but in different instances of SQL Server. For some reason, when using one of them, it will save to the other. In debug, looking at my connection string..I have verified that it is correct, yet when I allow the save, I look in the table and it isn't there, it is in the other database that is in a table with a completely different name and in a different instance of SQL Server.

View 1 Replies

Getting Different Paths Using HttpPostedFileBase?

Feb 7, 2011

See the following code. I'm uploading files, Yet i'm getting different results from difference browsers.

Firefox var path = "about.restaurant.jpg"
yet in ie6 path = "D:devxxxxxxxxxxxxxxxWebsiteimagesabout.restaurant.jpg"
foreach (string file in Request.Files)

[code]...

View 1 Replies

What's The Absolute Url

Feb 4, 2010

I am addressing page /MyPage.aspx. If I address it on my development server, it's absolute address is: [URL]If I address it on my operational server, it's abosolute address is: [URL] In Visual Basic, how do I programmatically get the server bit, that is http:// or http://localhost?

View 5 Replies

MVC :: Want To Create Two Controllers/Paths?

Sep 16, 2010

I am wanting to create a path somewhat like this: /Administration/News and have it forward to a News controller instead of it being the action.How would I go about this?

View 3 Replies

C# - Linking To Resources (img, Css, Js) From Different Paths?

Feb 28, 2011

Iam new to ASP.NET and poking around my first ASP Web Application projects in .NET 4.0 I have problem, which I can't solve, and google searches does not bring any joy. So I would ask for and/or explanation of following problem:

Assume that I have set up following project structure:

default.aspx
[gfx] (dir)
[images]
picture.jpg
[css]
stylesheet.css

[Code]....

View 5 Replies

Formatting A String - Paths

Jan 7, 2011

I have the following code, which generates insert queries

For Each f As String In Directory.GetFiles(d)
objSQLStringBuilder.Append("insert into table1 (full_path, file_name) values ('" & f.Replace("'", "''") & "', '" & f.Remove(0, Len(d) + 1).Replace("'", "''") & "');")
Next

However, the paths which it finds are formatted as follows c:program filesmicrosoft officewinword.exe I need to format the paths as follows file:///c:/program%20files/microosoft%20office/winword.exe. How can I modify the above code to do this?

View 5 Replies

HTML Img - ASP Image And Relative Paths

Mar 4, 2011

What is the correct way to reference an image in ASP.NET for live deployment on IIS? The following works in dev and production:

<asp:ImageButton ID="ibnEdit" runat="server" OnClick="ibnEdit_Click" ImageUrl="~/App_Themes/Default/images/one.png" Visible="false" ToolTip="Edit" />

The following doesn't work in either: (why not?)

<img src="~/App_Themes/Default/images/two.gif" />

The following works in dev but not in production:

<img src="../App_Themes/Default/images/two.gif" />

View 2 Replies

C# - Routing And Physical Paths In Web.config?

Jul 22, 2010

I use ASP.NET routing to rename the full paths of my URLs (ie. /page1/page2/file.aspx would just become /file.aspx). This doesn't work with web.config authorization, because that uses physical path/folder names.

View 1 Replies

Vb.net - .NET Theming Programatically : Image Paths?

Mar 14, 2011

We have a multilingual site, or culture-sensitive, and some of the static content now needs to be targeted; for this I'm using themes as it seems the easiest way to achieve what I want, but I can't for the life of me get the images to pick up.I'm setting the theme in code-behind, and thought at first that maybe this was the issue, but on checking up it looks like I'm doing the right thing (setting on Pre-Init).

I expect to be able to reference images using relative paths where App_Themes/ThemeName/ is automatically resolved, such as:

<asp:Image runat="server" ImageUrl="imagesimage.jpg"/>

For whatever reason, however, the image isn't being pulled through at all.This is the code we have in place for setting the theme (the only really relevant part, I'm sure, being the Theme = CurrentSite.CultureName, which is applied successfully):

Private Sub SetTheme()
Dim themesPath = Server.MapPath("~/App_Themes")
If Directory.Exists(themesPath) Then[code]...

In the above code, CurrentSite.CultureName would be a language culture name (for example, en-gb, or nn-no) that does have an existing corresponding theme folder containing all required resources.Pages do have EnableTheming set to True. Also, I have tried removing the theme-setting code and applying the theme in the page using Theme="en-gb" to no avail.

Is there anything immediately evident as to why the URLs aren't resolved?

View 1 Replies

C# - Mapping A Filename To Paths On A Server?

Jun 28, 2010

I have a problem with my code. My code is using the fileupload control to browse for a filename when you add a filename it processes it and the code runs fine on when it lives on local host, but when I put the code on our prodution server it cannot find the filenames listed by user.

For example if I use the upload control to browse to B:MISCH IntiveRPTTOFL_3.csv and the code lives on my localhost which know what that file path means it works, but if the code is moved to a production server it may or maynot know what B:/ is or B:/ maybe mapped to something else. Even if I am browsing to a file on my C drive it will work on if the code is on the machine that the C drive is on, but it will not work if the code is on another machine because obviously that file wouldnt be on that C drive.

Private Function CSV2DataTable(ByVal filename As String) As DataTable

Using MyReader As New _
Microsoft.VisualBasic.FileIO.TextFieldParser(filename)
MyReader.TextFieldType = FileIO.FieldType.Delimited

What can I do in asp.net to make the filename work correctly?

Ok lets say I get the filename and save it as so

FileUploadControl.SaveAs(Server.MapPath("~/") + filename);

now I want to pass the filename to the function above for processing. Do I pass Server.MapPath("~/") + filename as the filename? Also when I am done what do I do to delete the file from the server?

View 1 Replies

Web Forms :: Getting .aspx File Paths?

Jul 14, 2010

Is it possible to scan all .aspx files in a web-site directory ? Suppose that , i've a home page like home.aspx, and many other pages.

How can i list all other pages with hyperlinks ?

View 3 Replies

Web Forms :: Image Paths When Using Routing

Jan 24, 2013

I have implement url routing on my website project in vs 2010 and IIS 7.

But after implemented I have facing issue where images and css some times load and some not.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved