Page.RegisterHiddenField does not work!

G

Guest

Are there any known restrictions on where Page.RegisterHiddenField will work? It seems to only work in the Page_Load event...My code below fails to render it in the page's source

I would like these values to be used by some client-side javascript. If I can't use the register methods here, how can I make the data grid's clicked values availble in the Page_Load's Postback? Thanks, Dave

private void dgGrid_ItemCommand(Object src, DataGridCommandEventArgs e

if (e.Item.ItemIndex >= 0)

//--Get the posted values from the datagrid..
dgPortfolio.SelectedIndex = e.Item.ItemIndex
string sId= dgGrid.DataKeys[e.Item.ItemIndex].ToString()
string sName= dgGrid.SelectedItem.Cells[2].Text
Page.RegisterHiddenField("Id", sId)
Page.RegisterHiddenField("Name", sName)


}
 

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

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top