VB.NET - Web App - Force Page Refresh

F

Fred Nelson

Hi:

I have a VB.NET web application and I need to find a way to cause a page
refresh from within my application.

Does anyone know how to force the browser to refresh the current page?

Thanks very much for your help!

Fred
 
M

Mitchell Vincent

Fred said:
Hi:

I have a VB.NET web application and I need to find a way to cause a page
refresh from within my application.

Does anyone know how to force the browser to refresh the current page?

Thanks very much for your help!

Fred
(untested)

AxWebBrowser2.ExecWB(SHDocVw.OLECMDID.OLECMDID_REFRESH,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT)
 
F

Fred Nelson

Hi Mitchell:

Thanks for your help - I think we are very close.

I have searched MSDN for the ExecWb and found some info but I'm still lost.

Where in my code behind page would I execute the command you gave me:

I'm guessing it would be something like:


dim AxWebBrowser2 as (something)

AxWebBrowser2.ExecWB(command)


Thanks again for your help!

Fred
 
J

Jay Pondy

Add this to the page headers to refresh every 5 minutes.

<meta http-equiv="refresh" content="300">
 
C

Cor Ligthert

Fred,

When it is for the axwebbrowser than this one seems for me the most easy
one.

AxWebBrowser1.Refresh2(3)

I hope this helps,

Cor
 
F

Fred Nelson

Hi Cor:

I'm still lost - I have searched MSDN and don't find an example of calling
this in a VB.NET web application.

I'm assuming the code behind would be something like:

dim AxWebBrowser1 as (something)

AxWebBrowser1.refresh(parms)

Any help would be appreciated!

Thanks again,

Fred
 
F

Fred Nelson

Jay:

Thanks for your help - I think we are getting close.

In the application I'm making a change to an image file and immediately
after that I need to call a page refresh since the image file has been
changed but is not loaded into memory unless I click the refresh button.
The browser continues to display the image before the modification.

My only choices are to generate a page refresh - or if I can't do that then
I will need to make a program change to create a new filename.

So if there was some way to do the following:

Mywebbrowser.refresh (has the same effect as clicking refresh)

Then life would be great!

Your help is appreciated!

Fred
 
M

Mitchell Vincent

Fred said:
Jay:

Thanks for your help - I think we are getting close.

In the application I'm making a change to an image file and immediately
after that I need to call a page refresh since the image file has been
changed but is not loaded into memory unless I click the refresh button.
The browser continues to display the image before the modification.

My only choices are to generate a page refresh - or if I can't do that then
I will need to make a program change to create a new filename.

So if there was some way to do the following:

Mywebbrowser.refresh (has the same effect as clicking refresh)

Then life would be great!

Your help is appreciated!

I apologize Fred, I didn't know you were doing a web application!

I don't know if you can force a refresh on-the-fly in a web application.
 
C

Cor Ligthert

Fred,

Now I see it, please do not leave threads, this is the same qeustion as in
the other thread, for this problem I have given an solution in the original
thread where you have placed this question.

When you want to see it working look than to a previous message in this
thread where is probably as sample the same solution as yours (don't see
this as a production sample).

http://groups-beta.google.com/group/microsoft.public.dotnet.languages.vb/msg/7d428207bfee3402

I hope this helps?

Cor
 
F

Fred Nelson

Cor:

Re: Double Post

This is actually a different question from the other thread so it's not a
"double post". In the other post the focus was on database issues and my
real issue - how to refresh the web page was lost in the sauce.

This post dealt strictly with the need to refresh a web page - and I got
input from people who were not able to help with the first question.

Having tried everything I'm going to give up on the page refresh and modify
my program to create a file with a different name to work around the fact
that nothing else has worked.

Thanks for your help.
 
C

Cor Ligthert

Fred,

funny,

You asked this question to me in that other thread, I gave you the answer, I
took the time to answer you, you did not even look to it.

You asked this than in this message thread, I answered this again with a
complete sample where this problem is done. You did again not look to it.

And than you tells that nobody gave you the right answer.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top