I am generating HTML in page load method in more than 1 page.
All those Generated HTML are the same in all pages.
I found that it is a pain to keep the same code in every page, because once I have to change something, I have to change them in all the pages.
P> Example:
I have In each page's So I decided to create a page creating that content, then load it, the page inside the divas of the other pages means, if I ever need to change, then only I I will change this page. I have created a handler, To include it now, I know that I can use the Whatever I have tried: But I got this error: "Load control" is for "user control", not a HTTP handler. You might be better off creating a user control, which is a .ascx file that can contain HTML, ASPX control and rear code, and can be referenced by any ASPX page. More information here: div in each page:
& lt; Div id = "question" runat = "server" & gt;
page load method, I generate the same HTML.
Question.Internet HTML = "& lt; span & gt; ... etc ... ";
questions.ashx . This handler generates that HTML and sends a response.
JQUERY
.load () function, I want to generate from server side.
Question. Inner HTML = Load Control ("~ / Handler / Question.Shex") .ostring ();
type 'question' system. Web. UI. User control '.
No comments:
Post a Comment