Questions tagged [ispostback]

is a .net property whose value indicates whether the page is being rendered for the first time or is being loaded in response to a postback.

67 questions
1
vote
3 answers

On Postback placeholder controls disappearing

Within my webpage I am loading usercontrols within a placeholder. Each of these user controls triggers a postback when an ajaxcontroltoolkit rating is changed. The problem I am having is that if I use If (Not IsPostBack is Nothing) the controls…
mattgcon
  • 4,768
  • 19
  • 69
  • 117
1
vote
2 answers

ASP.NET keeping the selected language in a multilingual website C#?

This is my code, the main problem is when I select the language I want to, it changes to the language, but if I click to another web page it turns to the original one. Example: I select english, then it changes all the page to english but if I click…
1
vote
1 answer

Array keeps resetting itself after form submit

I have a code and an array inside like this one : using System; public partial class bug : System.Web.UI.Page { double[] Score = new double[10]; protected void Page_Load(object sender, EventArgs e) { load the form with questions from database…
Cem Sultan
  • 79
  • 1
  • 13
1
vote
2 answers

UpdatePanel with PostBackTrigger does not update the Label outside it and carry on after postbacks

I have an update panel with postbacktriggers and the label that I plan to update is in the navbar, which is not included in the UpdatePanel where the triggers are located. Below is the structure of that code:
JPaulPunzalan
  • 417
  • 1
  • 6
  • 20
1
vote
1 answer

C# Page Fields not populating as expected

Could someone please tell me what I am doing wrong? I am trying to call the method automatically when the page loads, however, it does not work. protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { …
HereToLearn
  • 292
  • 5
  • 16
1
vote
1 answer

IsPostBack doesn't work in ASP.NET

I want that when the page is first loaded , the string str is initialized with the text "I am here". And when the page is updated by clicking on the button (btn_click) the value is the same that was initialized. But it does not work. In the console…
Paul9999
  • 751
  • 1
  • 11
  • 26
1
vote
0 answers

if (!IsPostBack) not working with 2nd language

I have 2 tables in my page. I can select between those 2, to choice the language. In my code I have this: public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { username.Text =…
KikoFHM
  • 122
  • 14
1
vote
1 answer

Why Does IsPostBack Require runat="server" on the Form?

I must not understand something fundamental about the aspx page processing cycle. Please take a look at this simple example below.
Tom Baxter
  • 2,110
  • 2
  • 19
  • 38
1
vote
2 answers

Drop Down List that is created by code behind refresh the page

I am trying to create a list of DDL using code behind as you can see here : public List ddll = new List(); for (int i = 0; i < 15; i++) { DropDownList ansList = new DropDownList(); ansList.AutoPostBack = false; …
Ehsan Akbar
  • 6,977
  • 19
  • 96
  • 180
1
vote
2 answers

After button having postback

protected void Page_Load(object sender, EventArgs e) { Button cmdTemp = null; try { cmdTemp = (Button)GetPostBackControl(this); } catch { } FillTableDB(); if(IsPostBack) { if(cmdTemp == null ||…
ND's
  • 2,155
  • 6
  • 38
  • 59
1
vote
2 answers

Update a label in server side in ASP.Net after Button Click

I want to update my label content when the user submits a form but it doesn't get updated. Although I have put it in if (!IsPostBack) condition in form load It doesn't show the changes. The only solution that I came up with was defining a counter…
user2552265
1
vote
2 answers

How to call a method only once in the first page load in the master page

I have the following case: Page1.aspx this page has the master page master.aspx. I have some code in the master page : if (!Page.IsPostBack) { adjustServiceBar(); } when i click any button in the…
Anyname Donotcare
  • 11,113
  • 66
  • 219
  • 392
1
vote
0 answers

Google analytics with !IsPostBack

We're using google analytics in our webforms site. I have the google analytics javascript loading in the head section of the masterpage like this... <%if (!IsPostBack) {%> <%}…
Stuart
  • 1,544
  • 5
  • 29
  • 45
0
votes
4 answers

How do you use if (IsPostBack) in ASP.NET C#

How can I used if (IsPostBack){} to display user's names from two text boxes into another text box? I have 3 text boxes and a button. The text boxes are named txtLastName, txtGivenName, txtOutput. My button is btnSubmit. How can I display text from…
GivenPie
  • 1,451
  • 9
  • 36
  • 57
0
votes
1 answer

asp.net calling button click event that i created

I am writing a web app in asp.net. I have an aspx page that call a class (Test) that Generates a button and return the button. The class constructor get the function that the button click event should activate (userClickOnButton) and insert to the…
user723686
  • 265
  • 1
  • 15
  • 21