Postback Problem

Discussion in 'ASP .Net' started by Alper OZGUR, Mar 2, 2006.

  1. Alper OZGUR

    Alper OZGUR Guest

    Hi;
    In my code i'm checking some conditions and if the condition fails i want to
    postback the page. Tried using the below methods but the when form is loaded
    the postback status is false.. how can i solve?

    Page_Load(1,SystemEventArgs.Empty)
    or
    Response.write("<script> __doPostback('Mybase','Load');</script>")
    Alper OZGUR, Mar 2, 2006
    #1
    1. Advertising

  2. "Postback" means posting the page back to the server from the client. How is
    your scenario related to this definition?

    Eliyahu

    "Alper OZGUR" <> wrote in message
    news:e8Cez%...
    > Hi;
    > In my code i'm checking some conditions and if the condition fails i want
    > to postback the page. Tried using the below methods but the when form is
    > loaded the postback status is false.. how can i solve?
    >
    > Page_Load(1,SystemEventArgs.Empty)
    > or
    > Response.write("<script> __doPostback('Mybase','Load');</script>")
    >
    >
    >
    >
    Eliyahu Goldin, Mar 2, 2006
    #2
    1. Advertising

  3. Alper OZGUR

    Alper OZGUR Guest

    I'm counting some records.. if this value bigger than i gave. assigning some
    value to a session object.. and need to postback the page..
    cause there are lot's of codes writed in if postback=false then...


    "Eliyahu Goldin" <>, haber iletisinde þunlarý
    yazdý:...
    > "Postback" means posting the page back to the server from the client. How
    > is your scenario related to this definition?
    >
    > Eliyahu
    >
    > "Alper OZGUR" <> wrote in message
    > news:e8Cez%...
    >> Hi;
    >> In my code i'm checking some conditions and if the condition fails i want
    >> to postback the page. Tried using the below methods but the when form is
    >> loaded the postback status is false.. how can i solve?
    >>
    >> Page_Load(1,SystemEventArgs.Empty)
    >> or
    >> Response.write("<script> __doPostback('Mybase','Load');</script>")
    >>
    >>
    >>
    >>

    >
    >
    Alper OZGUR, Mar 2, 2006
    #3
  4. What exactly do you mean under "need to postback"? To run the code located
    in the "if postback=true" branch?

    Eliyahu

    "Alper OZGUR" <> wrote in message
    news:...
    > I'm counting some records.. if this value bigger than i gave. assigning
    > some value to a session object.. and need to postback the page..
    > cause there are lot's of codes writed in if postback=false then...
    >
    >
    > "Eliyahu Goldin" <>, haber iletisinde
    > þunlarý yazdý:...
    >> "Postback" means posting the page back to the server from the client. How
    >> is your scenario related to this definition?
    >>
    >> Eliyahu
    >>
    >> "Alper OZGUR" <> wrote in message
    >> news:e8Cez%...
    >>> Hi;
    >>> In my code i'm checking some conditions and if the condition fails i
    >>> want to postback the page. Tried using the below methods but the when
    >>> form is loaded the postback status is false.. how can i solve?
    >>>
    >>> Page_Load(1,SystemEventArgs.Empty)
    >>> or
    >>> Response.write("<script> __doPostback('Mybase','Load');</script>")
    >>>
    >>>
    >>>
    >>>

    >>
    >>

    >
    >
    Eliyahu Goldin, Mar 2, 2006
    #4
  5. Alper OZGUR

    Alper OZGUR Guest

    yes
    "Eliyahu Goldin" <>, haber iletisinde þunlarý
    yazdý:...
    > What exactly do you mean under "need to postback"? To run the code located
    > in the "if postback=true" branch?
    >
    > Eliyahu
    >
    > "Alper OZGUR" <> wrote in message
    > news:...
    >> I'm counting some records.. if this value bigger than i gave. assigning
    >> some value to a session object.. and need to postback the page..
    >> cause there are lot's of codes writed in if postback=false then...
    >>
    >>
    >> "Eliyahu Goldin" <>, haber iletisinde
    >> þunlarý yazdý:...
    >>> "Postback" means posting the page back to the server from the client.
    >>> How is your scenario related to this definition?
    >>>
    >>> Eliyahu
    >>>
    >>> "Alper OZGUR" <> wrote in message
    >>> news:e8Cez%...
    >>>> Hi;
    >>>> In my code i'm checking some conditions and if the condition fails i
    >>>> want to postback the page. Tried using the below methods but the when
    >>>> form is loaded the postback status is false.. how can i solve?
    >>>>
    >>>> Page_Load(1,SystemEventArgs.Empty)
    >>>> or
    >>>> Response.write("<script> __doPostback('Mybase','Load');</script>")
    >>>>
    >>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
    Alper OZGUR, Mar 2, 2006
    #5
  6. Alper OZGUR

    Mark Rae Guest

    "Alper OZGUR" <> wrote in message
    news:...

    > yes


    >> What exactly do you mean under "need to postback"? To run the code
    >> located in the "if postback=true" branch?


    private void Page_Load(object sender, System.EventArgs e)
    {
    if(Page.IsPostBack)
    {
    PostBackCode();
    }
    else
    {
    if(SomeOtherSetOfConditions)
    {
    PostBackCode();
    }
    }
    }

    private void PostBackCode()
    {
    // postback code
    }
    Mark Rae, Mar 2, 2006
    #6
  7. Alper OZGUR

    Alper OZGUR Guest

    Thank you for response. But this is not my solution.. I have to raise the
    postback to true...


    "Mark Rae" <>, haber iletisinde þunlarý
    yazdý:eblp%...
    > "Alper OZGUR" <> wrote in message
    > news:...
    >
    >> yes

    >
    >>> What exactly do you mean under "need to postback"? To run the code
    >>> located in the "if postback=true" branch?

    >
    > private void Page_Load(object sender, System.EventArgs e)
    > {
    > if(Page.IsPostBack)
    > {
    > PostBackCode();
    > }
    > else
    > {
    > if(SomeOtherSetOfConditions)
    > {
    > PostBackCode();
    > }
    > }
    > }
    >
    > private void PostBackCode()
    > {
    > // postback code
    > }
    >
    Alper OZGUR, Mar 2, 2006
    #7
  8. Alper OZGUR

    Mark Rae Guest

    "Alper OZGUR" <> wrote in message
    news:O6$...

    > Thank you for response. But this is not my solution..


    Then you need to explain in much more detail what you're actually trying to
    achieve...

    >I have to raise the postback to true...


    What does that actually mean...?
    Mark Rae, Mar 2, 2006
    #8
  9. Alper OZGUR

    Alper OZGUR Guest

    at the code below i must raise the postback event..



    If Session("TotalRecords") > 1500 Then

    Say(rsxr.GetString("FALSESEARCH"))

    Session("BigReport") = "True"

    Session.Remove("SrchCrt")

    FirstPage = True

    Dim script As String = "@SCRIPT>__doPostBack('Btn_Pb','Click')@/SCRIPT>"

    Page.RegisterClientScriptBlock("PostingBack", script.Replace("@", "<"))

    End If



    "Mark Rae" <>, haber iletisinde þunlarý
    yazdý:...
    > "Alper OZGUR" <> wrote in message
    > news:O6$...
    >
    >> Thank you for response. But this is not my solution..

    >
    > Then you need to explain in much more detail what you're actually trying
    > to achieve...
    >
    >>I have to raise the postback to true...

    >
    > What does that actually mean...?
    >
    Alper OZGUR, Mar 2, 2006
    #9
  10. Alper OZGUR

    Mark Rae Guest

    "Alper OZGUR" <> wrote in message
    news:...

    > at the code below i must raise the postback event..


    Why?

    > Dim script As String = "@SCRIPT>__doPostBack('Btn_Pb','Click')@/SCRIPT>"


    You're already in code-behind here - why don't you just call Btn_Pb's Click
    code...?
    Mark Rae, Mar 2, 2006
    #10
    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. Psych971
    Replies:
    5
    Views:
    4,610
    bruce barker
    Dec 17, 2004
  2. =?Utf-8?B?Q2hhZA==?=

    Postback not being set to True on first postback

    =?Utf-8?B?Q2hhZA==?=, Apr 4, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    494
    =?Utf-8?B?Q2hhZA==?=
    Apr 4, 2005
  3. gce
    Replies:
    2
    Views:
    1,709
  4. Jacky Chau
    Replies:
    2
    Views:
    2,045
    Ninjamyst
    Jun 8, 2005
  5. Fabio Mastria
    Replies:
    5
    Views:
    4,345
    TechMCAD13
    Jan 30, 2008
Loading...

Share This Page