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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Problem in Path translation

Posted By:      Posted Date: September 17, 2010    Points: 0   Category :ASP.Net
Hi,I am developing a very basic application in C# and Asp.Net using New Website-->Asp.Net web site.This is a simple login control application available in Visual Studio.  After starting a project, I found folder structure like that Project name "WebSite2" under which I have  folders like "Account", "Scripts" and "Styles" and few files like "About.aspx", "Default.aspx" and "Web.config" under the same "WebSite2" folder. Under "Account" folder I have files like "ChangePassword.aspx","ChangePasswordSuccess.aspx","Login.aspx","Register.aspx" and "Web.config". Now I have add a simple page "ThankYou.aspx" under "Account" folder and "Thanks" under "WebSite2" folder. I have modified "Register.aspx.cs" file so that whenever a new user will register, an email will be sent to the persons inbox and from where he will activate his account and this functionality is working fine. Now the problem is that whenever a new user registered, an email will be send to him and simultaneously he will be landed to "ThankYou.aspx" page, but here the user is redirecting to "Login.aspx" page. i have tried it with so many combinations but always getting "Login.

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

The Path problem?

I hope to get the following result, how can I write code? Thanks!                 Source                                                                                      Target1. http://localhost:1131/Mysite/Member/MyProject.aspx     =>       /Member/MyProject.aspx2. http://localhost:1131/Mysite/MyProject.aspx                   =>       /MyProject.aspx3. http://localhost:1131/Mysite/MyProject.aspx?Type=2     =>       /MyProject.aspx?Type=2 4. http://www.Mysite.com/Member/MyProject.aspx             =>       /Member/MyProject.aspx5. http://www.Mysite.com/MyProject.aspx   &nb

file path problem


in the application, I need write a jpg file to local folder on server, then show it in browser.

so, the code likes show this file:

HttpContext.Current.Request.Url.Host + "/View/ViewJpg.aspx"

In the ViewJpg.aspx, it will process the jpg. /view is in root folder.

it works fine when the code is on a server, however, I have problem when I debug in on local machine.

because the code is actually http://localhost/mYproject but HttpContext.Current.Request.Url.Host only returns http://localhost.

what's the best way to deal with this?


FileUpload path problem


I have not been able to uplaod a file to my web page although the code I am using works if I copy it locally. Perhaps I am missing something in the path or I need to change some security setting on the web page?

   protected void btnUpload_Click(object sender, EventArgs e)
        SelectedFileName.InnerHtml = txtFileField.PostedFile.FileName;
        FileType.InnerHtml = txtFileField.PostedFile.ContentType;

        // convert bytes to Kbytes
        int size = txtFileField.PostedFile.ContentLength / 1024;
        FileSize.InnerHtml = (size.ToString() + " KB");
        uploadDetails.Visible = true;

        string strFileName = txtFileField.PostedFile.FileName;
        string c = Path.GetFileName(strFileName);

            // not sure if this path is correct. not working anyway
            txtFileField.PostedFile.SaveAs("~/" + c); 
            feedBack.InnerHtml = "File uploaded successfully.";
        catch (Exception exp)
            string message = "File did not upload, please try again";
            feedBack.InnerHtml = message + "\n" + exp.Message.ToString();
            uploadDetails.Visible= false;
Thanks for any help.

Problem with translation of column names



we have a Sharepoint 2007 Installation with german language packs.

I created a new english site collection and inside the new collection a new document library.
And there I have the problem. The system columns like "modified by" and "modified" have german names: "Geändert von" and "Geändert".

Any idea how I can solve this problem?

Thanks in advance

Info Path Form Problem; the form is closed


Hi All

I am facing an error in info path form web enabled.


When i open a new form, it opens and saved. Even the sendingemail is also working.

But when i try to open the already saved form. The form is not opening it is displaying the error that the form has been closed. Or it is not getting the form from the location..

Problem in content deployment path job



I have created a Content Deployment path to copy data from source server to destination server.

And also i have created a job to run this content deployment path.

I made the job to run .But the job status is "PREPARING"  for a while.No change for a long time.

I dont know what might be the cause.

Could anyone help on this please?

problem in writing Element Path in Webservices has datsource for SSRS report



I have a requirement to create a webservice which returns dataset, once dataset is consumed by client application(here client app is SSRS report), I need to show dataset 's table value in SSRS rdl report.

When i see XML structure returned to client look like this

<?xml version="1.0" encoding="utf-8" ?>
<DataSet xmlns="http://tempuri.org/">
 <xs:schema id="Results" xmlns=""  
  <xs:element name="Results" msdata:IsDataSet="true"  
msdata:UseCurrentLocale="true" msprop:QueryTerms="Cool Bikes;"  
msprop:IgnoredNoiseWords="" msprop:Keyword="" msprop:ElapsedTime="938"  
msprop:Definition="" msprop:SpellingSuggestion="">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
     <xs:element name="RelevantResults"

Path Too Long Problem. Accessing filenames longer than 260 chars using unicode and kernel32.dll.

I found this article a few weeks ago that provided a way to access files and folders past the 260 char length:


I put the code from "Finding Files and Folders" in a dll and wrote an app in vb accessing these functions.  However, the code randomly breaks on a specific kernel32 function call. 

I noticed that if the search finds a file (not folder) longer than 12 to 14 characters then it breaks on occasion.  This is strange because I would think it would either never break or always break.

Here's the line where it breaks:

// find next

found = FindNextFile(findHandle, out findData);

Any ideas?


info path problem on another web front end




I have a info path form which is working fine in environment (1 Web Front End and 1 Application Server). But now i have added a new web front end. Now the same form is if open through new Web Front End, it is not opening. I change the dll file but still it is giving the same error.


Can any body tell me what configuration is needed for this about info path form?

Problem in language translation


Hi Everyone,

I have a problem in applying language resource to a form already launched from a parent form.

The description is as follows:

I am working on a multithreaded async C# windows application.

There is a parent host form, that has a language utility. this form is used to launch multiple sub forms.

I'm able to change the language of this host form and subsequent sub forms after changing the language.

Howeever, if i try to change the language again , then the language of the sub forms already launched previously is not changed.

How can i make it possible, to change the language of the sub forms already launched ???

Please help !!!!!!!!!!!!!!


Thanks :)


Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Regrading Sharpoint 2010 problem and solutions

We can write your question and problem on this blogger.you get ans.use.

This sharpoint 2010 problem solving threads

Hi friend,

you can use this thread to solving problem and solutions.

Strange Photo upload problem


I'm working project it's live on shared hosting

we'er uploading photos to a file on the server everything works fine the photo is resized renamed and sent to the folder

the upload page returns the thumbnail and the full size photo it's there all the photos have to be approved by an admin

twice now after they have been approved they disapear I checked the folder they are not there could there be anywhere

on the server they could get hung up before they go into the folder I have it setup so when you delete the data base entry it deletes the photo from the folder othe than that you need to open the folder and delete the photo this has hapened twice now I tried to recreate it with no luck

thaks for your help in advance

ASP.Net Caching problem ??


I'm having a problem with an asp.net 3.0 application using a gridview to display data.  The problem seems to be that despite a brand new .selectCommand being sent to the sqlDataSource, the gridview starts displaying data from *someone else's* query.  For example, user A is logged in and will be working fine until a few page submissions later when the gridview data starts suddenly showing information that belongs to another user. 

This is my first asp.net application, though I've been working with classic asp and ADO for years so I'm used to sending a SQL string and getting back the results from that string.  Apparently there is a complex caching system which is interferring which I do not at all understand so at this point I just want to stop the server from caching any data whatsoever.  Is this possible?

Any and all help will be much appreciated!!

Could some one tell me whats the Problem with this String Manipulation ??? C#.net



I store some values from code behind to a label which is Hidden !

<asp:Label ID="lbl_Hidden" runat="server" Visible = "false"></asp:Label>

and at the page load event i retrieve the value of the label & assign it to a string !

stringvalue = lbl_Hidden.Text;

Now i dont know why this manipulation does'nt work !

I've a character 'A' in the string and i'm unable to replace it with a space !

stringvalue.Replace(A, " ");

Wot do u think abt it ????

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