Wrox Programmer Forums
|
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 July 26th, 2007, 07:19 AM
Authorized User
 
Join Date: Jun 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default reload thepage

Hi,

I want to reload the page after the the server side code of a button cick is executed.

This is because, i have 2 HTML tables that needs to be displayed based on the results in the button click server side code.

so is thera way i can reload my page.
Or how can i call another server side button click from 1 button click, so that the page is reloaded.

please help urgent

 
Old July 26th, 2007, 02:56 PM
Authorized User
 
Join Date: Jun 2007
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to hericles
Default

Hi,
The page should reload if the button click does any processing for that page. If in the button click code you are creating the tables and telling the page to display them then the page will reload. Are you setting the tables to visible = none in the page load function? If so the page will be reloading each time but processing the instruction to keep them hidden each time. A look at your code might help.

Steve

 
Old July 26th, 2007, 09:43 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

This depends. The OP says that they are HTML tables so, unless he has set them to run as a server control, he will not be able to access a visiblity property. Steve is correct, however, in that a server button, once clicked, will cause a postback (reload) of your page, provided your logic works in such a way that some happens after the page is posted back.

So somethign like this:


private void Page_Load(object sender, EventArgs e)
{
//some processing
}

private void Button1_Click(object sender, EventArgs e)
{
//do some proecessing page will refresh after the code is executed.
}

Here is the thing. If, for example, the button event handler only writes data to a database your page is not going to update unless you specifiy in your code that the UI should change in X way. (A table becomes visible, new data is populated, etc)

This all really depends on what you are doing.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET

Professional IIS 7 and ASP.NET Integrated Programming

================================================== =========
 
Old July 27th, 2007, 01:19 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Parsons, don't mind, but what do you mean by "OP"



Regards
Mike

Don't expect too much, too soon.
 
Old July 29th, 2007, 01:04 AM
Authorized User
 
Join Date: Jul 2007
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello,

try to group the code that displays the 2 html tables in a method and call this method where ever you need or most probably in the button click server side code

 
Old July 31st, 2007, 09:11 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

OP == Original Poster mike ^^

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET

Professional IIS 7 and ASP.NET Integrated Programming

================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Reload page Tooltip not work - Reload xslt file? ismailc XSLT 10 January 22nd, 2008 10:03 AM
Reload page only once. rupen Javascript How-To 4 September 13th, 2007 06:34 AM
I want page to not reload omersharp ASP.NET 2.0 Professional 0 December 13th, 2006 07:06 PM
Ant reload guacamole82 BOOK: Beginning JavaServer Pages 0 July 18th, 2005 07:01 PM
Reload a page mivan2001 Javascript How-To 1 July 23rd, 2003 03:25 AM





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