Include Classic VB .inc In C# Aspx?
Jul 30, 2010
how I can include .inc file from VB classic ASP in C# aspx page?
I try do it with:
<!-- #include file="menu.inc" -->
But I receive error about syntax in menu.inc "Compiler Error Message: CS1003: Syntax error, '(' expected" - "Line 3: if Len(Session("GUID")) < 1 Then":
<%
if Len(Session("GUID")) < 1 Then
Response.Redirect "default.asp"
End If
%>
View 1 Replies
Similar Messages:
Jan 31, 2011
I would like to include the asp clasic file in asp.net page. I am looking for something similar to :
<!-- #include file="inc.config.asp" -->
View 6 Replies
Jun 8, 2010
I've got an ASP.net file, and I'm trying to include dynamic code which was easy in classic ASP.
Here is what I have tried so far:
<%@ Register TagPrefix="TagPre" TagName="header" Src="alg/classes.aspx"%>
and
<!--#include file="alg/classes.aspx"-->
But neither of these seem to work. The content of classes.aspx is:
<script runat="server">
' Square class
Public Class square
Public sqRows As Integer 'Numbers of rows this square has
Public sqCols As Integer 'Number of columns this square has
Public sqArray(,) As Integer 'The square array
' Initialise square array to match size of canvas
Public Sub initSqArray(ByVal canvCols, ByVal canvRows)
ReDim sqArray(canvCols, canvRows)
sqRows = canvRows
sqCols = canvCols
End Sub
End Class
View 2 Replies
Jan 25, 2011
I have a classic ASP page which is actually written in server-side JavaScript (I need to do number base conversion and JavaScript handles this really well). Unfortunately once it has performed its number base conversion it needs to access a protected folder on our site and our ISP won't let us use ASP for this, although they do allow ASP.Net to access protected folders.
I know slightly less than nothing about ASPX but I have some sample VB code which can read content in the protected folder, and I am comfortable with VBScript and JavaScript so how hard can it be...but my questions are:
1. Is there any way that I can (server-side) utilise my existing JavaScript functions within an ASPX page?
2. Are there any built-in functions accessible to VB which will provide number base conversion (for example, provide a number and return it in Base36 or any other base, or provide a Base36 number and return it as an integer)? This option would lead me down the path of rewriting the whole thing (oh joy).
3. Or would it be easier to keep the ASP page and use that to perform the calculation and then make an AJAX like call from the ASPX page to the ASP page to return the information I need and keep the ASPX page for just accessing the protected area?
View 1 Replies
Mar 24, 2011
I'm using urlrewriting.net and want to add a rule to map all classic asp requests to default.aspx.Unfortunately my attempt below just results in a redirect loop, so I must be doing something wrong.
<add name="LegacyRedirect"
virtualUrl="^~/(.*).asp"
redirectMode="Permanent"
redirect="Application"
destinationUrl="~/default.aspx"/>
View 2 Replies
Apr 9, 2010
I have an aspx page that has a @Page directive which points to a c# class. e.g.
<@ Page Language="C#" EnableSessionState="true" ValidateRequest="False" Inherits="MyClass" %>
MyClass extends Page, which is the code behind class for that aspx page.Now I want to add another class to the aspx page. This class does some processing and will redirect the user to another page if certain conditions are met. It will be called before the above directive. I tried adding another @Page directive, but gotten an unknown error (literally). I'm thinking that there can only be one code behind class per aspx page so I got the error when I added another one. Googling such question didnt really help me with the answer.
View 1 Replies
May 6, 2010
I have many aspx page includes in my web form. I want to convert them to user controls. Just wanted to confirm whether there is any performance gain in doing so? I have 50 pages in which the aspx page is included.
View 1 Replies
Jun 14, 2010
I need an advice on how to include aspx page (code) in 3 other aspx pages. Why? Well, in included page I have a large amount of code that I don't want to copy/paste in other pages, and I want to make modifications just once in one file.I googled for suitable solutions, but didn't find nothing appropriate.
View 3 Replies
Jul 18, 2010
Depending on a parameter, I want to include html from different files in an aspx page (this is a section of the page). Here is how I am trying to do it:
in aspx file:
[Code]....
in C#
[Code]....
The problem is, whenever I edit the "include" files in VS, VS saves them as UTF-8. Then when I open the web page, there are three extra characters where the included html starts. If I go into a different editor, I can change the format to ANSI and then it displays okay in the web page.
I have two questions: 1. Is there a way I can save the file in VS as ANSI so I don't get the three garbage characters? (I tried saving as file types .htm, .txt, and .inc but none work.) 2. Is there a better way to do this so it does not matter if the file is UTF-8 or ANSI?
View 3 Replies
Oct 18, 2010
I have Webform.aspx and Webform2.aspx
How in Webform2.aspx to included Webform.aspx?
View 4 Replies
Mar 9, 2011
I have 5 linkbuttons act as navigation menus on the top of each .aspx page. I wrote code to control when and which linkbutton should be enabled. I am going to create a header.ascx page with these 5 linkbuttons and use <%=Response.Write("header.ascx")%> code to include the .ascx file in the .aspx page. But I got a problem with the code behind, the current .aspx page does not recongnize the linkbutton objects because they are in another file. How do I declare these 5 linkbuttons in the application?
View 13 Replies
Apr 27, 2010
I have use my custom Contol which include textbox and customValidator in my aspx page.
iv noice it never get into the customValidator function.
View 2 Replies
May 21, 2010
I am trying to redirect an ASPX Page to a Classic ASP Page, This is Working Fine with my Local IIS (version 5.1). OS is XPesponse.Redirect("xyz.asp?id=1234");I tried to deploy it into Windows server 2003, IIS Version 6.0 and i am getting an error"Page Cannot be Displayed. here is a problem with the page you are trying to reach and it cannot be displayed."
View 2 Replies
May 20, 2013
I have just started with ASP.NET.
I like the idea of using Include files so that I can create various versions of individual parts of a site and decide in code which to display. I used:
<%Response.WriteFile("contentcontent.aspx")%>
to include a content.aspx file within my default.aspx page.
I would like to include a Left.aspx, Main.aspx and Right.aspx file inside the content.aspx file. I tried using the reponse.writefile function but noticed when I debug the website that the text "reponse.writefile..." displays instead of the code contained within the referenced file(s).
Can this not be done?
View 6 Replies
Oct 12, 2010
I am new to ASP.Net. I am working on an ASP application in which I need to use an existing C# class (.cs) to get a return and pass to my ASP code. I know it may be impossible to call C# class directly from classic ASP.
View 11 Replies
Nov 23, 2010
Just two many pages to re-write. A Microsoft consultant informed us it would cost about $750,000 to rewrite all of our pages. The school district's budget is only $67,500 so this is out of the question. Therefore I am going to have to stick to asp Classic.
View 1 Replies
Jun 15, 2010
I am asking my self many times before start writing a new app or data access library , should I use LINQ to SQL or classic ADO.net , I have used both and the development time I spend on building an app with LINQ to SQL is like the 1/3 compared to ADO.net.
The only think I like using LINQ to SQL is that I don't have to design the domain objects LINQ does that for me and saves me from spend my time on boring things :P But is LINQ to SQL suitable for large scale projects, is there an overhead that we can avoid when using ADO.net ?
View 7 Replies
Jun 23, 2010
I currently work for a company that uses a combination of ASP.NET Webforms and legacy ASP pages for web development. This works fairly well for their current projects but I would like to convince / suggest to them to switch over to ASP.NET MVC since most of their codebase consists of wiring form elements to stored procedure parameters. Just using an ORM is also a possibility but I think it would be a good idea to use this opportunity to switch to an MVC framework.
However, I'm not sure how easy it will be to deploy an ASP.NET MVC app along side ASP.NET and Classic ASP code while the codebase is updated. First, I would like to ask if this is even possible. I've seen threads about running ASP.NET with Classic ASP and ASP.NET MVC with Webforms but not all three in the same application. They currently have Webforms and Classic ASP working together so the pitfalls associated with that are already solved.
View 2 Replies
Mar 15, 2011
I've tried to do my homework on this...
I'm migrating a site from classic asp to asp.net 4.0
Before I rework all the code, I wanted to get clarification that the way i think my database code should be updated is fairly correct. (I'm using SQLClient objects)
First, when old code would use forward only recordsets or access single record/value, I'm fairly sure i'd use SqlCommand and SqlDataReader. That is pretty straightforward.
Now, when my old code navigates a recordset (movePrevious, find, etc.)... I believe the way to go is with SqlDataAdapter and DataTable to retrieve the data and DataView to filter/find/navigate the data.
I'n looking to do a quick migration... i don't want to get too bogged down in the new entity framework... so - just trying to stick with similar objects/logic.
I know this is one of those questions that doesn't really have a right/wrong answer... and I think that is part of my problem in finding an answer - there are so many.
View 2 Replies
Dec 4, 2010
some automated tools to help in migrating classic ASP to ASP.NET I tried to install "ASP to ASP.NET 1.x Migration Assistant" from the link below but it encountered a problem during installation. Has anyone used it? Any other better tools? I know everything cannot be automated but I would imagine there are some tools out there. [URL]
View 6 Replies
Jun 1, 2010
We are in design phase of a project whose goal is replatforming an ASP classic application to ASP.Net 4.0. The system needs to be entirely web based. There are several new requirements for the new system that make this a challenging project:
The system needs to be database independent. It must, at version 1.0, support MS SQL Server, Oracle, MySQL, Postgres and DB2. The system must be able to allow easy reporting from the database by third party reporting packages. The system must allow an administrative end user to create their own tables in the database through the web based interface. The system must allow an administrative end user to design/configure a user interface (web based) where they can select tables and fields in the system (either our system's core tables or their own custom tables created in #3) The system must allow an administrative end user to create and maintain relationships between these custom created tables, and also between these tables and our system's core tables. The system must allow an administrative end user to create business rules that will enforce validation, show/hide UI elements, block certain actions based on the identity of specific users, specific user groups or privileges.
Essentially it's a system that has some core ticket tracking functionality, but allows the end user to extend the interface, business rules and the database. Is this possible to build in a .Net, Web based environment? If so, what do you think the level of effort would be to get this done? We are currently a 6 person shop, with 2.5 full time developers.
View 5 Replies
Mar 28, 2011
I am new to ASP and ASP.net.I have just started working on a legacy ASP classic project and been given a sample that makes a remote call in ASP.net.Is it possible to call the ASP.net page from ASP?Are you they compatible.My impression so far is that they aren't compatible, but perhaps. I'm wrong.I mean the .net project could be called with parameters and kept seperate I guess?Does anyone have any experience with similar problems or have any tips they can share?
View 2 Replies
Jan 25, 2011
We have a big classic ASP website, and we want to start writing new code in .net, (the website is way to big to rewrite 100% at this stage).
The old website uses session variables, will these still be accessible in the .net pages, and if not (which I suspect) is there anything we can do to make them accessible?
The new section is detachable, that is it is pretty much independent from the rest of the site so should be fine to write in .NET, it's just sessions which are important to us. Do we need another login page?
How bad practise would it be to ajax a local .net page which sets session info when they login to the old site? Can we copy session data this way?
View 1 Replies
Feb 7, 2010
I know S#arp architecture is built for ASP.NET MVC. But I'm wondering if it can be used in classic ASP.NET (WebForms) or even desktop applications like WinForms or WPF.
View 3 Replies
Jan 24, 2011
We have a site and a logged in section of the site that all was written in classic asp. We are starting to convert the site pages to asp.net 3.5. We are starting with the easiest pages (text mainly) first then we will rewrite the web application part of the site.
My question is - Is it possible to run the new asp.net 3.5 pages with classic asp pages? Or will we need to rewrite everything before deploying?
View 1 Replies