Forcing a page to postback

J

John Morgan

I suppose the answer to this is staring me in the face but....

How do I programmatically get a page to post back?

The actual situation is that I am using an aspx table control and
changing the text within a cell. Though the cell text is updadated
successfully it does not show up on the screen until it the page is
posted back..

At the moment I am using a button which does nothing, processes no
code, but ensure a postback .

I wish to be able to force this postback as soon as the text in the
cell is updated (programmatically) so that it shows up on the screen
immediately.

I would be grateful for any help,

Best wishes, John Morgan
 
E

Eliyahu Goldin

You can setup a client side event that will make a javascript call
myForm.submit(). Alternatively you can use one of the methods exposed by the
Page class: GetPostBackClientEvent, GetPostBackClientHyperlink,
GetPostBackEventReference.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 
B

Brian Williams

If you are using a table, my guess is that you have multiple cells that you
will be updating, the postback will probably become really annoying.
You should probably look into hooking up ASP.Net Ajax http://ajax.asp.net
or Anthem http://anthemdotnet.com and refreshing just the table,
instead of forcing a postback on the entire page.

Also, tables are really heavy on the HTML and because of your choice not to
use a data grid, you probably don't care about paging, sorting, or
displaying hierarchal data. You would probably be better off writing you own
custom control to display CSS friendly Spans and Divisions.

Regards,
Brian K. Williams
 
J

John Morgan

Thanks both of you for your advice.

I am looking into it at this moment,

Best wishes, John Morgan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top