Re: Code to "click" a button -- is this possible?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Nate
thank you for your reply

are you telling me there is no way that i can then refresh a specific frame
AFTER the server side code is run? that is what i require...ie a way of
calling the javascript you provided.

thanks.

"Nate" wrote:

Ben,

I would not be C# code. It would be javascript. Once the client receives
the HTML output from the ASP.NET page, C# no longer has any control (its all
on the client now). It is important to understand the distinction between
server-side and client-side which is inherit in all dynamic web applications.
The server sends HTML, CSS, and javascript (or jscript or vbscript) to the
client. The client (an Internet Browser, like IE or FireFox) then decides
what to do with the HTML, CSS, and script that was sent to it. One way to
look at is that the web server simply makes a suggestion to the browser. It
suggests it should render certain UI elements and run certain client-side
scripts. Its up to the browser to comply. It doesn't have to. The web
server can't control the actions of the browser. For instance, if a browser
has scripting disabled or isn't compliant with all the CSS that was sent to
it... then it will look and act very differently than it was designed to.
There are ways around this, but it involves detecting the capabilities of the
browser that made a request for the page.

Now, to answer your question. Here is the javascript used to reload a iframe:

<iframe name='content'></iframe>
<script language='javascript'>
parent.frames.item('content').location.href = 'mypage.aspx';
</script>

"Ben" wrote:

could you please supply the code that can be called from the C# method that
will refresh another frame called "Main"?

thanks. I am not familiar with javascripting.

ben

"Ignacio Machin ( .NET/ C# MVP )" wrote:

Hi,

"Ben" <ben_1_ AT hotmail DOT com> wrote in message
news:8407364A-FDA4-424C-B268-C2E80EB9094F@xxxxxxxxxxxxxxxx
Hello

I have frames set up in an asp.net application and need one frame to
refresh
another. Seeing as events need to be registered at the time the page is
sent
from the server, I was wondering if I could place a hidden button in a
frame
that would have the attribute to refresh the other. I would need code to
"invoke" the onclick event (ie i need code to click the button).

is this possible?

you can refresh any of the frames using javascript, you can either Refresh
the frame, submit the form , or call a method to a control (like button
click ) these actions will refresh the form


--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation




.



Relevant Pages

  • Re: Cant get this please help
    ... "DavidF" wrote: ... I have never set up a server, and I don't know if you are planning ... so can doing this add these frame things you are talking about. ... following the links and doing a page refresh. ...
    (microsoft.public.publisher.webdesign)
  • Re: Code to "click" a button -- is this possible?
    ... Once the client receives ... look at is that the web server simply makes a suggestion to the browser. ... will refresh another frame called "Main"? ... I have frames set up in an asp.net application and need one frame to ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Maintaining State Between Web Pages
    ... not limited to what the browser allows. ... <FRAME>, and if that invisible frame contained the VBS code that instantiated ... the current copy of the object reference is lost. ... the server. ...
    (microsoft.public.scripting.vbscript)
  • Re: Maintaining State Between Web Pages
    ... not limited to what the browser allows. ... <FRAME>, and if that invisible frame contained the VBS code that instantiated ... the current copy of the object reference is lost. ... server for the duration of your browser session, if that is what you want. ...
    (microsoft.public.scripting.vbscript)
  • Re: Force a page refresh
    ... Without some definite action from the browser on a client machine No. ... You can't "push" a web page from a server, it has to be "pulled" by a browser http request. ... when the page is visited but the viewer / client still has to either open or "refresh" the page. ...
    (microsoft.public.frontpage.client)