Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 6th, 2003, 10:32 AM
Registered User
 
Join Date: Aug 2003
Location: Brussels, , Belgium.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Changing Control Property from another Frame

I sent this question earlier today, but I am not sure it went through. If it did, ignore this.

I have a page in ASP.NET with two frames - Frame1 and Frame2. I would like to change a property of a control in Frame1 as a response to a click event on a button in Frame2. Can someone help with VB/NET script.

Thanks you.

mw

mw
 
Old August 7th, 2003, 12:00 AM
Friend of Wrox
Points: 3,558, Level: 25
Points: 3,558, Level: 25 Points: 3,558, Level: 25 Points: 3,558, Level: 25
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: California, USA
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

u should use JavaScrupt for this! (as I know)
this is a sample to change a color of Frame2's BG from Frame1.

Code:
var windowObject = window.parent.frames["Frame2"];
var newBGColor = document.frmColorChanger.txtBGColor.value;
windowObject.document.bgColor = newBGColor;
HTH.

Always:),
Hovik Melkomian.
 
Old August 7th, 2003, 02:59 AM
Registered User
 
Join Date: Aug 2003
Location: Brussels, , Belgium.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello HTH,
Thanks for your response. I am sure by now you know I am new in this area. Please help me further. The question is: "How do I use JavaScript in my VB.NET page. Do I put it on the OnLoad event. But there is already an OnLoad sub in VB.NET. Please help me here.

Have a nice day.

Michael.


mw
 
Old August 7th, 2003, 04:21 AM
Friend of Wrox
Points: 3,558, Level: 25
Points: 3,558, Level: 25 Points: 3,558, Level: 25 Points: 3,558, Level: 25
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: California, USA
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Dear friend:
First let me welcome u to this world in ASP.NET;)!
I couldnt find ur question so please ask it again or give me its link.
I'll do my best to help u! but I dont know VB & im doing in C#!
if u have problem in JavaScript go to the JavaScript Forum http://p2p.wrox.com/javascript-85/ Ill do my best to help u there!:D
Next if u r new let me tell u something friendly "HTH" means "i Hope This Helps you" & its not my name

Always:),
Hovik Melkomian.
 
Old August 8th, 2003, 01:34 AM
Registered User
 
Join Date: Jul 2003
Location: Olomouc, , Czech Republic.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to admin@martine.cz Send a message via MSN to admin@martine.cz
Default

Hi,

If You can use script for page, use RegisterStartUpScript:

public Sub Page_Load(Sender As Object,e As EventArgs)
      ' Form the script to be registered at client side.
        Dim scriptString As String = "<script language=JavaScript> function DoClick() {"
            scriptString += "showMessage2.innerHTML='<h4>Welcome to Microsoft .NET!</h4>'}"
        scriptString += "function Page_Load(){ showMessage1.innerHTML="
        scriptString += "'<h4>RegisterStartupScript Example</h4>'}<"
        scriptString += "/"
        scriptString += "script>"

             If(Not Me.IsStartupScriptRegistered("Startup")) Then
      Me.RegisterStartupScript("Startup", scriptString)
             End If
   End Sub

For contol on page, you can use Addatributes:

control.Attributes.Add("onKeyDown"," your javascript")

Martin Chundela




Similar Threads
Thread Thread Starter Forum Replies Last Post
changing property doesn't work Vanni VB.NET 4 July 1st, 2005 07:50 AM
Change Buttons Enabled property from another frame TappeBoy VS.NET 2002/2003 7 October 25th, 2004 02:40 PM
onload changing class in other frame jet Javascript How-To 2 October 15th, 2004 09:57 AM
Bound Object Frame Property Needed SerranoG Access VBA 0 April 16th, 2004 10:42 AM
Changing Control Property from another Frame Wandha Forum and Wrox.com Feedback 1 August 5th, 2003 07:43 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.