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

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

Help please having a problem with asp.net c# web application

Posted By:      Posted Date: October 23, 2010    Points: 0   Category :ASP.Net

I am working at learning visual studio 2010 plus working with asp.net with c# and have run into an error that I seem to not be able to fix. Everything seems ok with the coding, but think I am missing something. I am getting an error "The name 'AuthenticatedMessagePanel' does not exist in the current context" Plus the same errors with 4 other names. The following is what I have: (the lines underlined are the problem childs)


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace WebApplication8
public partial class login : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
if (Request.IsAuthenticated)
AuthenticatedMessagePanel.Visible = true;
AnonymousMessagePanel.Visible = false
AuthenticatedMessagePanel.Visible = false;
AnonymousMessagePanel.Visible = true;


private static voi

View Complete Post

More Related Resource Links

Problem making Role based Menu in MVC application



 I want to make Rolebase menu in MVC such that if user doesnot have permission for some action then that Action name shouldnot be shown in the Menu.

 I have used the code in the url(http://forums.asp.net/t/1566328.aspx) in my MVC application.My application is a Discussion Forum(in MVC) same functionality as in this forum forums.asp.net

 I have used Controllers for post, thread etc.In each controller there are some actions that are using [Authorize(Roles)] attribute

 but this coding does not count  those Actions in Controllers having Authorize attribute according to the url http://forums.asp.net/t/1566328.aspx 

 In the code, Authorize attribute is applied to Controller class, but my requirement is of Applying Authorize attribute to some actions in controller so that some are available for all users and  some links are available rolewise.Now what is the solution for that?



problem in consuming WCF service through Window application


I have a silverlight application and WCF service all made in VS 2010 , i had hosted my site to web server which contain Window 2008 and IIS 7.0

now the problem is i have another application which is a window application developed in VS2008 , when i try to add the service reference it gives me error


The document at the url was not recognized as a known document type.

The error message from each known type may help you fix the problem:

- Report from 'DISCO Document' is 'There was an error downloading 'http://dev_qa.emspa.com/HRDev3/Service.svc?disco'.'.

  - The request failed with HTTP status 400: Bad Request.

- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from '' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

Metadata contains a reference that cannot be resolved: ''.

Content Type application/soap+xml; charset

Problem with Movie Database Application

Hi Im following MVC tutorials on ASP.net website..I have a problem at Movies database application found in http://www.asp.net/mvc/tutorials/create-a-movie-database-application-in-15-minutes-with-asp-net-mvc-cs  Listing 3 - Views\Home\Index.aspx----------------------------------------------------------------------------------------------I dont understand where "Model" refer to in this code <% foreach (var item in Model) { %>  Also im confusing with accessing the database fields using var item Please explaine me what is happening in this code.<% foreach (var item in Model) { %> <tr> <td> <%= Html.ActionLink("Edit", "Edit", new { id=item.Id }) %> | <%= Html.ActionLink("Details", "Details", new { id=item.Id })%> Movie Database Application

Problem with precompiling web application for deployment

Hi,I'm developing a web application consisting of several DLLs. I have no problem whatsoever compiling en building the application from within Visual Studio 2008 itself. But when I try to precompile the application (for deployment) from the VS command prompt, I get compilation errors.One of the errors is: "Could not load file or assembly 'wsCore' or one of its dependecies. The system cannot find the file specified".How can it be that VS2008 is perfectly capable of compiling the application from within the IDE and that same application can't be compiled from the command prompt?What am I missing here?

problem rename sharepoint 2010 search service application admin database

Hi all, i have a problem that hopefully someone has an answer to.  i am not too familiar with sharepoint so please excuse my ignorance. we have sharepoint 2010 on a windows 2008r2 server.  everything seems to work fine.  but as you know, the default database names are horrendous.  i have managed to rename all of them, except for the "search service application" admin database. the default is: Search_Service_Application_DB_<guid> the other 2 databases (crawl and property) were renamed without a problem. we are following the article from technet on how to rename the search service admin db (http://technet.microsoft.com/en-nz/library/ff851878%28en-us%29.aspx).  it says to enter the following command: $searchapp | Set-SPEnterpriseSearchServiceApplication -DatabaseName "new database name" -DatabaseServer "dbserver" however, i get an error about identity being null.  no big deal, i add the -Identity switch and the name of my search service application.  but the real problem comes the error it throws:   Set-SPEnterpriseSearchServiceApplication : The requested database move was aborted as the associated search application is not paused. At line:1 char:54 + $searchapp | Set-SPEnterpriseSearchServiceApplication <<<<  -Identity "Search Service Application" -DatabaseName "ShareP

is there any problem if i create a site collection through programmatically which web application ha

hi all, My web application have 2  types of authentication -- for internal users (windows authentication) and external users (Form based authentication). I am creating site collections through programmatically in the web application. so this site collection should have the permission as form based authentication for external users and windows authentication for internal users. is it possible are not? please give me some suggestions on creating site collections which have form based authentication and windows authentication. thanks in advance......

Firefox 3 problem with Sys.Application.add_load

In the following aspx page, although the ffalert is always displayed, the ff1 alert is only displayed intermitently on a page refresh (about 7 out of 10 times). This works fine with FF2 and IE. FF3.aspx:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="hd" runat="server"> <title>FF3 Test</title> </head> <body> <form id="frm" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> FF3 Test <script type="text/javascript"> function page_load() { alert("ff31"); } window.onload = function () {Sys.Application.add_load(page_load); alert("ff30");} </script> </form> </body> </html>  

Problem create a web application on SharePoint 2007 (Project Server 2007)

I installed a Project Server 2007 in a 3 server structure (all Win 2003 sp2; one for App server hosting Central Admin, Project Server service & Search service; one for web server; one for database server).  They are only in the same domain and I use the same network account for the installation as well as the WSS service account.  The same network are local admin for those 3 servers. All installation & patches seem ok (at least I don't get error messages) until I attempt to create my first Web Application.  After I filled out the web appliction and try to click OK, the page does not change and i saw the java error at the right bottom corner from my IE browser (version 6). The message is .... Line: 1686 Char: 1 Error: 'WebForm_PostBackOptions' is undefined Code: 0 URL: http://myservername:28804/_admin/extendvs.aspx On my SP log, below are the portion of the log when the error happen. 09/09/2010 12:28:29  1  INF        Entering function UserInterface.ShowCentralAdmin 09/09/2010 12:28:29  1  INF          The show central admin command has been chosen 09/09/2010 12:28:29  1  INF          Searching for registry key Software\Microsoft\Shared Tools\Web Server Extensions\12.0\WSS\CentralAdministrati

Problem: Sessions got mixed up when open multiple tab for a sigle application

We got a problem that Sessions got mixed up when open multiple tab in a single application. We could change the code that do not use session variable in a that level, but a tons of page need to be modified. We need to find a quick fix for this problem. Is any thing we can do in code level to prevent user open multiple tab in a single application? O any thing we can do to keep its own session for a single tab?

MVC application problem when running out of Network Service.



I am hosting an ASP.NET MVC 2 application on its own application pool.

Everything works fine if the application pool is running on Network Service with Full Control.

If I make the application pool to run on its application pool identity, even with full control, the web site runs ok but on every page with a form I get the following error:

"Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

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.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster."

Any idea how to solve this problem?

Thank You,


Problem hosting a WPF user control in a windows form application

I have a windows forms application and want to to use WPF inside this application. So I have add a WPF user control into my project. Then I take a ElementHost from the toolbox and put it on my windows forms. The problem is now, when I want to add the WPF control with "Edit Host Content" I get the message "This ElementHost is currently not hosting any editable content....." What's wrong? How can I embed my implemented WPF control into the ElementHost ?

B2B Application architecture problem


I have to design a dot net application which talks to Java and other language modules in both way then what things i should consider first and what different technologies i can use to design .net application.

Problem in creating new web application


I am trying to create new webapplication from central administration

But when I click next to create application it shows me error

Please help

Server Error in '/' Application.

Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.

Details: To enable the details of this specific error message to be viewable on the local server machine, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "RemoteOnly". To enable the details to be viewable on remote machines, please set "mode" to "Off".

<!-- Web.Config Configuration File -->

    <customErrors mode="RemoteOnly"/>

Notes: The current error

Problem with Host an external application in WPF


I wanna host an external application,for example "Notepad.exe" in WPF?I use HwndHost to do so:


    class NetTermHost : HwndHost
        private IntPtr hwndHost;

        protected override HandleRef BuildWindowCore(HandleRef hwndParent)
            Process notePadProc = new Process();
            notePadProc.StartInfo.FileName = @"notepad.exe";


            hwndHost = Win32Native.FindWindow("NotePad", null);

            uint oldStyle = Win32Native.GetWindowLong(hwndHost, Win32Native.GWL_STYLE);
            Win32Native.SetWindowLong(hwndHost, Win32Native.GWL_STYLE, oldStyle | Win32Native.WS_CHILD);


            Win32Native.SetParent(hwndHost, hwndParent.Handle);


            return new HandleRef(this, hwndHost);


        protected override void DestroyWindowCore(HandleRef hwnd)

            HandleRef handleRef = new HandleRef(this, hwndHost);

            Win32Native.SendMessage(handleRef, Win32Native.WM_CLOSE, IntPtr.Zero, IntPtr.Zero);


the Notepad is displayed at my WPF form.But I cannot operate the Notepa

Problem with Same User Name in Different Application ID


I get an error only when Same User Name was created in Different Application ID.

Input string was not in a correct format.

line- gluserID = Convert.ToString(command.ExecuteScalar())

Here is my code

If User.Identity.IsAuthenticated Then
            Dim UserIdentity As MembershipUser = Membership.Providers("CustMembershipProvider").GetUser(HttpContext.Current.User.Identity.Name, False)
            If UserIdentity IsNot Nothing Then
                'auth user
                Dim currentUserID As String = UserIdentity.ProviderUserKey.ToString()
                Dim connectionString As String = ConfigurationManager.ConnectionStrings("EmpCustomData").ConnectionString
                Dim queryString As String = String.Format("SELECT CustomerID FROM Customers INNER JOIN aspnet_Users ON Customers.NetUserID = aspnet_Users.UserId WHERE aspnet_Users.UserI

Excel Services Application - Trusted locations problem in SharePoint Office Excel Web App


Just deployed Office Web Apps to our SharePoint 2010 environment. This environment was upgraded from a fresh deployment of SharePoint 2007 SP2. Configured all of the Application Services per http://technet.microsoft.com/en-us/library/ff431687.aspx, but I cannot open an Excel workbook, receiving the error: "This workbook cannot be opened because it is not stored in an Excel Services Application trusted location. To create an Excel Services Application trusted location, contact your system administrator."

Our farm has a single front end server and a single database server. The shared application pool is called SSP1_v14 (renamed during the upgrade from SSP1?). Our existing site had its visual style upgraded during the conversion. An in-place upgrade had been performed.

I went to Central Administration > Excel Services Application > Trusted File Locations and the default entry for address http://, Location Type: Microsoft SharePoint Foundation, Trust Children had already been created. Various blog posts on the internet indicate that this entry is all that's needed to setup a trusted location for all SharePoint sites, but it's not working here. I've tested Word document viewing with the Word Web App and that works fine.

Any ideas?

Windows application problem targeting any cpu


We currently have a visual basic 2010 application that uses a backend microsoft access 2007 accdb database. Our users have recently reported that since upgrading to office 2010 they can not connect to their databases. We had specifically targeted our application to x86 as the database drivers for 2007 are only 32 bit.

On our developmnent we have now installed Office 2010 64-bit and switched our application to target any cpu. On first doing this the application seems to crash during closing a connection to the database given us no debug information, after looking on search engines  for any helpful information we did find an interesting thread that pointed out 2010 x86 by default. Further investigation has led us to believe it is not the access database drivers that are causing the issue but something else that is specific to 64-bit. We have removed any dlls that we are currently referencing that may be using any unmanaged code, but still get the same issues. Are there any known problems with developing Windows database application 64 bit in Studio 2010 any help or guidance would 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