Click here to Skip to main content
15,886,091 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I have a form with 4 panels in it - and they are using parameters from serverside when loading each one.
On the first 3- I click on a button (I can choose from several buttons in the same panel) and on the last one there's a table with details relaying on the buttons I clicked before.

Now, I want that whenever I change something in another form, it will automatically refresh the first one (I need to see the change in the table on the last panel).
Just to be clear - I don't want to reload the page but only to REFRESH it.

I used window.opener.location.reload() but I'm getting a messegebox saying:
"The page cannot be refreshed without resending the information. Click Retry to send the information again".

After I looked all over the net for a solution, I can't find a solution that will allow refreshing the page and not showing this messege.

At some point I added in the form method="get" <form id="form1" runat="server" method="get"> and the messege stopped showing but now when I want to choose to click another button I can't do post....

So .. can you help me?
maybe there's another way than using panel / update panel and also not openning the table in a different form??


thanks
Posted

use timer interval 1 so it refresh your data every 1 second...

VB
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Dim connectionstring As String = "Driver=MySQL ODBC 3.51 Driver;Server=localhost;port=3306;uid=root;pwd=admin;Database=elcott;"
        Dim conn As New OdbcConnection(connectionstring)
        conn.Open()
        Dim da As New OdbcDataAdapter("select * from Userpass where Username like '%" & txSearch.Text & "%'", conn)
        Dim ds As New DataSet
        da.Fill(ds)
        DataGridView1.DataSource = ds.Tables(0)

        Dim da1 As New OdbcDataAdapter("select * from logs where Username like '%" & txSearch.Text & "%'", conn)
        Dim ds1 As New DataSet
        da1.Fill(ds1)
        DataGridView2.DataSource = ds1.Tables(0)
        conn.Close()
    End Sub
 
Share this answer
 
Comments
danait25 24-Jan-13 0:58am    
Hithanx but I was looking for a conditional refresh , otherwise I would use meta refresh http-equiv which is much more simple
More complicated than I wish to, but eventually I put on my child form this script that refer to a method on my parent form:

JavaScript
window.opener.createpostbackbyclick();


then, on my parent form I added an inivisible button that onclick, update my panel and by that, refresh the page. And the I do the click from the method I created (the same one I called on the child form)

first the method I created:

JavaScript
function createpostbackbyclick()
{
document.getelementbyid("btnclick").click();
}


then the button:

ASP.NET
<asp:button id="btnclick" runat="server" onclick="refreshme" visible="false" xmlns:asp="#unknown" />


and the function:

JavaScript
function refreshme()
{
netpanel.update();
}


I also had to use session for my parameters but all in all - it works now
 
Share this answer
 
Page.Response.Redirect(Page.Request.Url.ToString(), true);
 
Share this answer
 
Comments
[no name] 10-Jan-13 2:22am    
http://www.aspdotnet-suresh.com/2012/08/auto-reload-refresh-page-using-jquery.html
danait25 10-Jan-13 3:21am    
I don't understand how to use your solution- where do I need to put it?
If I write it in the code behind of the child page it do nothing..

And about your comment - I can see there only ways to refresh from the same form and not from another page
thanx
use

Server.Execute(path);

this will refresh another page from a page

you can call function and in that function write code for refresh page .

Read about server.execute()
 
Share this answer
 
v2
Comments
danait25 24-Jan-13 0:59am    
I'll check it out, though I found a sort of solution .
thanx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900