Click here to Skip to main content
11,503,750 members (76,724 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET WebForms VB.NET
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 9-Jan-13 20:19pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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

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
  Permalink  
Comments
danait25 at 24-Jan-13 0:58am
   
Hi
thanx but I was looking for a conditional refresh , otherwise I would use meta refresh http-equiv which is much more simple
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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:

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:

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

then the button:

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

and the function:

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

I also had to use session for my parameters but all in all - it works now
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Page.Response.Redirect(Page.Request.Url.ToString(), true);
  Permalink  
Comments
danait25 at 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
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

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()
  Permalink  
v2
Comments
danait25 at 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)



Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 23 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100