G'Day,
I have a combobox that has the following child controls - cbDBButton (HtmlInputButton), cbDBHidden (HtmlInputText), and cbDBText (TextBox). I have declared each of these child controls on the server-side.
Ie, cbDBButton is declared as:
Public WithEvents cbDBButton as new System.Web.UI.HtmlControls.HtmlInputButton
Then, in the page_load, i declare the following:
cbDBButton = cbDB.ProcessButton
cbDBButton.ID = "cbDBButton"
cbDBButton.Attributes("runat") = "server"
cbDBHidden = cbDB.Hidden
cbDBText = cbDB.TextBox
cbDBText.Attributes("onchange") = "DumpData();"
'(NB that cbDB is the combobox control)
Ok, now the DumpData() function gets called fine (javascript). However, what i need to do from here is force the cbDBButton's serverclick event, so that it can call the sub which handles the event.
I have tried the following:
Document.Form1.cbDBButton.click();
But, i get the following error:
'Document.Form1.cbDBButton' is null or not an object.
How can i force the cbDBButton.click() event from the client without getting this error?
A quick reply would be excellent.
Ta,
Michelle
I have a combobox that has the following child controls - cbDBButton (HtmlInputButton), cbDBHidden (HtmlInputText), and cbDBText (TextBox). I have declared each of these child controls on the server-side.
Ie, cbDBButton is declared as:
Public WithEvents cbDBButton as new System.Web.UI.HtmlControls.HtmlInputButton
Then, in the page_load, i declare the following:
cbDBButton = cbDB.ProcessButton
cbDBButton.ID = "cbDBButton"
cbDBButton.Attributes("runat") = "server"
cbDBHidden = cbDB.Hidden
cbDBText = cbDB.TextBox
cbDBText.Attributes("onchange") = "DumpData();"
'(NB that cbDB is the combobox control)
Ok, now the DumpData() function gets called fine (javascript). However, what i need to do from here is force the cbDBButton's serverclick event, so that it can call the sub which handles the event.
I have tried the following:
Document.Form1.cbDBButton.click();
But, i get the following error:
'Document.Form1.cbDBButton' is null or not an object.
How can i force the cbDBButton.click() event from the client without getting this error?
A quick reply would be excellent.
Ta,
Michelle