c# - asp:Button not responding to clicks with OnClick -
i seem having problem button's onclick, doesn't react @ event. responds onclientclick , executes code, when try relate o function in .aspx.cs class ignores it, , should executing simple code (writing output debug)
i've checked every other stackoverflow post find , no 1 had same issue.
i know index.aspx executing code inside index.aspx.cs because page_load function outputting debug window, that's not problem.
here's important code:
<asp:button id="btncreateorder" runat="server" text="create order" onclick="btnclick" /> protected void btnclick(object sender, eventargs e) { system.diagnostics.debug.write("testing3"); }
like said page_load function working fine it's not issue of them not being connected.
different problem if feel inclined:
while you're reading, have problem of not being able find objects html in cs file.
what mean is, if reference label:
<asp:label id="testlabel" runat="server" text="test"></asp:label>
by saying
testlabel = "test2";
i error "the name 'testlabel not exist in current context"
and if try reference saying this:
index.testlabel = "test2";
i "'myproject.views.home.index' not contain definition 'testlabel'" though does.
maybe .designer file bad.
try this: delete .designer.cs file of .aspx page, right-click on , select 'convert web application' option.
edit: button event, how did generate method stub click event? did click button on designer view twice , visual studio generated id or did handcoded it?
try delete both button , button click event, , when declare button again, double click on designer view.
Comments
Post a Comment