You must Sign In to post a response.
  • Category: ASP.NET

    Hidden field value for different user

    I have created one page having textbox,button and many more control.User can write text in textbox,I am calling javascript function on keyup of textbox.Javascript function count letter entered into textbox.If it is greater than 80,it check the checkbox.User is able to see checked checkbox.Every thing is working fine.On button click event I am getting checkbox.checked = false if user has already seen checkbox is checked.So I have created javascript function which I call on button click event,in that function I am checking, checkbox is checked or not. if it is checked assigning 1 to hidden field if not zero.I know hidden field is client side management and it is at page level.My question is if there 3 user,everybody is writing at same time,everybody will get value he/she set or diff

    What I have tried:

    <script language="Javascript" type="text/javascript">

    function CheckStatus()
    {

    if (document.getElementById('ChkMsg').checked == true)
    {
    document.getElementById('hiddenfieldIschk').value = '1';
    }
    else
    {
    document.getElementById('hiddenfieldIschk').value = '0';
    }
    }
    </script>

    <asp:Button ID="btn" runat="server" Onclientclilck="return CheckStatus();" onclick="btn_Click1" />
    <input type="hidden" id ="hiddenfieldIschk" runat="server" />
  • #766413
    Hi
    ofcourse the value updating one by one user may be last user values
    only contains the hidden field. So you can handle first request you
    give the priority then we can restrict remaining users post.
    you can also create roles etc admin,user also only allow
    admin people only for this .

    Name : Dotnet Developer-2015
    Email Id : kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • #766414
    @Dotnet Developer-2015,thanks for ur reply.Sorry I did not get u.According u last one value only get save at hidden field.

  • #766415
    Hi
    pinky

    First set in your Db(Table) one status field .
    When the user first Request post you can update that status field like this
    "UPDATE" then remaining people try to that checkbox you will check them this is already update like this


    try this code



    select count (*) from table name where status='UPDATE'
    if(count>0)
    {
    true
    }
    else
    {
    false;
    }


    try and let me know or send your code mail me.
    Required: Dbscript , aspx, C# code etc zip file

    My id is : kumaraspcode2009@gmail.com

    Name : Dotnet Developer-2015
    Email Id : kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • #766423
    Hiddenfield is client side statement management technique, it will work differently for each user, so in simple terms all user will get their different values so you don't have to worry about it
    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]


  • Sign In to post your comments