views:

10309

answers:

3

Hi, I created an Ajax website in Visual Studio, added a simple page with a textbox and button, when I click the button once everything works, when I click it twice I get the error

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500

Here is my page

<form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</form>

        Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        TextBox1.Text = "aaa"
    End Sub

Edit ~ I added a second button to the page, outside of the update panel and when I clicked the one inside the update panel and then the one outside of the panel I got the error

Cannot open database "ASPState" requested by the login. The login failed. Login failed for user 'server\user'. 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.Data.SqlClient.SqlException: Cannot open database "ASPState" requested by the login. The login failed. Login failed for user 'server\user'.

Why is this?

Edit ~ To resolve my issue I did

<sessionState mode="StateServer"
stateConnectionString="tcpip=localhost:42424"
cookieless="false"
timeout="20"/>
A: 

Have you tried: http://forums.asp.net/t/1044963.aspx

And also, try to remove the "TextBox1.Text = "aaa""-line, and see if you still are getting errors.

Israr Khan
I tried adding ValidateRequest="false" to the page and also removed the code behind, same crap!
Saif Khan
A: 

Looks like your problem was that your session state was configured to use a SQL server, and you changed it to the state server service to get it to work. Have you also tried InProc session state?

Robert Wagner
A: 

in Web.config add this validateRequest="false" enableEventValidation="false"

to the pages section

atefkabani