 |
| ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.1 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
|
|
|
|

April 5th, 2004, 06:11 AM
|
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Display text w/out page reloading
Hi xperts
I have a dropdownlist that has four values. I have called a function in the 'OnSelectedIndexChanged' event and some text gets displayed in a label control. My problem is, to make this happen, I need to make the AutoPostBack="true" for the dropdownlist control. Every time I select one value from the list, the page gets posted. I tried to use JavaScript to set focus on the control. That worked, but the control is somewhere middle of the page and after postback, the page gets diplayed from the top. This is not required by my client. He wants that he will be able to see the dropdownlist after selecting any value from the list.
Is there anyway I can do this stuff w/out reloading the page? I need to keep the dropdownlist control as server-side control. I am using VB as the scripting language. No C# solution is reqrd.
Thanx in anticipation.
Sankar Sengupta
Striving for the BEST
__________________
Sankar Sengupta
Striving for the BEST
|
|

April 5th, 2004, 11:30 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
You have to use JavaScript; however, you may be able to display the page from the middle as desired using JavaScript. Not quite sure how to do it myself.
|
|

April 5th, 2004, 12:45 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
If you have set AutoPostBack="true" it will always reload the page.
|
|

April 5th, 2004, 11:17 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
To reach that u have to use Clint-Side programing & in order to get Server-Control's value by JavaScript use:
Code:
FORM_NAME.elements['DropDownList_NAME'].selectedIndex
HTH.
Always:),
Hovik Melkomian.
|
|

April 5th, 2004, 11:59 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
You can also try using SmartNavigation.
J
|
|

April 6th, 2004, 12:18 AM
|
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thx. But the prblem w/ this solution is I cannot declare it as a server-side control. I am saving the form data into a database, so I am calling a subroutine in the click event of the submit button, and save the data in an acces file. So, u see, I have to declare the control w/ runat="server" tag, and the only event available is the OnSelectedIndexChanged and that only works w/ AutoPostBack = "true" option. So, why people say ASP.Net is powerful than Classical ASP? Can't I do this simple thing?
Quote:
quote:Originally posted by melvik
To reach that u have to use Clint-Side programing & in order to get Server-Control's value by JavaScript use:
Code:
FORM_NAME.elements['DropDownList_NAME'].selectedIndex
HTH.
Always:),
Hovik Melkomian.
|
Sankar Sengupta
Striving for the BEST
|
|

April 6th, 2004, 12:21 AM
|
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Any more detail available w/ you?
Quote:
quote:Originally posted by katsarosj
You can also try using SmartNavigation.
J
|
Sankar Sengupta
Striving for the BEST
|
|

April 6th, 2004, 12:23 AM
|
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thx. U'r help is appreciated.
Quote:
quote:Originally posted by stu9820
If you have set AutoPostBack="true" it will always reload the page.
|
Sankar Sengupta
Striving for the BEST
|
|

April 6th, 2004, 01:29 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
my dear friend: I told u to use Client-Side programming but u r talking about [u]AutoPostBack</u> witch is Server-Side!
set it to False & go with the codes I gave.
Always:),
Hovik Melkomian.
|
|

April 6th, 2004, 06:43 AM
|
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Got that. Thx. I guess that's what I was lookin 4
Quote:
quote:Originally posted by melvik
my dear friend: I told u to use Client-Side programming but u r talking about [u]AutoPostBack</u> witch is Server-Side!
set it to False & go with the codes I gave.
Always:),
Hovik Melkomian.
|
Sankar Sengupta
Striving for the BEST
|
|
 |