CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.web_forms Tags:
Item Type: NewsGroup Date Entered: 1/19/2006 7:21:39 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 5 Views: 0 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
6 Items, 1 Pages 1 |< << Go >> >|
aspNewB
Asp.Net User
set listbox property form another webpage1/19/2006 7:21:39 AM

0/0

Hi All.

Is it possible for me to do the following

Scenario:
On webform1.aspx I click a button to open webform2.aspx via a javascript function that opens webform2 as modal

On webform1 I have a dynamic listbox that when a certain item is selected it triggers the pop up window that opens webform2. Note- Webform1 is still open.

Now my question is:
Is there any way for me to IMMEDIATELY reset the selectedindex to -1 on the webform1 when I close out the window in webform2.

Many thanks for any assistance.





rich freeman
Asp.Net User
Re: set listbox property form another webpage1/19/2006 4:04:13 PM

0/0

You can add a javascript function to webform2 that has the following code:

function resetList() {
window.opener.document.YourWebForm1NameHere.elements["yourListboxNameHere"].selectedIndex = -1;
}

Then modify the body tag on webform2 like this:

<body onunload="resetList();">

Because webform2 is opened in a new window by webform1, webform2 is still able to access the objects on webform1 with the "window.opener.document" syntax.
aspNewB
Asp.Net User
Re: set listbox property form another webpage1/19/2006 9:24:04 PM

0/0

Nice!  Many thanks!

She works fine for a html control, but am now trying to get it to trigger with a server side control.

Thanks again.

rich freeman
Asp.Net User
Re: set listbox property form another webpage1/20/2006 1:08:58 AM

0/0

It will still work for a server control so long as you reference it by the name that gets rendered in the browser, which won't necessarily be the same name as what you see at design time.
aspNewB
Asp.Net User
Re: set listbox property form another webpage1/22/2006 4:15:15 AM

0/0

Hmm..tried what u said, still not workin 4 me.

Here is a scenario:

Webpage1.aspx (parent)

html side

function launchCenter() { window.showModalDialog("VacCheck.aspx","Parameter1","dialogHeight:470px; "+"dialogWidth:650px;"+ "center: Yes; help: No; resizable: Yes; status: No;"); } <script>

 function launchCenter() {

window.showModalDialog("VacCheck.aspx","Parameter1",...blablabla);
}
 </script>

code side for listbox handler

For i As Int16 = 0 To 2

objButton(i) = New ListBox

With objButton(i)

.EnableViewState = True

.AutoPostBack = True

.Visible = False

AddHandler objButton(i).SelectedIndexChanged, AddressOf Button_Clicks

End With

Next

::

::

sbScript.Append("<script language=""JavaScript"" type=""text/javascript"">")

sbScript.Append("launchCenter();")

sbScript.Append("</script>")

Me.RegisterStartupScript("OpenWindowScript", sbScript.ToString())

WebPage2.aspx (child)

on some click event..or form unload whatever

I need to reset the selected index to -1 of an object (objButton(whatever index)) if necessary

I have a session variable passed no problem form parent to child which passes what id the user is selecting.. Now I have even tried your suggestion without a dynamic control/delegate with a plain ol' listbox dragged onto the form and still can't get a reset to the index.  Hope you can suggest something here. Hopefully somthin can work also without a refresh.

Thanks so much again for any suggestions!!!!! U rock!

Take care.

 

rich freeman
Asp.Net User
Re: set listbox property form another webpage1/23/2006 3:47:51 PM

0/0

I suggest running the script I posted with a plain listbox in Firefox, then check the Javascript console for error messages.  This should point you in the right direction.
6 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Pro C# 2008 and the .NET 3.5 Platform Authors: Andrew Troelsen, Pages: 1370, Published: 2007
Beginning Visual Web Developer 2005 Express: From Novice to Professional Authors: Paul Sarknas, Pages: 334, Published: 2005
Sams Teach Yourself Active Server Pages 3.0 in 21 Days Authors: Scott Mitchell, James Atkinson, Pages: 800, Published: 2000
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic .NET Authors: Rick Dobson, Pages: 660, Published: 2002
JavaScript Bible Authors: Danny Goodman, Michael Morrison, Pages: 1236, Published: 2004
Dreamweaver CS3 Bible: Master Every Aspect of Dreamweaver - Work with CSS, Text, Images, And Links - Incorporate Flash Movies and Other Media Authors: Joseph W. Lowery, Pages: 1112, Published: 2007
Beginning SQL Server 2005 Express Database Applications: With Visual Basic Express and Visual Web Developer Express from Novice to Professional Authors: Rick Dobson, Pages: 596, Published: 2005
Sams Teach Yourself ASP.NET in 21 Days Authors: Chris Payne, Pages: 1077, Published: 2002
Developing and Implementing Web Applications with Visual Basic .NET and Visual Studio .NET: McAd Exam Cram 2 : Exam 70-305 Authors: Kirk Hausman, Mike Gunderloy, Ed Tittel, Pages: 579, Published: 2003
Professional ASP.NET 3.5 in C and VB: In C# and VB Authors: Bill Evjen, Scott Hanselman, Devin Rader, Pages: 1704, Published: 2008

Web:
LEARN MS-ACCESS TIPS AND TRICKS: Create List from another Listbox. Learn MS-Access. Copy and Paste this HTML Code in your Webpage ... When the Form is open the first List Box will be populated with Order Numbers and Customer Codes ... Click on the List Box and display the Property Sheet (View - - > Properties) and ... Dim xinlist As ListBox, strlist As String Set db = CurrentDb ...
Chapter 13 -- Dynamic Web Page Building The bgColor and fgColor properties can be set when the page loads as well as after the page has loaded. .... It also has a length property, and individual form objects are ..... Another method of creating dynamic Web pages is to use client-side .... Then the element for the drop-down listbox is inserted . ...
About creating a list box, combo box, or drop-down list box that ... based on the fields that you select and sets the RowSource property of the ... to populate the list box based on the value of another control on the form. ...
ListBox SelectionMode - bytes NET form. when the form opens, the ListBox SelectionMode is set to Single. ... I have no problems doing that here, in a Windows Form. Are you talking about a Web page? ... On another list, someone said they thought the SelectionMode was a ... set the property, what is it set to, if you read it? ...
Chapter Three Aspx is the start page for any Web application unless another Web form is selected ... It's yet another way to transfer to a different Web page. ... You' ll choose a list box if you need the user to choose more than one item or if ... You must set the selectionMode property to multiple to allow mutliple selections . ...
bc.inter.edu Has an Items collection; Has the ListBox properties SelectedIndex, ... Allows programmer to display another Web page using code in a click event handler ... in Windows forms; Click smart tag in upper right of grid to set properties on ...
ListBoxes, ComboBoxes, Constraints- Open Office 2 (Data) Base ... We'll build a little table, and provide a data entry form which won't allow us to ... and the ListBox's property editor should open up. ..... Drew says that there is actually another way to check constraints using the system ... I got this information on the following webpage (googled "sql regular characters"), ...
Remove ListItem from ListBox - Windows Forms - I have another form on the print button which has 2 buttons print single ... then see the form loading control by control as if it was a web page! ... Visible = True ' Set the UserControl property so that Excel does not shut down. ...
CGTalk - Dotnet ListBox flickering Another thought was to use the .List Box row source limit of 2048 - dBforums Each of those items have the BillingInformation property set to an ... another user attempts to open the same form with the list box in it. ... Here's a web page that demonstrates a VERY complicated Callback function . ...

Videos:
Developing JavaScript with Chickenfoot Google TechTalks July 25, 2006 Rob Miller Michael Bolin ABSTRACT Chickenfoot is a Firefox extension that embeds a JavaScript programming ...




Search This Site:










user control load event

error with css

clob question

popup help files

problem exceuting event handler with dynamic item creation

auto redirect problems

can crystal report be shown on asp.net web form

simple button question

output cache

verifying navigation away from form

error on meta line

public function

validation

timeout expired.

helpme use requiredfieldvalidator for testing textbox???

dropdownlist cannot have multiple items selected

need help returning value

connect to oracle 9i database.

accessing a control in a nested user control

detect duplicate on insert

controls one the same web form that call to various other forms

dropdown dilemma

11035099 : i need to get the numbers 11,35 and 99 to a variable

textmode="multiline" fails with maxlength property of textbox

question about andy smith's numeric text box

need recoreset help

pass data from data table to arraylist

how to set the page stay at the same control when we refresh it.

user controls and client side script

check box

  Privacy | Contact Us
All Times Are GMT