How do I get a HTML button server side accessible in the code behind
-
Hi All, What it needs to be done to access HtmlInputButton I have created one button (html controls) but when I create its nomenclature in the code behind as protected System.Web.UI.HtmlControls.HtmlInputButton btnSave; after that in page_load iam using this button as btnSave.Attributes.Add("onclick", "ValidateControls()"); During the run, I am getting "Object reference not set to an instance of an object." Why is that so ?? where I am going wrong ? Iam not able to use that html button let me know Sreenath
-
Hi All, What it needs to be done to access HtmlInputButton I have created one button (html controls) but when I create its nomenclature in the code behind as protected System.Web.UI.HtmlControls.HtmlInputButton btnSave; after that in page_load iam using this button as btnSave.Attributes.Add("onclick", "ValidateControls()"); During the run, I am getting "Object reference not set to an instance of an object." Why is that so ?? where I am going wrong ? Iam not able to use that html button let me know Sreenath
You need to put in an
id
not aname
. e.g.<input type="button" **id**="btnSave" runat=server value="Save" />
regards, Paul Watson Bluegrass South Africa Miszou wrote: I have read the entire internet. on how boring his day was. Crikey! ain't life grand? -
You need to put in an
id
not aname
. e.g.<input type="button" **id**="btnSave" runat=server value="Save" />
regards, Paul Watson Bluegrass South Africa Miszou wrote: I have read the entire internet. on how boring his day was. Crikey! ain't life grand?Thanks for your reply, Actually, an id is what I have. Here is a snippet of code of what I have
<form id="Form1" method="post" runat="server"> **<asp:textbox id="txtNumber"** _onkeyup="return txtQuoteNumber_onkeyup()"_ style="Z-INDEX: 101; LEFT: 24px; POSITION: absolute; TOP: 32px" runat="server" AutoPostBack="True"> </asp:textbox> **<asp:textbox id="txtFrmClient"** style="Z-INDEX: 104; LEFT: 400px; POSITION: absolute; TOP: 40px" runat="server"></asp:textbox> **<asp:textbox id="txtFrmServer"** style="Z-INDEX: 105; LEFT: 400px; POSITION: absolute; TOP: 80px" runat="server"></asp:textbox> **<asp:button** id="btnGet" style="Z-INDEX: 102; LEFT: 240px; POSITION: absolute; TOP: 32px" runat="server" Text="Get Quote"></asp:button> **<asp:datagrid** id="dgQuotes" style="Z-INDEX: 103; LEFT: 24px; POSITION: absolute; TOP: 88px" runat="server"></asp:datagrid> </form>
now I also havefunction txtQuoteNumber_onkeyup() { //I want to be able to update one control from the other, for example txtFrmClient.value = txtQuoteNumber.value }
Bsically I want to be able to update when another control gets updated, ultimately what I want to be able to do, is from theonkeyup
function I want to force the grid to update Thanks for your help