.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Getting "; expected" error in my .aspx page when using vb.script

Posted By:      Posted Date: September 18, 2010    Points: 0   Category :ASP.Net
Using c#.net/asp.net 2005.I am trying to use vbscript if statement in the .aspx page of my page when I'm using c# for the code-behind file.  I'm new to csharp and wondering are you allowed to use vbscript (not vb.net) in the .aspx page?

View Complete Post

More Related Resource Links

Calendar.aspx page Refresh only Once + Java Script

Hi Experts, Following script works perfect (refresh only once after 5 seconds and stops but for some reason if somebody clicks next month then it keeps refreshing for 5 seconds. Can you please put the following code in your calendar.aspx page and check if you can get rid of the continuous refresh if somebody selects next month otherwise it works fine. Please provide the updated script <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <title>Refresh test</title> <script type="text/javascript">   window.onload=function(){     url = window.location.href;     qIndex = url.indexOf("?");     if( qIndex != -1 ){       getData = url.substr(qIndex+1, url.length-1);       if(getData != "refreshed=1"){         refresh();       } else {         myDiv = document.getElementById('content');         myDiv.innerHTML = "This is the second and final time the page loaded.";       }    

A customized EditForm.aspx page giving error because it has a "People and Group" field with a "Allow

My customized EditForm.aspx which has a "People and Group" column with the "Allow multiple selections" property as "Yes" was working fine until the Agusust cumulative update was applied into the MOSS server. Now it's giving me the error: "An unexpected error has occurred". Needless to say, when I change the "Allow multiple selections" property to "No", the customized EditForm.aspx page works fine.Forgetting whyMicrosoft introduced this error for now, is there a workaround that you are awre of?

IE script error (object expected) on treeview

Hi,Just starting out with the CSS adapters and have implemented a treeview. Works fine in Firefox butIE shows a script error (bottom left) when moving over the tree view. It still goes to the page but there is obviously an issuePage code is in a master page below is the source view in IE<script type="text/javascript">//<![CDATA[var theForm = document.forms['aspnetForm'];if (!theForm) {    theForm = document.aspnetForm;}function __doPostBack(eventTarget, eventArgument) {    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {        theForm.__EVENTTARGET.value = eventTarget;        theForm.__EVENTARGUMENT.value = eventArgument;        theForm.submit();    }}//]]></script><script src="/countrystovesdirect/WebResource.axd?d=KFBAefcFIGtf1hLcg-tm2g2&amp;t=634172878000000000" type="text/javascript"></script><script src="/countrystovesdirect/WebResource.axd?d=S53dmqAagvRk26h8P3H5I9pat_c17l9dW6l04Xdzs9Ai0yVsPFqiIf_M-ylpvzDHp0GeDDnhMnCondcznfbzzw2&amp;t=634201551800000000" type="text/javascript"></script><script src="/countrystovesdirect/WebResource.axd?d=S53dmqAagvRk26h8P3H5I9pat_c17l9dW6l04Xdzs9ACFhsw16G3-NkgCeZFVUFx6W

Strange error trying to Edit new ASPX page in Advanced mode


Steps to duplicate error:

  1. Create new ASPX page in Site Pages.
  2. Right click on it and choose "Edit file in Advanced Mode"

I get this error:
"soap:ServerServer was unable to process request. ---> Value does not fall within the expected range."

I've googled this and haven't found anything that resembles a fix....any ideas?


SharePoint Designer 2007 - Customize List View - Error when saving view ASPX page


We have a custom list definition that includes custom site columns.  When we try to open one of the list view aspx pages in SharePoint to update the view query we get an error when trying to save the page in SharePoint Designer 2007.  We receive a warning that the operation will customize the page from the site definition, which is fine.  And then get a general "Server error: ServiceRequestorID" alert.  ServiceRequestorID is a custom site column used by the list definition.

ServiceRequestorID field definition:

<Field ID="{FA39D24D-AB40-4b1d-BD80-94ABE34A7578}" Name="ServiceRequestorID" DisplayName="Service Requestor ID" StaticName="

[Sharepoint 2007]Parse error when I add code behind the page to a normal aspx page ?


Hi all,

I dont need this form to be embedded into Sharepoint. I am adding this webpage into Sharepoint because i has issues due to cross-domain permission. I cannot call refresh sharepoint from my op up window  webpage. Therefore i want to add my webpage into the same domain as sharepoint.

I have added the webpage aspx form into Sharepoint from the sharepoint designer 2007. I would like to add code behind the page too.

What i have done at the moment was to create a project in visual studio for the code behind the page. I folloed this article :



Then i have added the dll intothe bin of my sharepoint site. i have also added in webconfig the dll.

However i got the following error :

Parser Error Message: The codefile attribute on the page directive is not allowed in this page.

Source Error: 

Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="FormOragniseMeeting.aspx.cs" Inherits="FormOrganiseMeeting.FormOrganiseMeetingCodeBehind" %>
Line 2: 
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">





error.aspx page reports that Page.MasterPageFile = ~/masterurl/default.master not ~/_layouts/simple.


This one is driving me nuts.

I'm intercepting Pages using HTTPModules so that I can change the Master Page before the page loads. This works as expected on everything except error.aspx in the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS folder. Despite the fact that error.aspx specifies MasterPageFile="~/_layouts/simple.master" I keep getting Page.MasterPageFile = ~/masterurl/default.master instead!

Anybody know why this is the case?

IE script error (object expected) on treeview



Just starting out with the CSS adapters and have implemented a treeview. Works fine in Firefox but
IE shows a script error (bottom left) when moving over the tree view. It still goes to the page but there is obviously an issue

Page code is in a master page below is the source view in IE

<script type="text/javascript">
var theForm = document.forms['aspnetForm'];
if (!theForm) {
    theForm = document.aspnetForm;
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;

<script src="/countrystovesdirect/WebResource.axd?d=KFBAefcFIGtf1hLcg-tm2g2&amp;t=634172878000000000" type="text/javascript"></script>

<script src="/countrystovesdirect/WebResource.axd?d=S53dmqAagvRk26h8P3H5I9pat_c17l9dW6l04Xdzs9Ai0yVsPFqiIf_M-ylpvzDHp0GeDDnhMnCondcznfbzzw2&amp;t=634201551800000000" type="text/javascript"></script>
<script src="/countrystovesdirect/WebResource.axd?d=S53dmqAagvR

Getting an error while attaching the master page to custom .aspx


Hi ,

I am getting the following error while I am trying to attach the master page to the custom form

The virtual path '/_catalogs/masterpage/default.master' maps to another application, which is not allowed.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: The virtual path '/_catalogs/masterpage/default.master' maps to another application, which is not allowed.

Actually I am developing the association form in the custom work flow , I am calling the master on the On PreINt event of the page



Error CrystalImageHandler in .aspx login page


I Nhave a asp.net+sqldatabase+vb web application which was working fine now after the editing some pages the eoor below comes please help to rectify


Line 109: <add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></httpHandlers> 

Launch CMD File From ASPX Page


My organization uses a CMD file to install updated files for a major enterprise application. Currently, we send out an email to users with a link to the file and instructions to run it, BUT inevitably users don't update their machines until their in field and try to start the app.


We're now liking the idea of using an ASPX page to prompt the users to run the updates and to capture the fact that the updates have been run. I realize that we can't capture the success or failure of the update. But we'd like to capture the user accessed the page.


Is it possible to embed into the markup for the page a link to the file on the local intranet that the users can click on to run the file?

The user accessing the page would capture that they did just that. We'd deal with wether or not the update was actually installed or if it failed later with them directly.

Handling 404 page not found with Error page



      How do i handle 404 page not found?

Visual Studio closes itself by opening aspx-Page designer after Windows Update


Hey Guys,

I've a problem with my Visual Studio.

On the 13th of August 2010 i installed a Windows update on my vista sp2 pc. For this date my Visual Studio 2008 sp 1 always has closed itself by opening an aspx-page in designer view. There is no error message just closing the window. I restored a backup of my windows from the time before updating it and it helped, i could open aspx pages in the design view till the update has been installed again automatically after rebooting the pc. I can't disable windows updates, cause it's my pc at work and safety is very important. I hope you could help me out of this disaster.



urlrouting - page not found error


I have a dynamic data site setup and running locally fine from vs 2008.

When i deploy to a remote windows 2003 server (IIS6), all the pages also work ok apart from one page/table.  I can access it's list page,  but the edit and insert pages throw 404 errors.

I'm thinking it's a url routing/hosting issue as i've copied back the database from the remote server and it all works fine on my local machine.

Is there anything i can do to debug this behaviour?

Below is my register routes entry from the global.asax

Any suggestions greatly appreciated as, i've been stuck on this for days :(

public static void RegisterRoutes(RouteCollection routes)
    MetaModel model = new MetaModel();
    model.FieldTemplateFactory = new AdvancedFieldTemplateFactory();

    model.RegisterContext(typeof(Sponsorship.Data.Entities), new ContextConfiguration() { ScaffoldAllTables = false });
    model.DynamicDataFolderVirtualPath = "~/admin/DynamicData";

    routes.Add(new DynamicDataRoute("admin/{table}/{action}.aspx")
        Constraints = new RouteValueDictionary(new { action = "List|Details|Edit|Insert" }),

Very Basic Question - Error message running first page


Hi Everyone,

I am running Windows 7 and I have gone into Control Panel and activated all of the IIS Functions.

The web application I am running was downloaded from the net (and has worked on other machines previously).  Once I downloaded it, I moved it into C:/inetpub/wwwroot/code/main.asp

I am a bit of a novice at this!  But I am hoping someone can point me in the right direction!


I get the following error when I try and run the web application through IE:

"An error occurred on the server when processing the URL. Please contact the system administrator. If you are the system administrator please click here to find out more about this error."

(When i click the "click here" button it just goes to the IIS site).


Appreciate any help I can get!




Integrating aspx page in classic asp web application



I have a classic asp web  application. I am trying to add an aspx(C#) page to the existing asp application.

The existing asp pages have include pages for header and footer. How to add the classic asp include files in aspx page.

Also, How to deploy the aspx page in the existing classic asp web application.

Thank you

Flash player doesn't send cookies while requesting an aspx page



 I'm developing a web-site, that uses SWFUpload for multiple files upload to the server. Page, that uploades files, is accessable only to registered user. Authentication is done via web-forms (authentication mode="Forms" in Web.config). Flash uploades files to special web page - upload.aspx. In IE everything works great, but Flash player in non-IE browser (in Firefox, for example) does not send any cookies to upload.aspx. Because of it no sesion and no authentication information is available in this page.

 I can pass all the information, necessary for uploading, in GET-parameters, which upload.aspx recieve. But this is a serious security hole and I don't want to expose session information. I can pass session identifier in GET-request. But the question is the following: how can I restore session information from the session identifier? How can I make HttpContext.Current.User point to currently logged in user in this case?

Any help will be appreciated.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend