c# - Creating form tag programmatically not working -
i have simple web page contains literal, want create form tag in code behind. example:
if (ispostback) { literal1.text = "form submit"; } else { literal1.text = "<form id='myfrom' runat='server' action='default.aspx' method='post'><input type='submit' value='click here'/></form>"; } this code create form, when click submit button, doesn't go through ispostback path. why?
note need created , sent string, because want use in ajax example.
ispostback enabled when post request originates asp.net's __dopostback() function. see how use __dopostback() how create async postback request javascript.
Comments
Post a Comment