Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class home : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- private string chatitems
- {
- get
- {
- if(Application["un"]==null)
- Application["un"] = "";
- return Application["un"].ToString();
- }
- set
- {
- Application["un"] = value;
- }
- }
- protected void Timer1_Tick(object sender, EventArgs e)
- {
- Label1.Text = chatitems;
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- chatitems = txt.Text + "<br />" + chatitems;
- }
- }
- <input id="submitButton" type="submit" value="Submit"/>
- </body>
- <script type="text/javascript">
- // select the button element
- var button = document.getElementById('submitButton');
- // add an event listener for the on click event.
- button.AddEventListener("onClick", function(){
- var txt = document.getElementById('<%=txt.ClientId%>');
- // I suppose that you will define the chatitems somewhere above, because I don't //get its use, reading your code.
- chatitems += txt.val()+"<br/>";
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement