How to reload page in VB.Net using a click event

Posted on 2006-03-28
Last Modified: 2012-06-22

I have a web form with a button that when a user clicks on a button it should insert report values
into database. On my form I also use a data list to show all the reports that were
created by the user. So my question would be how can you reload a page in VB.NET that when  
user will click the button it would show all the current reports plus the newest one.


For example:

so on ...

<asp:button id="btnInsert" style="Z-INDEX: 103; LEFT: 352px; POSITION: absolute; TOP: 88px"
runat="server" Width="161px" Text="Create Report"></asp:button>
Question by:avi4
    LVL 10

    Accepted Solution

    at the end of your sub button_click event add this:

    Me.RegisterStartupScript("MyKey", "<script language='javascript'>window.location.reload();</script>")
    LVL 12

    Assisted Solution

    The page should reload itself when you click any <asp:button> unless you are using output caching.
    LVL 25

    Assisted Solution

    As bsdotnet said, the page will be posted back when the button click event will be fired. In the button_click event, you can call the datalist databinding method to show the update records e.g.:

    Private sub Button1_Click(sender as object, e as eventargs)Handles Button1.Click
    end sub

    LVL 22

    Assisted Solution


    If you want to reload the page without submitting the page then you can use vbscript or javascript in you page to create the XMLHTTP object and do a post to the aspx page that adds the new report to the database and returns the updated colletion of reports. The response can be handled in the script to show the report list


    Author Comment


    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now