[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Getting / Setting asp.net hidden control value based on id using JQuery

Posted on 2011-02-21
4
Medium Priority
?
1,104 Views
Last Modified: 2012-08-14
Hi,

How to Get/ Set asp.net hidden control value based on id using JQuery

Thanks,
Ajay Varma
0
Comment
Question by:ajayvegesna02
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 14

Accepted Solution

by:
robasta earned 2000 total points
ID: 34941988
0
 
LVL 14

Expert Comment

by:robasta
ID: 34941996
0
 
LVL 10

Expert Comment

by:P1ST0LPETE
ID: 34943332
Here is a simple working demonstration for you:

 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function ()
        {
            $('#btGet').click(function ()
            {
                var value = $('#hiddenfield1').val();
                alert(value);
            });

            $('#btSet').click(function ()
            {
                var value = $('#textbox1').val();
                $('#hiddenfield1').val(value);
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:HiddenField ID="hiddenfield1" runat="server" Value="ABCD" />
        <span>Hidden Field 1:</span>
        <asp:TextBox ID="textbox1" runat="server" Text="1234" />
        <asp:Button ID="btGet" runat="server" Text="Get" />
        <asp:Button ID="btSet" runat="server" Text="Set" />
    </div>
    </form>
</body>
</html>

Open in new window

0
 
LVL 10

Expert Comment

by:P1ST0LPETE
ID: 34943348
Oops, didn't realize you had already closed out the question.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question