CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 onchange event

Print topic Send  topic

Author Message
mr_medhat

Posts: 16
Posted: 07/11/2006, 11:38 AM

Dear Gentlemen ,

I want to refresh a form with an “onChange” event of a listbox , I want to preserve the value of another listbox ,, in ASP I used :


window.location.href = "Students_maint.aspx?yearID=" + this.value
+ “&Grade_ID=" + Students.Grade_ID.value ;


Please , What is the same code for VB.Net


PS.
The form name is Students
The 2 Listboxes are yearID and Grade_ID

Thanks in Advance
View profile  Send private message
mr_medhat

Posts: 16
Posted: 08/23/2006, 3:52 AM

Please ......... Any Reply !!
View profile  Send private message
Stan
Posted: 08/28/2006, 11:21 PM

This code should work for .NET. The only difference, that .NET use one html form per page. And control's name contain both form name and control name itself. So refernece to the second control will looks as Students_Grade_ID.value

Stan
mr_medhat

Posts: 16
Posted: 08/29/2006, 1:18 AM

Dear Stan ,
I’ve tried all the possible naming references and still none of them refreshed the page , Note , I get a small error in the IE status bar “Error on Page”

I’ve tried :
Students_Grade_ID.value
Students_Grade_ID.value ;

StudentsGrade_ID.value
StudentsGrade_ID.value ;

Note : The page refreshes if it’s only one parameter given , meaning that this line alone works fine :
window.location.href = "Students_maint.aspx?yearID=" + this.value

Thanks for your Help
View profile  Send private message
Stan
Posted: 08/29/2006, 8:03 AM

The ID should look as Students_Grade_ID. You can view source of HTML page in browser and find it.
Also you can try the following syntax
document.getElementById("Students_Grade_ID").value
mr_medhat

Posts: 16
Posted: 09/02/2006, 1:11 PM

No Stan , nothing made this work for me ,,,

Please , if you have the time , try to create a test page with 2 listboxes and find the onchange code (on the second listbox ) that refreshes the page with the 2 listboxes values as URL parameters .

I use VB.Net with .Net Framework ver. 2.

Thanks in advance.
View profile  Send private message
mr_medhat

Posts: 16
Posted: 09/23/2006, 4:00 PM

Can anyone please help me with this issue !!!
View profile  Send private message
Stan
Posted: 09/25/2006, 8:43 AM

I created a form with the same controls as in your example. The working code is looked as following:

window.location.href = "OnChangeTest.aspx?yearID=" + this.value + "&Grade_ID=" + document.getElementById("StudentsGrade_ID").value;

mr_medhat

Posts: 16
Posted: 09/27/2006, 3:57 AM

Dear Stan ,
You are a life saver , It works beautifully ;-)
I’m sure plenty of people will use your useful post for few months to come.
Thank you very much.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.