Recompiling old ASP.NET page .dll's from new VB Codebehind? - asp.net

I'm the newly appointed tech-guy at a small company. I've inherited their near-complete ASP.NET web page that's been left "near-complete" for some time, but I'm not really familiar with ASP.NET. It was dropped by the original developers a few years ago, and a year or so back someone tried to finish it using only inline code.
Now that I've unearthed the old VB source files, I've made a one-line change to the Page.aspx.vb and need get it associated to it's Page.aspx file. Trouble is, the #Page directive directly inherits its own App_Web_Page.xxxxxx.dll. Every page does this. This is not reflected in the source I have to work with, but is the way it now operates. The last person to touch it has long since forgotten the details of his work, and I'm not familiar enough with ASP.NET to know what to ask.
So my #Page directive goes like so:
<%# page language="vb" autoeventwireup="false" inherits="Page,
App_Web_page.aspx.cdcab7d2" masterpagefile="~/Master.Master"
enablesessionstate="True" enableEventValidation="false" %>
When I try to precompile the site, my #Page directives look totally different:
<%# page language="vb" autoeventwireup="false" Codebehind="Page.aspx.vb"
inherits="Project.Page" masterpagefile="~/Master.Master"
enablesessionstate="True" enableEventValidation="false" %>
And, being precompiled, It doesn't yield a page-unique .dll file I can just swap into the live bin directory and change the #Page directive for. I've tried a number of permutations on the #Page directive to try to get it to compile the new VB code on access, but I always wind up with errors, the best of which tell me ASP elements in the .aspx aren't defined in the .aspx.vb.
Can someone point me in the right direction with this?

You have to select the option like below highlighted...

Related

ASP.NET site error: Could not load type '[SITE]._Default'

I've written up an ASP.NET / VB site and it's been working fine all through debugging. However, once I publish the site and go to it in browser, I get the error listed in the title.
I've followed a few different sets of instructions to fix the problem, but none of the stuff I've tried seems to be working.
Here is what's at the top of my Default.aspx page:
<%# Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="[SITE]._Default" %>
And, the class in my Default.aspx.vb file:
Public Class _Default
I've tried changing "CodeBehind" to "CodeFile" which didn't work and gave me further errors. I'd also like to point out that another project was used as a template and renamed, along with all of the files associated with it, so maybe that's causing an issue? I have no idea. Any help would be appreciated!

ASP.NET TargetSchema user control directive

I have several user controls that look like this:
<%# Control Language="vb" AutoEventWireup="false"
Inherits="classname"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"
Codebehind="classname.ascx.vb"
%>
I know that TargetSchema was supposed to give Visual Studio help with Intellisense when working with asp/html pages. Does it still do anything or is it just ignored? I don't see any obvious difference, and of course the version number is way out of date, but if it's still doing something useful, I wouldn't want to just delete it willy-nilly.

How do I find out where .aspx page is pulling its header?

I haven't worked with C# or ASP.NET before, but I'm trying to update some .aspx pages on a site. I'm noticing that there are also some updates that also need to be made in the <head> when I look at the source of the page, but I don't know how to determine where that header info is being pulled from to make that change.
Here are the two lines I'm seeing before it jumps into the HTML content:
<%# Page Language="vb" AutoEventWireup="false" Codebehind="DefaultLogin.aspx.vb" Inherits="TIMSSSSO.Web.DefaultLogin" %>
<%# Register TagPrefix="cc1" Namespace="Generic.Foundation.WebControls" Assembly="Generic.Foundation.WebControls" %>
Does any of this tell me where I should go to edit the header? Any guidance would be appreciated.

Updating a DLL in an aspx

I am an old ASP programmer that recently took a job that has ASP.NET. I have an aspx file that has this at the top:
<%# Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true"
CodeBehind="List.aspx.cs" Inherits="itnola.List" %>
And the area that I'm most interested in is this line of code:
<asp:DropDownList ID="dplDistrict" runat="server" Width="205" DataValueField="districtID"
DataTextField="districtname">
There is a table in the database called districts that if I make a modification to that table it displays the changes in this dropdown. However, there is an extra entry in the drop down I assume they have hardcoded.
Not being familiar with ASP.NET, I've looked for a List.aspx.cs file and do not find it anywhere on the server. I did find an itnola.dll file in a bin folder I suspect may have something to do with this. If I remember correctly from my Visual Basic days this dll file is "compiled" and therefore not editable correct? How do I remove this one line in the drop down?

Register User Control Issue

I have a user control registered at the top of my page:
<%# Register Src="/Controls/User/Navbar.ascx" TagName="Navbar" TagPrefix="pmc" %>
and I reference it in my page like this:
<pmc:Navbar runat="server" id="navbar"></pmc:Navbar>
but it does not know what <pmc:Navbar is. I cannot figure out why.
I'm using VS 2008, in a Web Application Project.
Maybe you should specify the path with ~: ... Src="~/Controls/User/Navbar.ascx" ...
Remove either the initial slash from the path to the control, or better still, prefix it with "~" :
<%# Register Src="Controls/User/Navbar.ascx" TagName="Navbar" TagPrefix="pmc" %>
or
<%# Register Src="~/Controls/User/Navbar.ascx" TagName="Navbar" TagPrefix="pmc" %>
The first solution is flakey as it relies on the page existing in the root folder and the control existing below it. The second is the preferred as it will work from any page in your project.
You should also consider registering your user controls in your web.config, as it keeps things much neater, and tends to avoid path issues a little better.

Resources