0

If I have

tow textbox

and 2 button

first button ok and secon is clear or reset

how i can clear the input and input another values??

7
Contributors
13
Replies
14
Views
6 Years
Discussion Span
Last Post by harrypinto11
0

In the second buttons click event you would set the two textboxes to a empty string.

textBox1 = "";
textBox2 = "";

0

In the second buttons click event you would set the two textboxes to a empty string.

textBox1 = "";
textBox2 = "";

Also i want to refresh the form

when i try just this code before; clear the text but still the labels and picture not disapear

and when i input another values the forms is continue not start from the begining

0

I think you should include in your Page_Load Event

label.visible = false;
picture.visible = false

so they will disappear.

0

I think you should include in your Page_Load Event

label.visible = false;
picture.visible = false

so they will disappear.

but I have Alot of Label and picture, which already I Wirte visibale for it

0

If you are loading the pictures and labels proramtically them you must have an idea of which objects are being updated.

Do you know which obkjects you want to clear?

0

If you are loading the pictures and labels proramtically them you must have an idea of which objects are being updated.

Do you know which obkjects you want to clear?

yes, clear text box

and visibale all labels and progressbar and set timer to false

aslo I wanted start the program from the beganning???

0

Well you have not showed any code of what you are doing or trying to do. But I would think that if you want to restart the page fresh then in the button click event for the reset button do a response.redirect

protected void reset_Click(object sender, EventArgs e)
    {
        Response.Redirect("your_page.aspx");
    }

If you find that the Cache is holding the values then you may have to add this in your page load event.

Response.Cache.SetExpires(DateTime.Now.AddTicks(500));
0

Well you have not showed any code of what you are doing or trying to do. But I would think that if you want to restart the page fresh then in the button click event for the reset button do a response.redirect

protected void reset_Click(object sender, EventArgs e)
    {
        Response.Redirect("your_page.aspx");
    }

If you find that the Cache is holding the values then you may have to add this in your page load event.

Response.Cache.SetExpires(DateTime.Now.AddTicks(500));

It is not work , Response is not ddeclear

0

>how i can clear the input and input another values??

Use JavaScript.

<script type="text/javascript">
  window.onload=function()
   {
         var btn=document.getElementById("btn1");
         btn.onclick=function() {
            document.getElementById("txt1").value="";
            document.getElementById("txt2").value="";
         };
    };
</script>

<body>
 <form runat="server" id="form1">
     <asp:TextBox id="txt1" runat="server" />
     <asp:TextBox id="txt2" runat="server" />
     <input type="button" id="btn1" value="Clear" />
 </form>
0

It is not work , Response is not ddeclear

Yes I know that Response.Redirect is not ddclear. First you wanted to know how to clear an input "how i can clear the input and input another values??" so I showed you
textBox1 = ""; which should have been textBox.text = """";

Then you said you wanted to clear everything and start the forms from the begining. Thats why I said Response.Redirect, this way you can load the page from the begining.

Anyway I'm not sure what "ddeclear" is but I do hope you get it working the way that you like.

Take Care

Also i want to refresh the form

when i try just this code before; clear the text but still the labels and picture not disapear

and when i input another values the forms is continue not start from the begining

Edited by Freon22: n/a

0

protected void reset_Click(object sender, EventArgs e)
{
// It will work dear.
textBox1.Text = "";
textBox2.Text = "";
}

0

I want to convert number to word which I enter in the textbox. I try to convert number to word in the textbox in ASP, but it can't work. What may I do?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.