HtmlInputHidden Control

J

Julius Fenata

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top