|
Hi,
In Window.Open() function, i'm confused with the usage of "../" and "./".
ex: When I give Window.Open("./popup.aspx") and
Window.Open("popup.aspx") the result is same. But if i put the "popup.aspx" form outside the project (project path is D:\Projects\TestP, TestP is the Project folder), i.e. in "D:\Projects" folder and call Window.Open("../popup.aspx"), its giving error.
Error is:
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested Url: /pop.aspx
Could someone please tell me the usage of "../" and "./" and "/"
Regards,
Manoj
|
|
|
|
|
blumenhause wrote: ../"
.. means it will come out of the directory where your current page resides. Assume your page is in Pages folder, and you have another directory say images outside of pages directory, refering ../images from a page in pages directory will point to images directory.
blumenhause wrote: /
Looks for the specified resource from the website root. /images will point to the images directory which is located on website root.
|
|
|
|
|
I tried that Navaneeth. I gave "../popup.aspx" and put the aspx outside the directory.. i got the same error.
what do u mean by "website root"?
Regards,
Blumen
|
|
|
|
|
blumenhause wrote: what do u mean by "website root"?
Website root is the starting directory. In local machine it's wwwroot directory in inetpub .
Directory Representation
wwwroot /(Website root)
wwwroot -> images /images
wwwroot -> images -> sample.gif /images/sample.gif
wwwroot -> images -> Buttons -> sample.gif /images/sample.gif or ../images/sample.gif (from a page which resides in another directory in website root)
hope it makes sense
|
|
|
|
|
blumenhause wrote: D:\Projects\TestP, TestP is the Project folder)
If TestP is your project folder then how can you access that page which is out side of your project folder.
|
|
|
|
|
the form which is outside is a popup form, which i call from main form.
|
|
|
|
|
blumenhause wrote: he form which is outside is a popup form,
You can access only those pages which are placed in virtual directory.
Is you popup page in virtual dir.?
best rEgard
pathan
please don't forget to vote on the post that helped you.
|
|
|
|
|
no, its outside.. the form and virtual dir are in same folder..
what led to this doubt is that I wanted to access a user control (ascx) from multiple web forms, which are in different folder in application.
but i can't access that user control unless I put it with the form from where I'm trying to access it. That leaves me with no option but to copy and paste that user control on each and every folder (i have different forms in different folder) in our product.
Then I thought I could create a folder and put my user control there so that all forms could access the control from this common folder and i tried to access the user control (this user control would in turn open a popup, this is a search control) with different combinations of ../, ./, and /
Regards,
Blumen
|
|
|
|
|
Still i cant get you but you must put all files in virtual dir ortherwise you can not access them.
please don't forget to vote on the post that helped you.
|
|
|
|
|
is there any work around to access file outside virtual directory.
Say, if I have a user control, and I want to access this control from two web applications. Can't I put this control in a common location and access it?
|
|
|
|
|
/ - root directory of site
./ = current directory
../ = up one directory level from current directory
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
|
"." is the current folder, which means that "./popup.aspx" and "popup.aspx" are equivalent.
".." is the parent folder.
An url starting with "/" is relative to the root of the site, while other urls are relative to the current page.
In server controls you can also use "~", which is the root folder of the application. "~/SomeFolder/popup.aspx" will always produce an url to the same file, regardless if the application is at the web site root or in a folder.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
thanks alot all for your suggestions and replies.
Is there a link or an article in internet that explains these things further with examples? I've tried google, but it is not returning any result if i give "../" in the search textbox.
Regards,
Blumen
|
|
|
|
|
blumenhause wrote: Is there a link or an article in internet that explains these things further with examples
Still I am not getting what is there in these ? It's just simple concepts, still are you confused ?
|
|
|
|
|
I agree its simple concept. As I indicated in my previous post, I want to access a user control from multiple forms.
It works if I put the user control in the project folder, but then I have to copy the user control to every project folder. Is there a way to put this control in a single location and access it from all forms?
|
|
|
|
|
Can you show me the folder structure for your application ? Is your application uses a virtual directory or running directly from wwwroot ?
|
|
|
|
|
its using a Virtual Directory.. I have the aspx files in D:\Projects\TestP and dlls in D:\Projects\TestP\bin.
|
|
|
|
|
craete a folder from the root called 'mycontrols' and put yoour control in there. Then you can access from any other folder by
"/mycontrols"
or
"~/mycontrols"
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Thanks for that, I'll try it.
|
|
|
|
|
how can i take only month from datetime field of the database
|
|
|
|
|
Try this:
SELECT Month(JoinDate) As MonthOfJoining FROM Employee
|
|
|
|
|
protected void Button1_Click(object sender, EventArgs e)
{
foreach(ListItem li in ListBox1.Items )
{
if (li.Selected==true)
{
Roles.DeleteRole(li.ToString());
}
}
ListBox1.DataSource = Roles.GetAllRoles();
ListBox1.DataBind();
}
What is the pbm in this code .while clicking the delete button the roles willnot be deleted from the aspnetprovider database
|
|
|
|
|
li.ToString()...returns string "System.Web.UI.Controls"...use li.value
Koushik
|
|
|
|
|
i tried the code u specified agin it will not wrk .what to do?
|
|
|
|