Forcing a page to postback

Discussion in 'ASP .Net' started by John Morgan, Jan 22, 2007.

  1. John Morgan

    John Morgan Guest

    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
     
    John Morgan, Jan 22, 2007
    #1
    1. Advertising

  2. 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


    "John Morgan" <> wrote in message
    news:...
    >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
     
    Eliyahu Goldin, Jan 22, 2007
    #2
    1. Advertising

  3. 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

    "John Morgan" <> wrote in message
    news:...
    >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
     
    Brian Williams, Jan 22, 2007
    #3
  4. John Morgan

    John Morgan Guest

    Thanks both of you for your advice.

    I am looking into it at this moment,

    Best wishes, John Morgan

    On Mon, 22 Jan 2007 13:28:44 GMT, John Morgan <>
    wrote:

    >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
     
    John Morgan, Jan 22, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Earl Teigrob
    Replies:
    0
    Views:
    411
    Earl Teigrob
    Aug 11, 2003
  2. Earl Teigrob
    Replies:
    2
    Views:
    715
    Earl Teigrob
    Dec 23, 2003
  3. Ashish

    Forcing parent page postback

    Ashish, Apr 5, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    6,294
    Steven Cheng[MSFT]
    Apr 8, 2004
  4. =?Utf-8?B?VGFicmV6?=

    Forcing PostBack programmitically

    =?Utf-8?B?VGFicmV6?=, Jun 19, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,932
    =?Utf-8?B?VGFicmV6?=
    Jun 21, 2004
  5. =?Utf-8?B?VGFicmV6?=

    Forcing PostBack programmitically

    =?Utf-8?B?VGFicmV6?=, Jun 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    365
    =?Utf-8?B?VGFicmV6?=
    Jun 19, 2004
Loading...

Share This Page