.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Page Refreshing

Posted By: Aamrapali Tamgadge     Posted Date: March 03, 2011    Points:2   Category :ASP.Net
Hi. i am having one online test application. When test starts popup will open in aspx page and there are many section in test for which i have taken the buttons.When i click on next button to go to the next section the page get refresh how can i avoid this.

Author: Sunil Yadav       [Moderator]      
Posted Date: March 03, 2011     Points: 20   


Could you explain what is the next section i.e. is it control or page?

Also to avoid post back you can use asp.net ajax update panel for the control causing a postback.

Author: Aamrapali Tamgadge             
Posted Date: March 03, 2011     Points: 20   

Actualy I have Loaded all the questions of all the section at once in one gridview..and makin visible true false for each button to which i hve given the section name..in left side i have answers gridview and right ques.grid ond at the top four buttons for four section..i hv used the update panel even i have given the postback but still it gettin refresh..

Software Programmer At OTIS ISRC
Author: kamlesh             
Posted Date: March 04, 2011     Points: 20   

One is Javascript

setTimeout("location.reload(true);", timeout);

The second is a Meta tag:

<meta http-equiv="refresh" content="600">

You can set the refresh intervals on the server side.


To refresh web page after some time period you can use HTML meta tag. This line placed inside of <head > tag will refresh web page every 10 seconds:

<title>Untitled Page</title>
<meta http-equiv="refresh" content="10">

You can implement this dynamically too. Let say that this refresh period is not constant and you need to be able to change it in settings area of your ASP.NET application. You can achieve this if you set ID parameter and add runat="server" part, like this:

<meta id="RefreshPeriod" runat="server" http-equiv="refresh" content="10" />

After that, in code behind you can manipulate with refresh period. Let say you want to refresh page every 5 seconds:

[ C# ]

public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
// Set refresh period in seconds
RefreshPeriod.Content = "5";

Thanks And Regards.
Kamlesh Nikam
Author: Aamrapali Tamgadge             
Posted Date: March 04, 2011     Points: 20   

how to use the javascript to set the timeout and wer to call the dat function

Software Programmer At OTIS ISRC
Author: Aamrapali Tamgadge             
Posted Date: March 04, 2011     Points: 20   

I hv used this meta tag but it is for refreshing the page aftr sometime but my problem is dat it already getting refresh on button click i want to avoid dat.

Software Programmer At OTIS ISRC
Author: Maverick             
Posted Date: March 04, 2011     Points: 20   

use update panel for ur button
keep the button in update panel and set the postback property= false
ur button

<asp:PostBackTrigger ControlID="lnkAddFiles" />
<asp:PostBackTrigger ControlID="lnkDownload" />
<asp:PostBackTrigger ControlID="lnkBtnDownload" />
<asp:PostBackTrigger ControlID="ImgFile" />

Author: Karthikeyan Anbarasan       [Moderator]      
Posted Date: March 04, 2011     Points: 20   


You basic question is you no need to refresh the page when it post back rt?

Use AJAX control with the ajax control tool kit

Mark as Answer if the answer solves your issue!!!

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend