TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
umair mohsin
1k
387
65.8k
page refresh question
Jul 22 2015 4:07 AM
here is my coding
HTML
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="name"></asp:Label>:<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
<br />
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click1"/>
</div>
</form>
</body>
codebehind
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click1(object sender, EventArgs e)
{
if (Page.IsPostBack && TextBox1.Text == "")
{
Response.Write("<h3 style='color:red;'>please fill textbox</h3>");
}
else if(Page.IsPostBack)
{
TextBox1.Text = "";
}
if (Page.IsPostBack)
{
Response.Write("data sened to server is "+TextBox1.Text);
}
}
}
i want that if i refresh the page by pressing F5 all data in the textbox and the server side message should disappear.how could i do that
Reply
Answers (
1
)
Create Program to set an expiry of any uploaded content
interview question