HtmlInputHidden Control

Discussion in 'ASP .Net' started by Julius Fenata, Jan 18, 2005.

  1. Okay,

    I have pass new value from client to server, like this:

    <script language="JavaScript">
    function JSGenerateArticleID()
    {
    HiddenValue.value = "test";
    }
    </script>
    ...

    <input id="HiddenValue" type="hidden" runat="server">


    Then, I need to use this value on Code Behind, like this:

    protected System.Web.UI.HtmlControls.HtmlInputHidden HiddenValue;
    ...

    private void btnAdd_Click(object sender, System.EventArgs e)
    {
    clsArticle m_oArticle = new clsArticle();
    m_oArticle.InsertArticle(HiddenValue.Value); // Not Working
    BindingDataGrid();
    }


    Why after I have web-controls HiddenValue the Value is still null? Or,
    Server-side did not recognize HiddenValue?

    ps: What is relation between this control with AutoEventWireUp="true"?

    Thx,
    Julius F

    =================================================

    Hi Julius,

    You have to pass the new value from client to server separately, the Label
    element won't do it for you. There is a number of ways for doing this, most
    common one is via a hidden <input> element.

    Eliyahu
    Julius Fenata, Jan 18, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jiho Han
    Replies:
    2
    Views:
    1,896
    Jiho Han
    Feb 11, 2004
  2. Replies:
    6
    Views:
    1,912
  3. Jack
    Replies:
    4
    Views:
    2,024
  4. Ma³y Piotruœ

    ASP.NET: HtmlInputHidden = Nothing

    Ma³y Piotruœ, Dec 4, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    610
    Ma³y Piotruœ
    Dec 4, 2005
  5. Scott
    Replies:
    1
    Views:
    572
    Scott
    Nov 26, 2004
Loading...

Share This Page