Shift the webform files into a new folder within a particular project

V

vinesh

I have sample Asp.Net Web Application project.
Let me know how to keep the files related to this project (like the
webform.aspx, WebForm1.aspx.vb, WebForm1.aspx.resx) in a separate folder
within a project and what all setting will I be required to do So that my
original project works.

Can I keep WebForm1.aspx in root and code behind file in a folder within the
project folder?

Thanks in advance.
 
O

One Handed Man \( OHM - Terry Burns \)

1.) If you create a simple one form ASP.NET project and put a label on it,
and in the page load event, assign Hello World to the label, ad check it
works OK.

2.) Create a Folder called Code

3.) Drag the WebForm1.aspx.vb and resource files to the new folder, and
rebuild the project, check this works Ok again.

4.) Alter the message to "Ive been moved" and note where the source files is
opened.

5. Recompile and test again.


Thats it. ASP.NET keeps a check of where its source files are in the
structure.

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
 
V

vinesh

I would like to manage my aspx and code behind files separately.
Instead of shifting the aspx along with its code behind file in a folder, I
would like to keep the aspx file on root of the project folder and its code
behind file in separate folder.

Since I could not see the code behind file in the Solution Explorer of the
Dot Net IDE, let me know how can I keep the code behind file in a separate
folder that contains the aspx file.
Regards
Vinesh
 
O

One Handed Man \( OHM - Terry Burns \)

Well you didnt read my post then. Note I refer to the Webform1.aspx.VB not
Webform1.aspx

HTH

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
 
O

One Handed Man \( OHM - Terry Burns \)

Click the 'Show All Files' Icon on the Toolbar in Solution Explorer to
reveal all files in the project.

HTH

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
 
V

vinesh

Thanks it worked.
-Regards
Vinesh

One Handed Man ( OHM - Terry Burns ) said:
Click the 'Show All Files' Icon on the Toolbar in Solution Explorer to
reveal all files in the project.

HTH

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
 
O

One Handed Man \( OHM - Terry Burns \)

Glad 2 be of assistance

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
 
V

vinesh

It is working fine.

I have some more points to clarify

1. I created a new project containing a webform and its code behind file. I
dragged the code behind file to a new folder in Solution Explorer. On
running the project, it works fine. I then closed the project and opened it
again. It gives a error
"The class file webform1.aspx.vb specified as the codebehind for the
webform1.aspx file could not be loaded"

I changed the codebehind attribute to set it to the new folder I have
created and saved it.
I closed the project.
Again opened it and clicked on webform1.aspx file to edit it.
This doesn't open the file instead it gives the same error as above.
I also noticed that the codebehind attribute is set to root instead of the
new folder.
At this stage, I again set the codebehind to the new folder.
To my surprise now it doesn't allow me to edit the aspx page and gives the
above error.
Is there any other setting I require to change?
Please let me know.


2. Also in a fresh project, if I shift the code behind file to a new folder
and then clicked the view code button from the solution Explorer then it
creates a new code behind file in the root of the project.
However, if I double click on the webform page, then it opens the code
behind file that we shifted to the new folder.
There seems to be some more settings?
Please let me know what are those?

Thanks in advance

-Regards
Vinesh
 
O

One Handed Man \( OHM - Terry Burns \)

I have 2 leave for the day but will look at this later

Regards

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
 
O

One Handed Man \( OHM - Terry Burns \)

I dont think you can do this on reflection. I cant find anyway to make this
happen

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
 

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

Top