ASP.Net Frameset reload

I have two frames, each contains one .aspx file.

When I click the button in the first frame, the second frame content need to be reloaded.

--------------------
I use the codeing:

Button1.Attributes.Add("onclick", "window.parent.frames('Main').location.href('MainFrame.aspx');")

in the button click event of the first frame.

---------------------

My problem is:

- When I click the button in the first frame for the first time, it is not reloading the .aspx file in the second frame, but it reloading for the second click. Why it is

Can anybody help me...


Nelson.




Answer this question

ASP.Net Frameset reload

  • djellison

    Hi!

    Thanks for asking!  I'm a member of the ASP.NET team, and was just popping over here to see what was going on.  The best place to ask ASP.NET questions is over on the ASP.NET forums at http://www.asp.net/welcome.aspx tabindex=1&tabid=39

    HTH,
    PEte



  • Thomanji

    Place the line of code you mentioned in the Page_Load event instead of in the button's click event. This is what seems to be happening right now:

    1. Page loads for the first time, Button1 does NOT have the "onclick" event attached.
    2. You click Button1, the page posts back since the click handler isn't attached yet.
    3. The Button1_Click event fires, which now attaches the "onclick" handler.
    4. You click Button1, the inline javascript fires, and the page in the other frame loads.

    This is why the frame only reloads on the second button click.

  • Oranso

    Thanks for the reply.

    Now, I am designing a web page in ASP.NET containing tab control, which need have functionality like vb6 tab control. How i do it

    Please help with code or relatedl inks.

    Nelson.< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />



  • Brasiliansbr

    Try asking over in the ASP.NET forums and you'll likely find more info there!

  • Rehfeldt

    Thanks for the answer.

    Now I am designing a web page in ASP.NET containing tab control, which need have functionality like vb6 tab control. How i do it

    Please help with code or related links.

    Nelson.< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />


  • ASP.Net Frameset reload