Web Forms :: CheckBox Oncheckedchanged Event Causing Strange Behavior On Postback?

Jun 11, 2010

I have an issue that seems to only happen on my production server. I show or hide table rows whenever the buttons are clicked. However, when I do a postback on the checkbox, all of the rows become visible and the textbox stays empty. It works correctly on my test server and local workstation, just not in production.

Here is the markup...

[Code]....

Here is the code behind...

[Code]....

Here are the unexpected results whenever I check the chkShow2 checkbox... I am guessing this is a configuration issue on the server.

View 1 Replies


Similar Messages:

Web Forms :: Checkbox In Gridview Doesn't Fire OnCheckedChanged Event

Oct 26, 2010

Here is my situation: I have a overview of subscriptions that look simple:

Active (bool), ID (int), StartDate (datetime) and MaxUsers (int).

I've put this in a Gridview and it renders nicely.

Now everything is simply in ItemTemplates and are formatted.

Now a new feature: In the Gridview active should be a checkbox and when clicked on it, it should (de)activate the subscription. Or simply said, Active status is updated. Now me being a simpleton thinks:

[Code]....

and the cs:

[Code]....

But! the event doesnt get fired. Now I've searched with google and also through this forum and every time I get the answer: autopostback on true or use commandname. Now for this little feature I think the commandname use in combi with rowbound is overkill for such a little thing.

Now I hope I'm just missing something because this would be really nasty and stupid to make it so complicated. I like the autopostback and oncheckchanged combination because it logical, but why doesnt it work?

View 3 Replies

Web Forms :: Strange Behavior MultiLine TextBox And GridView?

Nov 15, 2010

I have strange behavior when changing from ItemTemplate to EditItemTemplate. both the ItemTemplate and EditItemTemplate contain the same textbox with multiline. Except the ItemTemplate got the ReadOnly parameter. When the row is getting in EditMode and I enter the textbox everything is disabled. I click on another column that contains a label instead of a multiline textbox and get back in the textbox I can do everything. When I enter in the same row another MultiLine textbox I cannot do anything until I click on a label and get back in that TextBox. When the textboxes are in normal mode I don't seem to be having this issues. What is changed between the MultiLine and SingleLine textbox? What kind of PostBack or something could cause this strange behavior?

View 2 Replies

Web Forms :: Strange Dropdown List Behavior On Page Load?

Apr 3, 2010

I have a page with 14 dropdown lists. In the first page load (ie. not isPostback) I set the selectedIndex of the dropdownlists individually but I find that they are all set to the value I use for the last dropdownlist set. Here is the code

comboFirstJudge1.SelectedIndex = 0
comboFirstJudge2.SelectedIndex = 0
<so on for all the dropdown lists until the last one>
comboFirstJudge14.SelectedIndex = 4

The result is that all dropdown lists have SelectedIndex = 4. If I run the same code on a postback it works just fine (the first lists have SelectedIndex = 0 and the last one = 4).

View 6 Replies

Forms Data Controls :: Strange Behavior After Upgrading To Win 7/Framework 4.0?

Feb 9, 2011

I have a site that was sucesfully upgraded to Framework 3.5 on Vista with VS2008. Now however after installing VS2010 and upgraded to Win 7 wierd things are happenning and was wonderring if any of you have experienced this and how you've dealt with it.First thing I notice in my main page that the four user controls are not in alignment. They should appear side by side in a single row, however now they spread acros two rows with one on top and three on the bottom. Also my graphics and navigation is not where they supposed to be. Just for comparison, if run the existing solution on Win 2003 with VS2008, it works like it supposed to. All the formatting is handled in .css and that didn't change either.

[Code]....

[Code]....

View 1 Replies

Web Forms :: Why CheckBox Is Not Getting Checked On OnCheckedChanged

May 14, 2010

I have a CheckBox field inside a Formview.

<asp:FormView ID="_fvApplicant" runat="server" DefaultMode="Edit" OnItemDeleting="ApplicantItemDeleting" Width="100%" DataSourceID="_dsApplicant" ondatabound="ApplicantFormBound">
<asp:CheckBox ID="_chkSuitable" OnCheckedChanged="test" AutoPostBack="true" CausesValidation="true" runat="server" Checked='<%# Bind("Suitable") %>' /></td>

In my Code Behind in test method I am trying to set the checked to true, but in the ApplicantFormBound event when i debug it is never true...any reasons why? Basically I want to set the Validator to true when checked.

protected void test(object sender, EventArgs e)
{
CheckBox vld = (CheckBox)_fvApplicant.FindControl("_chkSuitable");
vld.Checked = true;
_fvApplicant.DataBind();
}
protected void ApplicantFormBound(object sender, EventArgs e)
{
var chk = (CheckBox)_fvApplicant.FindControl("_chkSuitable");
if (chk != null)
{........

View 9 Replies

Web Forms :: Create Via C# In An Event Causing Page Validation To Occur On Postback?

Feb 14, 2011

I'm having trouble with an image button I create via c# in an event causing page validation to occur on postback. The CausesValidation attribute is set to false at time of creation in the event. I also wire up the Click event in the page_init with postback so not to loose the event handler if the page posts another way. Here is the code I'm using in the click event of a Button. I've also tried to enable and disable viewstate for the button with no luck. What am I missing here that continues to fire page validation in the Click of this imagebutton?

[Code]....

View 2 Replies

MVC :: Strange Behavior On Form Submit?

Oct 14, 2010

i have a strange issue happening while submiting a form:i have this in my form:

<input type="radio" name="type" onclick="document.getElementById('Type').value='Publiser';" />Publisher <br />
<input type="radio" name="type" onclick="document.getElementById('Type').value='Advertiser';" />Advertiser
<%: Html.TextBoxFor(m => m.Type)%>

the javascript is working perfectly and changes the value of the textbox.the problem happens when i submit the form - what is extracteed by the model from the textbox is the string "on", and after the submit, it also changes the value of the textbox to "on".when i load the field with a value from the model, it goes ok, and does not change

View 2 Replies

Asp.net - Getting DropDownList Value Is Generating Strange Behavior?

Jan 3, 2010

I have a DropDownList on a page

[code]...

The problem I am having is that the following code is setting ParentID to 0 (which to me, obviously shouldn't be happening.

View 1 Replies

DataSource Controls :: Strange Behavior Of Cmd.ExecuteScalar()?

Jul 27, 2010

I have a simple procedure which updates a table. The procedure works fine and I have tested it in Management Studio. However when I am calling that procedure from code, nothing is happening. cmd.ExecuteScalar returns null when it should return the ID.Has anyone faced anything similar? Any pointers as to how this can be resolved?

View 3 Replies

AJAX :: Strange Behavior With GridView In A User Control?

Feb 6, 2010

I've got a user control that is displayed via a PopupControlExtender. The user control is a GridView that dynamically adds columns to the control to display the results of a SELECT statement. The PopupControlExtender correctly displays the control and the control displays the neccessary columns. However, when the control is first displayed, the column widths are ignored, despite that they are explicity set. If the control is displayed and then hidden, the column widths are acknowledged the next time the control is displayed.

Here's the user control when first displayed

[IMG]http://i285.photobucket.com/albums/ll48/chyron7/Miscellaneous/screenshot.jpg[/IMG]

Here's how its display after the first time

[URL]

View 4 Replies

Control - ParseControl In Dotnetnuke Changing Onclick To Javascript Instead Of C# Method Provided, Strange Behavior?

Feb 18, 2010

Having some strange behavior here. I have some XSLT which generates some html with a few ASP.NET Link Button Controls

String mstring = sw.ToString();
var myctrl = Page.ParseControl(mstring);
foreach (Control Control in myctrl.Controls)

[code]...

View 1 Replies

C# - Find Datakeys In Oncheckedchanged Event ?

Jun 14, 2010

<asp:Panel ID="pnlFocusAreaPanel" runat="server" GroupingText="Focus Area" Width="800">
<table cellspacing="0" cellpadding="0" width="750">
<tr>[code]...

i want to know how i find the datakeyvalue on checked event because updateQuery in checked event is generating exception.

View 1 Replies

Oncheckedchanged() Event Is Not Happening When Deselect The Radiobutton?

Dec 21, 2010

In form I have added two radio button and on one radio button oncheckedchanged event has been registered but this event does happen only when i select the button and not when i select the other(The checked is changed).

code is posted below:

<asp:RadioButton ID="RadioButton1" runat="server" GroupName="a"
oncheckedchanged="RadioButton1_CheckedChanged" />
<asp:RadioButton ID="RadioButton2" runat="server" GroupName="a" />
<asp:Button ID="Button1" runat="server" Text="Button" />

And the code behind page just print the text of 1st radiobutton on changing the selection.

View 1 Replies

C# - OnCheckedChanged Event Fires More And More Times For Every Time It Is Clicked?

Aug 31, 2010

I have an ASP.NET page that contains a gridview.

I have to create columns dynamically based on a datatable, some field type info and some header texts.

I do that by creating templates.

It created the grid fine and all looks good, however when i click a checkbox and the checkedchanged event fires then something odd happens

The first time i click its fine and i get the expected values in the event

But the second time then the event gets fired with the values from the first time and then again with the values from the checkbox that i actually clicked.. The third time the event gets fired 3 times, first 2 times with the old values and the third with the correct value.

Here is the code:

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;........

View 3 Replies

Web Forms :: Strange Postback Arise When Using Application_BeginRequest?

Dec 15, 2010

I have a problem using Application_BeginRequest and I have absolutely no clue what is going on. When using this code, my website works fine:

[Code]....

Now, when I only alter it like this (note that I am actually doing nothing special):

[Code]....

This small change in code causes that forms don't postback anymore. I am truely clueless why this happens when trying to get some request.form variables.Stupid thing is, when debugging the website using visual studio, everything works fine.

View 8 Replies

Web Forms :: DropDownList Causing Postback On Change

May 9, 2012

I have 1Dropdownlist 1 button and 1 datalist in my page i bind my datalist in Page_load event that show all my product from my DB ... Users  can select their city from DDL click on button and in datalist just show product that are on selected city ...

Problem: when users select PARIS from ddl in datalist show product from selected city and when users want change their city from ddl before their click on button to show that city's product page load again and it show all product again...

I want when users change ddl.selecteditem in datalist show last result of user's selected not the result that i define in page load ... This is my code on page load ...

  protected void Page_Load(object sender, EventArgs e) {
if (!IsPostBack) {
DDLcity1.Items.Add(new ListItem("select your city", ""));
BindDropDownList(DDLcity1, "Guidcity", "cityname", "ID");
}

View 1 Replies

Web Forms :: Calendar Behavior - No New Date As Result Of Event

Oct 12, 2010

In VS 2008 using VB I am using the standard calendar. In my program the user will be changing the date, especially between months, before entering new data. The problem I have is that when you change just the month, the calendar does not give you a new date until you select a specific day of the month. Thus if I go from October 14th back to September, there is no new date as a result of that event. Ideally it should default or give you the oportunity to allow it to defualt to the 1st day of the month. Is there anyway around this. I don't want my users to have to change the month then select a date. I would like the code: m = MyCal.SelectedDate.Month to assign the month to m when the month is changed.

View 4 Replies

Forms Data Controls :: Changing A Checkbox To A Template Field Causing It To Pass A Null?

Jan 1, 2011

I've got a details view control on a page. One of the columns, from the database table, is a bit field. It is not nullable, and that's the way it has to be. Also, in most cases, when inserting data, it will be true (1) be default. I've found in testing, when inserting data, that it was false, for some reason. So, I changed the column to a template field and went to the InsertItemTemplate for that column, and changed the checkbox Checked property to True, instead of the default False. However, it has really screwed up the page because now it won't save anything at all! When I try saving something using the details view, it does show the checkbox as being checked, but man, once I try saving it I get an error message back from the database saying that the column doesn't allow for nulls.

Huh??? How in heck can the column on the page have a value (it is checked), but when it goes to save something it fails? Furthermore, before I converted this field to a template field, it worked perfectly. I tested several other insertions, and they all worked. But when I converted it to a template field, it stopped working? What's that about? I even tried setting the default value for the Checked property of the checkbox back to False, but that still doesn't work, it still wants to pass in a null. What's going on here? Why is it that converting a field to a template field, which was working perfectly fine before I made the convension, stop it from working at all?

View 4 Replies

Web Forms :: Dynamically Add Object In Page Causing Second Postback With Ispostback?.

Jan 17, 2011

I dynamically add the webcontrol in onInit or onload (page_load). it will cause the second post back and with the ispostback==false;

if first enter the page is no problem. but if I click on the some button. it will trigger postback two times.

first time: ispostback = true.

second time: ispostback = false.

the second time postback caused me headache because all my value has been initialized due to the coding like below:

DataTable _temp;

if(! ispostback)

[Code]....

View 2 Replies

Forms Data Controls :: Drop Down Not Causing Postback On The First Selection

Oct 3, 2010

i have a dropdown list

<asp:DropDownList ID="DDName" runat="server" AutoPostBack="True"
DataSourceID="sdsName" DataTextField="Name" DataValueField="name_ID"
Width="179px">
</asp:DropDownList>

the problem that it is not causing post back on the first selection but on the second, I mean if i select from drop down list first selection no post back on the server,but when i select another item from the list (the second click on a different list item )

View 4 Replies

Web Forms :: Find The HTML Of Entire Page Causing The PostBack ?

Jul 30, 2010

I need to know if there is any server-side function/custom-code available to find out the HTML of the entire page which is causing the PostBack.

I don't want to do it using JavaScript/jQuery but instead do it at server side.

A JavaScript workaround that implements it can be found at this link. [URL]

Reason, Why I need it? I am writing some inline javascript in page which performs some vital actions and supposed not to be tampered by user(hacker). So, when a postback occurs, I would like to find out the HTML of entire page (at server) so that I can verify it (I have already generated the hash code for entire HTML while rendering the page to check it on consecutive postbacks) for non-tamering and then process further.

This is the reason why I need a way to find out the HTML of the page causing the PostBack.

View 7 Replies

AJAX :: SliderExtender Behavior Can Only Be Capture After A Postback?

Dec 3, 2010

I'm using SliderExtender in content of a Master Page.

It has a JavaScript function that is called in both $(document).ready and Sys.WebForms.PageRequestManager.getInstance() .add_endRequest() .

When I initial the page, the function is not active, it says " $find('BehaviorID') " is null, while other JavaScript function (without behaviourID) works smoothly.

But when I do a postback on the page. The slider function turns to available.

It seems the page didn't generate properly, miss a slider tag with class = "...BehaviorID..."

View 2 Replies

C# - TreeView Control Unexpected Event Behavior?

Apr 16, 2010

In the MSDN is writen about TreeNode that:

"By default, a node is in selection mode."

"To put a node into selection mode, set the node's NavigateUrl property to an empty string."

"When a node is in selection mode, use the SelectAction property to specify which event or events are raised when a node is selected."

"Setting TreeNodeSelectAction value TreeNodeSelectAction.Select Raises the SelectedNodeChanged event when a node is selected."

Here is the problem and possibly a bug in the control:

When I set the TreeNode object PopulateOnDemand value to true and call the Collapse() function on that node.Then the TreeNodeExpanded event is raised in addition to the SelectedNodeChanged event.This is in complate contradiction to what is writen in the MSDN.According to the MSDN this sould happen only if TreeNodeSelectAction Property is set to TreeNodeSelectAction.SelectExpand value.

Here is the code:

<asp:TreeView ID="TreeView1" runat="server" AutoGenerateDataBindings="False"
onselectednodechanged="TreeView1_SelectedNodeChanged"
ontreenodepopulate="TreeView1_TreeNodePopulate"> [code]...

View 1 Replies

State Management :: Strange Connection Between ViewState And DropDownList's SelectedIndexChanged Event?

Sep 20, 2010

I have this code (just for example):

[Code]....

The Code-behind file looks like that:

[Code]....

So, when i use

[Code]....

SelectedIndexChanged event doesn't fire for the first item of the DropDownList. For any other item SelectedIndexChanged fires, but not for the first one.Could someone, please, explain what kind of magic is it?(I use Visual Studio 2008)

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved