Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 26th, 2007, 07:38 AM
Authorized User
 
Join Date: Jan 2007
Location: sydney, nsw, Australia.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Divs, Gridviews and Javascript != fun

Hi,

I have the following gridview

http://i11.tinypic.com/2hp3jmo.gif

and I want to have a div pop up next to the icon when they click on the little search icon (next to the costcode)
like this -> http://i10.tinypic.com/48yybdy.gif

I have gotten this far.. but the problem is that When I click Select, Search or Clear, it causes a postback, and when the page reloads, the DIV moves back to its original position, or if i set it by default to be invisible, then it disappears.

Any suggestions on how I could get this done?

Basically, I want it to:

1) When i hit select, copy the values to the right fields, and then disappear. (it does this if its set to invisible by default).
2) When i hit search or clear, i want it to modify the filter settings for the sqldatasource, and keep the div where it is.

Maybe i need to use state variables or something and make the page load the appropriate java script based on these variables. Apparently I can set the startupscript from inside the page_load code in the code behind.

Thanks,
Mikey
  #2 (permalink)  
Old January 26th, 2007, 02:10 PM
Authorized User
 
Join Date: Jan 2007
Location: sydney, nsw, Australia.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok i figured it out.

You cant execute javascript from code behind (except at startup in pageload - you can use RegisterStartupScript), and you cant update codebehind variables from javascript, so.. you need to find a common ground. Cookies.

Basically whenever i moved the div, i updated a cookie to say whether or not its visible and its position. then on page load, if it was a postback, i'd read the cookie, and then if it was visible, i would use the RegisterStartupScript to register my function to show the searchpanel and pass it the top and left from the cookie too.

the end.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tab across gridviews cdw90nl Javascript How-To 1 February 4th, 2008 05:16 AM
Nested gridviews johncross912 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 2 November 23rd, 2007 03:04 AM
How to passed an xsl parameter to a javascript fun jadeite100 XSLT 1 June 22nd, 2007 02:51 PM
Gridviews lisabb ASP.NET 2.0 Basics 1 May 29th, 2007 11:40 AM
divs inside divs: theory? Giant_robot_sandwich CSS Cascading Style Sheets 11 September 13th, 2006 03:56 PM



All times are GMT -4. The time now is 02:26 AM.


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