Does change in ASPX. CS page requires building. - asp.net

During my previous projects, any change that I would make to an aspx.cs didnt require building the entire solution. The changes would directly reflect in my IIS hosted server i.e in localhost.
the new web application has the same setup configured. The application has been added in IIS with a designated Application pool and when browsed the site opens. But in this project, I have to build the solution everytime I make change in aspx.cs page. The same doesn't apply to aspx changes.
Any help would be appreciated in letting know this difference in behaviour and solution of not building the entire solution if possible.
Thanks

Related

App_Offline dynamically

I have a MVC5 web application on production, but I had to call the server guy to take down the site manually everytime I need to publish new features, just wondering if I can do this dynamically without any access to the webserver. I was thinking of programatically rename the App_Offline file but it won't work if I want to turn the site back on since ASP.NET automatically block any request.
Any help will be appreciated

I can't find options for Select Master Page or Place code in separate file in VS2012

I installed VS 2012 on my work PC, and for the life of me when I go to add a new web form, I cannot see or find the 2 options for Select Master Page or Place code in separate file.
Any ideas on how i can find them?
I've just been fooled by just that for the past hour. What I've found is that the 'old' method of using the menu option 'Add web page using master' (or similar) has vanished, and been replaced by 'Content Page'. When you select this, you're then given the option of choosing a master page.
Incidentally, I don't get the option of starting a web site project, which may be why I'm not seeing this either.
You should have web form with master page in the add items?
Placing code in separate file is a different concept called code-behind. You will have an ASPX file and a cs / vb file which handles the events.
e.g.
Default.aspx
Default.aspx.cs
EDIT: Based on comment.
You may be using a Web Site on your laptop, but a Web Application in work. See Web Application Projects v's Web Site Projects.
Take a look at ASP.NET Web Site or ASP.NET Web Application?, this might also help in deciding which to use. Generally, I always go for Web Application.
You can use VS to convert from a Web Site to a Web Application, but AFAIK, you can't do it the other way round unless you create a new project and copy across the relevant parts - which could be a big job depending on the size of the site.

asp.net: updated pages compilation

I need to ensure that when some individual pages are updated/modified, the time required to load the other pages to the Web site remains unaffected.
A. Create the application as a Web site project.
Copy the entire application to the deployment server.
Copy only the updated files to the deployment server when a page is updated.
B. Create the application as a Web site project.
Pre-compile the application by using the update able option.
Copy only the updated files to the deployment server when a page is updated.
is Pre-compile option available for web site or its available for web app?
I can simplify this question by some ifs that contains your answer.
If you update just the ASPX files and rarely you change the code files : then
Use Website and publish it using
Allow this precompiled site to be updatable
Using this option you can change ASPX files
Use fixed naming and single page assemblies
Using this option you can change code files, and replace them with their friendly name
Update required published dlls and ASPX files when ever you need.
Note: any changes to bin folder contents may cause application restart and that means all sessions will be lost, so in this case you must consider using other session state modes like SQLServer and StateServer and once you do you need to annotate all your session classes with Serializable attribute
If you will update just the ASPX files : then
Use Website and publish it using
Allow this precompiled site to be updatable
Using this option you can change ASPX files
Else if you just need to update the ASPX HTML content : then
You might reconsider your application scenario
because you need to use data-base to rectify the update problem as any body else do
And finally if you will update web-site code-files very rarely or your changes are at application level rather than page level : then
Use web-application build or publish it if you like.
Using this option you still have the ability to change the ASPX files

Changes in aspx files won't show until rebuild

As I understand it, I should be able to change an aspx file in VS, update in the browser and then see the changes without rebuilding the entire solution. For me thats not the case...
Any ideas?
Edit:
I use VS 2008, .NET 3.5 and development server. It is a Web Application project and I always need to rebuild to see the changes in the aspx files. I use master pages and aspx controls. I use edit and continue and have no problem updating the code behind files without rebuilding.
If the change is affecting code behind in any way, you need to rebuild.
If not, can you give an example of what you change so we have a little more to go by ;)
If you are using the Web Application Template (versus the web site template) and you add controls to the aspx front-end code, it will automatically add it to the <file_name>.cs.designer partial class auto-generated code behind. since this is part of the class, it needs to be compiled.
I think you need put more information into your question, like what change are you making? What version of IIS are you using? Are you using IIS or Cassini (Visual Studio Web Development Server)?

Contents of a code-behind file is rendered instead of a control

I have a user control which is being added to a page dynamically. It works fine on my computer whether a site is running on an integrated Visual Studio server or deployed to IIS.
But when the site is deployed to a production server, I see the contents of a user control's code-behind file instead of a control.
Have you any ideas what can cause this?
Thank you.
EDIT: The site is running on IIS 6 and here is the code I am using to add the control to a page
`this.Controls.Clear();
this.Controls.Add(LoadControl("MyUserControl.ascx"));`
Yikes. That should never happen. Are other ASP.NET pages working correctly? Are you sure ASP.NET is properly registered on the server? I think you'll need to give us some more information... what version of IIS are you running, and post the code where you dynamically add the user control.

Resources