Postback Problem

  • Thread starter Thread starter Alper OZGUR
  • Start date Start date
A

Alper OZGUR

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>")
 
"Postback" means posting the page back to the server from the client. How is
your scenario related to this definition?

Eliyahu
 
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...
 
What exactly do you mean under "need to postback"? To run the code located
in the "if postback=true" branch?

Eliyahu
 
yes
haber iletisinde þunlarý said:
What exactly do you mean under "need to postback"? To run the code located
in the "if postback=true" branch?

Eliyahu
 

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

private void PostBackCode()
{
// postback code
}
 
Thank you for response. But this is not my solution.. I have to raise the
postback to true...
 
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...?
 
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
 
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...?
 

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

Back
Top