postback

Checkbox in TemplateField in Gridview loses checked on postback

纵饮孤独 提交于 2019-12-09 02:51:47
问题 I have a gridview with a template field. In that template field is a checkbox. I have a submit button outside of the gridview to assign the records that were checked. On the postback no checkboxes register as being checked. Here is my Code: <Columns> <asp:TemplateField> <ItemTemplate> <asp:CheckBox ID="cb" Checked="false" runat="server" /> <asp:Label ID="lblCFID" runat="server" Visible="false" Text='<%# Eval("ID") %>' /> </ItemTemplate> </asp:TemplateField> <asp:BoundField HeaderStyle

problems with postbacks events from dynamic controls in ASP.Net

家住魔仙堡 提交于 2019-12-08 19:31:34
I am currently working on a page that has a user control that builds a dynamic table. The control is originally loaded on the Page_Init event, and any time that an event is raised that changes the dynamic control the table is reloaded. The problem here is that if the control is changed between between loads, the events from the control do not fire. For instance, there are originally two rows in the table. An item is added to the table during the postback and now there are four rows (this table adds two rows at a time). Each row has one or two buttons. When the page is loaded and sent back to

Why won't my LinkButton inside a GridView raise its OnClick event?

只谈情不闲聊 提交于 2019-12-08 19:14:16
问题 I have a LinkButton inside a GridView (via an TemplateField). No matter what I try, the LinkButton will not invoke its event handler. I have tried both: A traditional event handler ("OnClick") A OnRowCommand event handler at the GridView level. In both cases, I've debugged and it doesn't even catch the event handler. If I move the LinkButton out on the page (so it's not in the GridView), it works fine, so I know the syntax is right. Here is the "traditional" method: <asp:TemplateField>

Postback trigger for button inside a usercontrol in Updatepanel

倾然丶 夕夏残阳落幕 提交于 2019-12-08 17:30:24
问题 I have a user control placed inside an update panel, ie like this. <asp:UpdatePanel ID="testupdatepnl" runat="server" UpdateMode="Conditional"> <ContentTemplate> <uc1:TestControl ID="ctlTest" runat="server" /> </ContentTemplate> </asp:UpdatePanel> Now i got a button placed inside this user control say Click. I want to postback the whole page on the button click. I tried to add a postback trigger like this <Triggers> <asp:PostBackTrigger ControlID="clickButton" /> </Triggers> Since the button

dynamic columns disappears after postback

可紊 提交于 2019-12-08 17:14:02
问题 I have a GridView with some BoundFields and two TemplateFields . In these two TemplateFields , I dynamically create UserControls containing a DropDownList and a TextBox , which users can modify. When I try to get the values of the controls after a PostBack , the values in BoundFields are still there but my dynamic controls disappears. I can create them again but it won't get the user's values... How can I get these values before they're lost? Here's some of my code: In the RowDataBound event:

ASP.NET Postback problems in IE8

寵の児 提交于 2019-12-08 12:56:32
问题 I am working locally on an ASP.NET site and am experiencing problems with postbacks in IE8 . I have a page with a repeater that builds a table and each row has a LinkButton on it that is used to delete that row. In FireFox and Chrome , the button works as expected - the forms posts back and all the values from the form are available for processing. In IE8, the form posts back but the forms collection is empty, except for the button that initiated the postback . This is a problem because it's

DotNetNuke, PHP, Simulating a remote postback using curl

岁酱吖の 提交于 2019-12-08 09:50:42
问题 I have a page in DNN like: http://nolimitswebdesign.com.dnnmax.com/test/tabid/57/ctl/Edit/mid/374/Default.aspx I need to send a post request to that page using PHP+Curl which modifies the content of text area and saves it (like as if someone modified it manually and clicked the update button on that page). I doubt that with DNN it might not be possible. Please advise. 回答1: Here is how I would approach the problem the same general technique will work on any website. In this context DNN is just

jquery + asp.net delay postback

爱⌒轻易说出口 提交于 2019-12-08 08:34:42
问题 I would like to implement a slideUp jQuery effect on LinkButton click and then do postback on page. The effect takes 600ms to accomplish. The problem I confront with is that before jQuery effect finishes page already does postback, so the jQuery script stops somewhere halfway. Is there any way to delay postback other then doing a manual postback? 回答1: It is possible to provide a function to slideup which will only execute when the sliding is done: formDiv.slideUp('normal', function () { $

How do I increment a step value to be processed when the page loads in ASP.NET?

偶尔善良 提交于 2019-12-08 08:04:22
问题 How do I increment a step value to be processed when the page loads? For example, in the code below the viewstate variable is not incremented until after Page_Load, due to the ASP.NET page lifecycle. protected void Page_Load(object sender, EventArgs e) { switch ((int)ViewState["step"]) { //do something different for each step } } protected void btnIncrementStep_Click(object sender, EventArgs e) { //when the button is clicked, this does not fire //until after page_load finishes ViewState["step

How to re-use model data on post back with MVC

别等时光非礼了梦想. 提交于 2019-12-08 07:35:22
问题 I'm passing structured data to my MVC page when it loads initially. After the user submits a contact form, I want to re-use the same data (I just "leave" the same page up) so I don't have to hit the database again. I declared a variable global to the controller to store the model data, but it's null at the end of the post back, so it looks like I can't re-use it there. Seems like this would be a typical scenario. How do I handle it? 回答1: If you are wanting to reuse viewmodel or other