0

Hi All,
I'm using application object in Application.Lock(). But some errors are coming.The errors has been given below.

Error E:\...\StateMgmt\ 25 E:\infonet\in\StateMgmt\Default.aspx.cs 24 'System.Web.UI.HtmlControls.HtmlForm' does not contain a definition for 'Lock' and no extension method 'Lock' accepting a first argument of type 'System.Web.UI.HtmlControls.HtmlForm' could be found (are you missing a using directive or an assembly reference?) 2


Error E:\...\StateMgmt\ 13 E:\infonet\in\StateMgmt\Default.aspx.cs 25 Cannot apply indexing with [] to an expression of type 'System.Web.UI.HtmlControls.HtmlForm' 3

Error E:\...\StateMgmt\ 25 E:\infonet\in\StateMgmt\Default.aspx.cs 26 'System.Web.UI.HtmlControls.HtmlForm' does not contain a definition for 'UnLock' and no extension method 'UnLock' accepting a first argument of type 'System.Web.UI.HtmlControls.HtmlForm' could be found (are you missing a using directive or an assembly reference?) 4

Error E:\...\StateMgmt\ 108 E:\infonet\in\StateMgmt\Default.aspx.cs 27 Cannot apply indexing with [] to an expression of type 'System.Web.UI.HtmlControls.HtmlForm' 5

Can anyone tell me the solution?

2
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by bshyama24@gmail
0

Where is Application.Lock() defined at? I have never heard of it. What is it supposed to do? Can you provide some URLs to read about it?

Edited by peter_budo: [icode] corrected

0

Hi,
the code is in codebehind of a aspx page.
am pasting the code please chk it.

protected void btnSubmit_Click(object sender, System.EventArgs e)
    {
        if(IsValid)
        {
            Application.Lock();
            Application[txtName.Text] = txtValue.Text;
            Application.UnLock();
            lblResult.Text = "The value of <b>" + txtName.Text + "</b> in the Application object is <b>" + Application[txtName.Text].ToString() + "</b>";

        }
    }

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.

0

Please use code tags when posting code:

[code=c#] ....code here....

[/code]

I see that you're calling it -- but what do you think it does? Where did you get that code from? Without knowing where it is defined, it does no good.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.