Invalid file name for monitoring:

J

Jo67

I am building my first ASP.NET application, but I have a problem with
some code basically copied from the IBuySpy Portal (which I'm learning
from), for adding a new user to the database. The user is added to
the database alright, but then the application crashes on the line
that reloads the page with the new parameters:

Response.Redirect(("~/memberdetails.aspx?memberid=" & memberId &
"&membername=" & memberName))

giving the following error:

Invalid file name for monitoring:
'c:\inetpub\wwwroot\ThirdYearProject\~'. File names for monitoring
must have absolute paths, and no wildcards.

I'm flummoxed as to why this line is fine in the portal, but not in my
app. Can anyone shed any light, please?
 
K

Ken Cox [Microsoft MVP]

The problem looks like it is in the usage of the tilde (~) which stands for
the root of the Web application.

Is the portal code intended to work from the root (e.g., wwwroot) rather
than from a subdirectory (e.g., ThirdYearProject)? Is ThirdYearProject set
as an application in IIS?

Try dropping the first forward slash after the tilde. Then try dropping the
tilde?

Are you sure of the code/syntax in the Response.Redirect? The double
brackets seem odd.

Ken
Microsoft MVP [ASP.NET]
 
J

Jo67

Thanks, I found the problem. I was using DateTime.Now.ToString as
part of the membername string that went into the database. I figured
that was okay because the portal does that for its "friendlyName"
string which also goes into the database.

The difference between the IBuySpy portal and my application was that
"friendlyName" does not then become a parameter in the URL, which is
what I was trying to do with my "membername". Once I changed that, my
application works fine.

Thanks for taking the time to respond.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top